本文整理匯總了Java中de.robv.android.xposed.XposedHelpers.getBooleanField方法的典型用法代碼示例。如果您正苦於以下問題:Java XposedHelpers.getBooleanField方法的具體用法?Java XposedHelpers.getBooleanField怎麽用?Java XposedHelpers.getBooleanField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類de.robv.android.xposed.XposedHelpers
的用法示例。
在下文中一共展示了XposedHelpers.getBooleanField方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: expandNotificationPanel
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void expandNotificationPanel(boolean withQs) {
Object notifPanel = XposedHelpers.getObjectField(mPhoneStatusBar, "mNotificationPanel");
try {
XposedHelpers.callMethod(notifPanel, "instantExpand");
if (withQs && XposedHelpers.getBooleanField(notifPanel, "mQsExpansionEnabled")) {
XposedHelpers.callMethod(notifPanel, "setQsExpansion",
XposedHelpers.getIntField(notifPanel, "mQsMaxExpansionHeight"));
}
} catch (Throwable t) {
// fallback to alt method
if (withQs) {
XposedHelpers.callMethod(notifPanel, "expandWithQs");
} else if (Utils.isOxygenOs35Rom()) {
XposedHelpers.callMethod(notifPanel, "expand", true);
} else {
XposedHelpers.callMethod(notifPanel, "expand");
}
}
}
示例2: isSignalNull
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private boolean isSignalNull(Object info) {
try {
boolean noSim = XposedHelpers.getBooleanField(info, "noSim");
boolean enabled = XposedHelpers.getBooleanField(info, "enabled");
boolean airplane = XposedHelpers.getBooleanField(info, "airplaneModeEnabled");
int iconId = 1;
try {
iconId = XposedHelpers.getIntField(info, "mobileSignalIconId");
} catch (Throwable t1) {
iconId = XposedHelpers.getIntField(info, "mobileSimIconId");
}
return (noSim || !enabled || airplane || iconId <= 0);
} catch (Throwable t2) {
return false;
}
}
示例3: handleUpdateState
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
@Override
public void handleUpdateState(Object state, Object arg) {
super.handleUpdateState(state, arg);
if (isPrimary() && mDataOffView != null) {
mDataTypeIconVisible = isDataTypeIconVisible(state);
mIsSignalNull = isSignalNull(arg);
if ((Boolean) XposedHelpers.getBooleanField(state, "visible")) {
final boolean shouldShow = canShowDataOffIcon() && !isMobileDataEnabled();
mDataOffView.post(new Runnable() {
@Override
public void run() {
if (mDataOffView != null) {
try {
mDataOffView.setVisibility(shouldShow ?
View.VISIBLE : View.GONE);
} catch (Throwable t) { /* ignore */ }
}
}
});
}
}
}
示例4: setVolume
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void setVolume(float volume) {
Object player = XposedHelpers.getObjectField(mRingtone, "mLocalPlayer");
if (player != null) {
XposedHelpers.callMethod(player, "setVolume", volume);
} else if (XposedHelpers.getBooleanField(mRingtone, "mAllowRemote")) {
player = XposedHelpers.getObjectField(mRingtone, "mRemotePlayer");
if (player != null) {
try {
XposedHelpers.callMethod(player, "setVolume",
XposedHelpers.getObjectField(mRingtone, "mRemoteToken"),
volume);
} catch (Throwable t) {
}
}
}
}
示例5: isOfficialConversation
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private boolean isOfficialConversation(Object value, Object messageStatus) {
String username = XposedHelpers.getObjectField(messageStatus, Constants.Value_Message_Bean_NickName).toString();
ArrayList<String> list = AppSaveInfoUtils.INSTANCE.getWhiteList("white_list_official");
boolean wcY = XposedHelpers.getBooleanField(messageStatus, Value_Message_Status_Is_OFFICIAL_1);
int wcU = XposedHelpers.getIntField(messageStatus, Value_Message_Status_Is_OFFICIAL_2);
String field_username = ((String) XposedHelpers.getObjectField(value, Value_Message_Status_Is_OFFICIAL_3));
boolean isOfficial = !"gh_43f2581f6fd6".equals(field_username) && wcY && (wcU == 1 || wcU == 2 || wcU == 3);
if (isOfficial) {
officialNickNameEntries.add(username);
for (String s : list) {
if (s.trim().equals(username)) return false;
}
}
return isOfficial;
}
示例6: setMenuKeyVisibility
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void setMenuKeyVisibility() {
try {
final boolean showMenu = XposedHelpers.getBooleanField(mNavigationBarView, "mShowMenu");
final int disabledFlags = XposedHelpers.getIntField(mNavigationBarView, "mDisabledFlags");
final boolean visible = (showMenu || mAlwaysShowMenukey) &&
!((disabledFlags & STATUS_BAR_DISABLE_RECENT) != 0);
int menuResId = mResources.getIdentifier("menu", "id", PACKAGE_NAME);
int imeSwitcherResId = mResources.getIdentifier("ime_switcher", "id", PACKAGE_NAME);
for (int i = 0; i <= 1; i++) {
if (mNavbarViewInfo[i] == null) continue;
boolean isImeSwitcherVisible = false;
View v = null;
if (imeSwitcherResId != 0) {
v = mNavbarViewInfo[i].navButtons.findViewById(imeSwitcherResId);
if (v != null) {
isImeSwitcherVisible = v.getVisibility() == View.VISIBLE;
}
}
v = mNavbarViewInfo[i].navButtons.findViewById(menuResId);
if (v != null) {
v.setVisibility(mDpadKeysVisible || isImeSwitcherVisible ? View.GONE :
visible ? View.VISIBLE : View.INVISIBLE);
}
}
} catch (Throwable t) {
log("Error setting menu key visibility:" + t.getMessage());
}
}
示例7: shouldQuickSettingsIntercept
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private boolean shouldQuickSettingsIntercept(Object o, float x, float y, float yDiff) {
if (!XposedHelpers.getBooleanField(o, "mQsExpansionEnabled")) {
return false;
}
boolean showQsOverride = false;
// quick
if (mMode != MODE_OFF) {
final int w = (int) XposedHelpers.callMethod(o, "getMeasuredWidth");
float region = (w * (mSizePercent/100f));
showQsOverride |= (mMode == MODE_RIGHT) ?
(x > w - region) : (mMode == MODE_LEFT) ? (x < region) :
(x > w - region) || (x < region);
}
// auto
if (mModeAuto != MODE_AUTO_OFF && !showQsOverride) {
showQsOverride |= (mModeAuto == MODE_AUTO_NONE) ?
!hasNotifications(o) : !hasClearableNotifications(o);
}
if (XposedHelpers.getBooleanField(o, "mQsExpanded") && !Utils.isOxygenOs35Rom()) {
Object scv = XposedHelpers.getObjectField(o, "mScrollView");
return ((boolean)XposedHelpers.callMethod(scv, "isScrolledToBottom") && yDiff < 0) &&
(boolean)XposedHelpers.callMethod(o, "isInQsArea", x, y);
} else {
return showQsOverride;
}
}
示例8: beforeLockPatternDraw
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
@SuppressWarnings({"unchecked", "rawtypes"})
private static void beforeLockPatternDraw(final Class<? extends Enum> displayModeEnum, final Object thisObject) {
final Object patternDisplayMode = XposedHelpers.getObjectField(thisObject, "mPatternDisplayMode");
final Boolean inStealthMode = XposedHelpers.getBooleanField(thisObject, "mInStealthMode");
if (!mPrefs.getBoolean(GravityBoxSettings.PREF_KEY_LOCKSCREEN_SHOW_PATTERN_ERROR, true) &&
mPatternDisplayMode == null && patternDisplayMode == Enum.valueOf(displayModeEnum, "Wrong")) {
mInStealthMode = inStealthMode;
mPatternDisplayMode = patternDisplayMode;
XposedHelpers.setBooleanField(thisObject, "mInStealthMode", true);
XposedHelpers.setObjectField(thisObject, "mPatternDisplayMode", Enum.valueOf(displayModeEnum, "Correct"));
} else {
mPatternDisplayMode = null;
}
}
示例9: adjustLongPressPowerWhenNonInteractive
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void adjustLongPressPowerWhenNonInteractive() {
try {
if (mSupportLongPressPowerWhenNonInteractiveOrig == null) {
mSupportLongPressPowerWhenNonInteractiveOrig =
XposedHelpers.getBooleanField(mPhoneWindowManager,
"mSupportLongPressPowerWhenNonInteractive");
}
XposedHelpers.setBooleanField(mPhoneWindowManager,
"mSupportLongPressPowerWhenNonInteractive",
mLockscreenTorch == GravityBoxSettings.HWKEY_TORCH_POWER_LONGPRESS ?
true : mSupportLongPressPowerWhenNonInteractiveOrig);
} catch (Throwable t) {
XposedBridge.log(t);
}
}
示例10: updateAutobrightnessConfig
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void updateAutobrightnessConfig(int[] lux, int[] brightness) {
if (mDisplayPowerController == null || mContext == null) return;
if (DEBUG) log("updateAutobrightnessConfig called");
Resources res = mContext.getResources();
boolean mtkVirtualValuesSupport = false;
boolean mtkVirtualValues = false;
int screenBrightnessDim = res.getInteger(res.getIdentifier(
"config_screenBrightnessDim", "integer", "android"));
int screenBrightnessMinimum = res.getInteger(res.getIdentifier(
"config_screenBrightnessSettingMinimum", "integer", "android"));
screenBrightnessMinimum = Math.min(screenBrightnessDim, screenBrightnessMinimum);
boolean useSwAutobrightness = XposedHelpers.getBooleanField(
mDisplayPowerController, "mUseSoftwareAutoBrightnessConfig");
if (useSwAutobrightness) {
// brightness array must have one more element than lux array
int[] brightnessAdj = new int[lux.length + 1];
for (int i = 0; i < brightnessAdj.length; i++) {
if (i < brightness.length) {
brightnessAdj[i] = brightness[i];
} else {
brightnessAdj[i] = 255;
}
}
if (DEBUG) log("updateAutobrightnessConfig: lux=" + Utils.intArrayToString(lux) +
"; brightnessAdj=" + Utils.intArrayToString(brightnessAdj));
if (Utils.isMtkDevice()) {
try {
mtkVirtualValues = (boolean) XposedHelpers.getStaticBooleanField(
mDisplayPowerController.getClass(), "MTK_ULTRA_DIMMING_SUPPORT");
int resId = res.getIdentifier("config_screenBrightnessVirtualValues",
"bool", "android");
if (resId != 0) {
mtkVirtualValues &= res.getBoolean(resId);
}
mtkVirtualValuesSupport = true;
if (DEBUG) log("MTK brightness virtual values: " + mtkVirtualValues);
} catch (Throwable t) {
if (DEBUG) log("Couldn't detect MTK virtual values feature");
}
}
Object autoBrightnessSpline = mtkVirtualValuesSupport ? XposedHelpers.callMethod(
mDisplayPowerController, "createAutoBrightnessSpline",
lux, brightnessAdj, mtkVirtualValues) :
XposedHelpers.callMethod(mDisplayPowerController,
"createAutoBrightnessSpline", lux, brightnessAdj);
if (autoBrightnessSpline != null) {
Object abrCtrl = XposedHelpers.getObjectField(mDisplayPowerController,
"mAutomaticBrightnessController");
XposedHelpers.setObjectField(abrCtrl,
"mScreenAutoBrightnessSpline", autoBrightnessSpline);
if (brightnessAdj[0] < screenBrightnessMinimum) {
screenBrightnessMinimum = brightnessAdj[0];
}
} else {
XposedHelpers.setBooleanField(mDisplayPowerController, "mUseSoftwareAutoBrightnessConfig", false);
log("Error computing auto-brightness spline: lux=" + Utils.intArrayToString(lux) +
"; brightnessAdj=" + Utils.intArrayToString(brightnessAdj));
}
}
int screenBrightnessRangeMinimum = mtkVirtualValuesSupport ?
(Integer) XposedHelpers.callMethod(mDisplayPowerController, "clampAbsoluteBrightness",
screenBrightnessMinimum, mtkVirtualValues) :
(Integer) XposedHelpers.callMethod(
mDisplayPowerController, "clampAbsoluteBrightness", screenBrightnessMinimum);
XposedHelpers.setIntField(mDisplayPowerController, "mScreenBrightnessRangeMinimum",
screenBrightnessRangeMinimum);
if (DEBUG) log("Autobrightness config updated");
}
示例11: getBool
import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static boolean getBool(String field) {
return XposedHelpers.getBooleanField(mPhoneWindowManager, field);
}