关机:
重启:
加上
Intent shutdown = new Intent(Intent.ACTION_REQUEST_SHUTDOWN);
shutdown.putExtra(Intent.EXTRA_KEY_CONFIRM, false);
shutdown.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(shutdown);
重启:
Intent reboot = new Intent(Intent.ACTION_REBOOT);
reboot.putExtra("nowait", 1);
reboot.putExtra("interval", 1);
reboot.putExtra("window", 0);
sendBroadcast(reboot);
加上
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
[color=red]android:sharedUserId="android.uid.system"[/color] android:versionName="1.0">