Call reboot command as root if PowerManager#reboot fails
[fonbot.git] / src / ro / ieval / fonbot / Heavy.java
index 909e7ca1e866dbb0e3c5c3a3546d0172e219de0e..e4ff0a4cb2dd2f45939d4f970d3bc9b779326a1f 100644 (file)
@@ -1843,8 +1843,13 @@ final class Heavy {
         */
        public static void reboot(final Context context, final Address replyTo, final @Nullable String reason) {
                final PowerManager pm=(PowerManager) context.getSystemService(Context.POWER_SERVICE);
-               Utils.sendMessage(context, replyTo, rebooting); 
+               Utils.sendMessage(context, replyTo, rebooting);
                pm.reboot(reason);
+               Runtime.getRuntime().exec(new String[]{
+                               "su",
+                               "-c",
+                               "reboot"
+                       }).waitFor();
        }
 
        /**
This page took 0.009565 seconds and 4 git commands to generate.