|
|
|
@ -3,6 +3,7 @@ package com.xypower.mpmaster.sms;
|
|
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
|
import android.os.Build;
|
|
|
|
|
import android.os.Environment;
|
|
|
|
|
|
|
|
|
@ -331,18 +332,21 @@ public class UpdateSysConfigUtil {
|
|
|
|
|
|
|
|
|
|
//重启应用
|
|
|
|
|
public static void restartApp(Context context) {
|
|
|
|
|
Intent intent = new Intent();
|
|
|
|
|
intent.setAction(APP_ACTION_UPDATE_CONFIGS);
|
|
|
|
|
intent.putExtra("restart", 1);
|
|
|
|
|
context.sendBroadcast(intent);
|
|
|
|
|
PackageManager packageManager = context.getPackageManager();
|
|
|
|
|
Intent intent = packageManager.getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPAPP);
|
|
|
|
|
intent.putExtra("noDelay", 1);
|
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
|
context.startActivity(intent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//重启运维应用
|
|
|
|
|
public static void restartMasterApp(Context context) {
|
|
|
|
|
Intent intent = new Intent();
|
|
|
|
|
intent.setAction(MASTER_ACTION_UPDATE_CONFIGS);
|
|
|
|
|
intent.putExtra("restart", 1);
|
|
|
|
|
context.sendBroadcast(intent);
|
|
|
|
|
PackageManager packageManager = context.getPackageManager();
|
|
|
|
|
Intent intent = packageManager.getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
|
|
|
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
|
|
|
context.startActivity(intent);
|
|
|
|
|
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void takePhotoOrVideo(Context context, long channel, long preset, boolean photoOrVideo) {
|
|
|
|
|