本文整理汇总了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;
}
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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);
}
}