Call reboot command as root if PowerManager#reboot fails
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 19 Aug 2014 21:53:33 +0000 (00:53 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 19 Aug 2014 21:54:12 +0000 (00:54 +0300)
This should resolve bug 1, reported by treaki.

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.01225 seconds and 4 git commands to generate.