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


Java XposedHelpers.callMethod方法代码示例

本文整理汇总了Java中de.robv.android.xposed.XposedHelpers.callMethod方法的典型用法代码示例。如果您正苦于以下问题:Java XposedHelpers.callMethod方法的具体用法?Java XposedHelpers.callMethod怎么用?Java XposedHelpers.callMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.robv.android.xposed.XposedHelpers的用法示例。


在下文中一共展示了XposedHelpers.callMethod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDefaultSubscription

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private boolean setDefaultSubscription(final SubType subType, final SubscriptionInfo subInfo) {
    if (subInfo == null)
        return false;

    try {
        if (subType == SubType.SMS) {
            XposedHelpers.callMethod(mSubMgr, "setDefaultSmsSubId",
                    subInfo.getSubscriptionId());
        } else if (subType == SubType.DATA) {
            XposedHelpers.callMethod(mSubMgr, "setDefaultDataSubId",
                    subInfo.getSubscriptionId());
        }
        return true;
    } catch (Throwable t) {
        XposedBridge.log(t);
        return false;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:19,代码来源:SubscriptionManager.java

示例2: startActivity

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private void startActivity(Intent intent) {
    // if intent is a GB action of broadcast type, handle it directly here
    if (ShortcutActivity.isGbBroadcastShortcut(intent)) {
        boolean isLaunchBlocked = mKgMonitor.isShowing() && mKgMonitor.isLocked() &&
                !ShortcutActivity.isActionSafe(intent.getStringExtra(
                        ShortcutActivity.EXTRA_ACTION));
        if (DEBUG) log("isLaunchBlocked: " + isLaunchBlocked);

        if (!isLaunchBlocked) {
            Intent newIntent = new Intent(intent.getStringExtra(ShortcutActivity.EXTRA_ACTION));
            newIntent.putExtras(intent);
            mContext.sendBroadcast(newIntent);
        }
    // otherwise start activity dismissing keyguard
    } else {
        try {
            XposedHelpers.callMethod(mStatusBar, "postStartActivityDismissingKeyguard", intent, 0);
        } catch (Throwable t) {
            XposedBridge.log(t);
        }
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:23,代码来源:LockscreenAppBar.java

示例3: updateBtIconVisibility

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private void updateBtIconVisibility() {
    if (mSbService == null || mBtMode == null) return;

    try {
        BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
        if (btAdapter != null) {
            boolean enabled = btAdapter.getState() == BluetoothAdapter.STATE_ON;
            boolean connected = (Integer) XposedHelpers.callMethod(btAdapter, "getConnectionState") ==
                    BluetoothAdapter.STATE_CONNECTED;
            boolean visible;
            switch (mBtMode) {
                default:
                case DEFAULT: visible = enabled; break;
                case CONNECTED: visible = connected; break;
                case HIDDEN: visible = false; break;
            }
            if (DEBUG) log("updateBtIconVisibility: enabled=" + enabled + "; connected=" + connected +
                    "; visible=" + visible);
            XposedHelpers.callMethod(mSbService, "setIconVisibility", "bluetooth", visible);
        }
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:25,代码来源:SystemIconController.java

示例4: getDefaultNotificationProp

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private static int getDefaultNotificationProp(String resName, String resType, int defVal) {
    int val = defVal;
    try {
        Context ctx = (Context) XposedHelpers.callMethod(
                mNotifManagerService, "getContext");
        Resources res = ctx.getResources();
        int resId = res.getIdentifier(resName, resType, "android");
        if (resId != 0) {
            switch (resType) {
                case "color": val = res.getColor(resId); break;
                case "integer": val = res.getInteger(resId); break;
            }
        }
    } catch (Throwable t) {
        if (DEBUG) XposedBridge.log(t); 
    }
    return val;
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:20,代码来源:ModLedControl.java

示例5: setTethering

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private void setTethering(boolean enabled) {
    try {
        Object pan = mBluetoothPan.get();
        if (pan != null) {
            XposedHelpers.callMethod(pan, "setBluetoothTethering", enabled);
            if (DEBUG) log("setTethering: enabled=" + enabled);
        }
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:12,代码来源:BluetoothTetheringTile.java

示例6: dismissKeyguard

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void dismissKeyguard() {
    try {
        XposedHelpers.callMethod(mPhoneWindowManager, "dismissKeyguardLw");
    } catch (Throwable t) {
        if (DEBUG) XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:8,代码来源:ModHwKeys.java

示例7: setUsbTethering

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private void setUsbTethering(boolean enabled) {
    try {
        XposedHelpers.callMethod(mCm, "setUsbTethering", enabled);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:8,代码来源:UsbTetherTile.java

示例8: changeNfcState

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void changeNfcState(Intent intent) {
    if (mContext == null) return;
    NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
    if (adapter == null) return;

    try {
        boolean enable = false;
        if (intent.hasExtra(AShortcut.EXTRA_ENABLE)) {
            enable = intent.getBooleanExtra(AShortcut.EXTRA_ENABLE, false);
        } else {
            int nfcState = (Integer) XposedHelpers.callMethod(adapter, "getAdapterState");
            switch (nfcState) {
                case NFC_STATE_TURNING_ON:
                case NFC_STATE_ON:
                    enable = false;
                    break;
                case NFC_STATE_TURNING_OFF:
                case NFC_STATE_OFF:
                    enable = true;
                    break;
            }
        }
        XposedHelpers.callMethod(adapter, enable ? "enable" : "disable");
        if (intent.getBooleanExtra(AShortcut.EXTRA_SHOW_TOAST, false)) {
            Utils.postToast(mContext, enable ? R.string.nfc_on : R.string.nfc_off);
        }
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:31,代码来源:ConnectivityServiceWrapper.java

示例9: setBarMode

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void setBarMode(int mode) {
    try {
        Object bt = XposedHelpers.callMethod(mNavigationBarView, "getBarTransitions");
        XposedHelpers.callMethod(bt, "applyMode", mode, true, true);
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:9,代码来源:ModNavigationBar.java

示例10: updateClock

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private void updateClock() {
    try {
        XposedHelpers.callMethod(mClock, "updateClock");
    } catch (Throwable t) {
        log("Error in updateClock: " + t.getMessage());
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:8,代码来源:StatusbarClock.java

示例11: updateStreamVolumeAlias

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void updateStreamVolumeAlias() {
    if (mAudioService == null) {
        if (DEBUG) log("updateStreamVolumeAlias: AudioService is null");
        return;
    }

    try {
        XposedHelpers.callMethod(mAudioService, "updateStreamVolumeAlias", true, "AudioService");
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:13,代码来源:ModAudio.java

示例12: showDetail

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private boolean showDetail() {
    try {
        mClickHookBlocked = true;
        XposedHelpers.callMethod(mTile, "handleClick");
        return true;
    } catch (Throwable t) {
        XposedBridge.log(t);
        return false;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:11,代码来源:CellularTile.java

示例13: getOperatorState

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
public String getOperatorState() {
    if (!mHasTelephony) {
        return null;
    }
    if (mServiceState == null || mServiceState.getState() == ServiceState.STATE_OUT_OF_SERVICE) {
        return mGbResources.getString(R.string.pie_phone_status_no_service);
    }
    if (mServiceState.getState() == ServiceState.STATE_POWER_OFF) {
        return mGbResources.getString(R.string.pie_phone_status_airplane_mode);
    }
    if ((Boolean)XposedHelpers.callMethod(mServiceState, "isEmergencyOnly")) {
        return mGbResources.getString(R.string.pie_phone_status_emergency_only);
    }
    return mServiceState.getOperatorAlphaLong();
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:16,代码来源:PieController.java

示例14: onLongClick

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
@Override
public boolean onLongClick(View v) {
    try {
        Intent intent = new Intent(Settings.ACTION_DISPLAY_SETTINGS);
        Object host = XposedHelpers.getObjectField(mQsPanel, "mHost");
        XposedHelpers.callMethod(host, "startActivityDismissingKeyguard", intent);
        return true;
    } catch (Throwable t) {
        XposedBridge.log(t);
        return false;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:13,代码来源:QsPanel.java

示例15: setMobileDataEnabled

import de.robv.android.xposed.XposedHelpers; //导入方法依赖的package包/类
private static void setMobileDataEnabled(boolean enabled) {
    if (mTelephonyManager == null) return;
    try {
        XposedHelpers.callMethod(mTelephonyManager, "setDataEnabled", enabled);
        if (DEBUG) log("setDataEnabled called");
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:10,代码来源:ConnectivityServiceWrapper.java


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