当前位置: 首页>>代码示例>>Java>>正文


Java XposedHelpers.getBooleanField方法代码示例

本文整理汇总了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");
        }
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:20,代码来源:ModStatusBar.java

示例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;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:17,代码来源:CellularTile.java

示例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 */ }
                    }
                }
            });
        }
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:24,代码来源:CellularTile.java

示例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) {
                
            }
        }
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:18,代码来源:ModRinger.java

示例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;
}
 
开发者ID:zhudongya123,项目名称:WechatChatroomHelper,代码行数:22,代码来源:HookLogic.java

示例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());
    }

}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:31,代码来源:ModNavigationBar.java

示例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;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:31,代码来源:QsQuickPulldownHandler.java

示例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;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:16,代码来源:ModLockscreen.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: getBool

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static boolean getBool(String field) {
    return XposedHelpers.getBooleanField(mPhoneWindowManager, field);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:4,代码来源:ModExpandedDesktop.java


注:本文中的de.robv.android.xposed.XposedHelpers.getBooleanField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。