當前位置: 首頁>>代碼示例>>Java>>正文


Java XposedHelpers.setBooleanField方法代碼示例

本文整理匯總了Java中de.robv.android.xposed.XposedHelpers.setBooleanField方法的典型用法代碼示例。如果您正苦於以下問題:Java XposedHelpers.setBooleanField方法的具體用法?Java XposedHelpers.setBooleanField怎麽用?Java XposedHelpers.setBooleanField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在de.robv.android.xposed.XposedHelpers的用法示例。


在下文中一共展示了XposedHelpers.setBooleanField方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: beforeHookedMethod

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
@Override
protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
    if (mScreenOnDueToActiveScreen) {
        try {
            XposedHelpers.setBooleanField(param.thisObject, "mScreenOn", false);
            if (DEBUG) log("updateLightsLocked: Screen on due to active screen - pretending it's off");
        } catch (Throwable t) {
            XposedBridge.log(t);
        }
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:12,代碼來源:ModLedControl.java

示例2: setKeyguardDisabled

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
public void setKeyguardDisabled(boolean disabled) {
    try {
        mIsKeyguardDisabled = disabled;
        XposedHelpers.callMethod(mMediator, "setKeyguardEnabled", !disabled);
        if (mIsKeyguardDisabled) {
            XposedHelpers.setBooleanField(mMediator, "mNeedToReshowWhenReenabled", false);
        }
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:12,代碼來源:KeyguardStateMonitor.java

示例3: setShowPercentage

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
public void setShowPercentage(boolean showPercentage) {
    if (mBattery != null) {
        try {
            XposedHelpers.setBooleanField(getDrawable(), "mShowPercent", showPercentage);
            getDrawable().invalidateSelf();
            mBattery.invalidate();
        } catch (Throwable t) {
            log("Error setting percentage: " + t.getMessage());
        }
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:12,代碼來源:StatusbarBattery.java

示例4: applyTo

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
public void applyTo(Object state) {
    XposedHelpers.setBooleanField(state, "visible", visible);
    XposedHelpers.setObjectField(state, "icon", getResourceIcon());
    XposedHelpers.setObjectField(state, "label", label);
    XposedHelpers.setBooleanField(state, "autoMirrorDrawable", autoMirrorDrawable);
    XposedHelpers.setBooleanField(state, "value", booleanValue);
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:8,代碼來源:QsTile.java

示例5: handleUpdateState

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
@Override
public void handleUpdateState(Object state, Object arg) {
    final boolean visible = mEnabled &&
            (!mLocked || !mKgMonitor.isShowing()) &&
            (!mLockedOnly || mKgMonitor.isShowing()) &&
            (!mSecured || !(mKgMonitor.isShowing() && mKgMonitor.isLocked()));
    XposedHelpers.setBooleanField(state, "visible", visible);
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:9,代碼來源:AospTile.java

示例6: 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;
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:16,代碼來源:ModLockscreen.java

示例7: afterLockPatternDraw

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void afterLockPatternDraw(final Object thisObject) {
    if (null != mPatternDisplayMode) {
        XposedHelpers.setBooleanField(thisObject, "mInStealthMode", mInStealthMode);
        XposedHelpers.setObjectField(thisObject, "mPatternDisplayMode", mPatternDisplayMode);
        mInStealthMode = false;
        mPatternDisplayMode = null;
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:9,代碼來源:ModLockscreen.java

示例8: doubleHomeHook

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void doubleHomeHook(XC_MethodHook.MethodHookParam param) {
    if (!isTaskLocked() && getActionFor(HwKeyTrigger.HOME_DOUBLETAP).actionId !=
            GravityBoxSettings.HWKEY_ACTION_DEFAULT) {
        XposedHelpers.setBooleanField(param.thisObject, "mHomeConsumed", true);
        performAction(HwKeyTrigger.HOME_DOUBLETAP);
        param.setResult(null);
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:9,代碼來源:ModHwKeys.java

示例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);
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:16,代碼來源:ModHwKeys.java

示例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");
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:77,代碼來源:ModDisplay.java

示例11: setBool

import de.robv.android.xposed.XposedHelpers; //導入方法依賴的package包/類
private static void setBool(String field, boolean value) {
    XposedHelpers.setBooleanField(mPhoneWindowManager, field, value);
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:4,代碼來源:ModExpandedDesktop.java


注:本文中的de.robv.android.xposed.XposedHelpers.setBooleanField方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。