|
@@ -5,6 +5,8 @@ import android.content.Intent;
|
|
import android.os.SystemProperties;
|
|
import android.os.SystemProperties;
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
|
|
|
|
|
+import com.wdkl.callingdoor.MyApplication;
|
|
|
|
+
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
|
|
|
|
import serialporttest.utils.SerialPortUtil;
|
|
import serialporttest.utils.SerialPortUtil;
|
|
@@ -62,8 +64,12 @@ public class AutoRebootUtil {
|
|
closeHeart();
|
|
closeHeart();
|
|
try {
|
|
try {
|
|
if (SerialPortUtil.systemVersionIsO()) {// android8.1 //wuyq modify
|
|
if (SerialPortUtil.systemVersionIsO()) {// android8.1 //wuyq modify
|
|
- SystemProperties.set("persist.sys.reboot", "1");
|
|
|
|
-
|
|
|
|
|
|
+ //SystemProperties.set("persist.sys.reboot", "1");
|
|
|
|
+ Intent intent = new Intent(Intent.ACTION_REBOOT);
|
|
|
|
+ intent.putExtra("nowait", 1);
|
|
|
|
+ intent.putExtra("interval", 1);
|
|
|
|
+ intent.putExtra("window", 0);
|
|
|
|
+ MyApplication.getAppContext().sendBroadcast(intent);
|
|
} else {
|
|
} else {
|
|
Process proc = Runtime.getRuntime().exec(new String[]{"su", "-c", "/system/bin/reboot"});
|
|
Process proc = Runtime.getRuntime().exec(new String[]{"su", "-c", "/system/bin/reboot"});
|
|
proc.waitFor();
|
|
proc.waitFor();
|