當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。