Java Code Examples for de.robv.android.xposed.XposedHelpers#getBooleanField()
The following examples show how to use
de.robv.android.xposed.XposedHelpers#getBooleanField() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModStatusBar.java From GravityBox with Apache License 2.0 | 6 votes |
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"); } } }
Example 2
Source File: CellularTile.java From GravityBox with Apache License 2.0 | 6 votes |
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; } }
Example 3
Source File: CellularTile.java From GravityBox with Apache License 2.0 | 6 votes |
@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 */ } } } }); } } }
Example 4
Source File: ModRinger.java From GravityBox with Apache License 2.0 | 6 votes |
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) { } } } }
Example 5
Source File: XposedHelpersWraper.java From MIUIAnesthetist with MIT License | 5 votes |
public static boolean getBooleanField(Object obj, String fieldName) { try { return XposedHelpers.getBooleanField(obj, fieldName); } catch (Throwable t) { log(t); } return false; }
Example 6
Source File: ModNavigationBar.java From GravityBox with Apache License 2.0 | 5 votes |
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()); } }
Example 7
Source File: QsQuickPulldownHandler.java From GravityBox with Apache License 2.0 | 5 votes |
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; } }
Example 8
Source File: ModLockscreen.java From GravityBox with Apache License 2.0 | 5 votes |
@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; } }
Example 9
Source File: ModHwKeys.java From GravityBox with Apache License 2.0 | 5 votes |
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); } }
Example 10
Source File: ModDisplay.java From GravityBox with Apache License 2.0 | 4 votes |
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"); }
Example 11
Source File: ModExpandedDesktop.java From GravityBox with Apache License 2.0 | 4 votes |
private static boolean getBool(String field) { return XposedHelpers.getBooleanField(mPhoneWindowManager, field); }