version:
update:2020.08.31 fix:增加设备锁图标,增加结束进程和打开OTA,增加重启功能 add:
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mjsheng.myappstore.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
@@ -1080,5 +1081,19 @@ public class Utils {
|
||||
}
|
||||
|
||||
|
||||
public static void KillOTA(Context context) {
|
||||
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
manager.killBackgroundProcesses("com.adups.fota");
|
||||
CmdUtil.execute("am force-stop " + "com.adups.fota");
|
||||
}
|
||||
|
||||
public static void openOTA(Context context) {
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
/**知道要跳转应用的包命与目标Activity*/
|
||||
ComponentName componentName = new ComponentName("com.adups.fota", "com.adups.fota.GoogleOtaClient");
|
||||
intent.setComponent(componentName);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user