]> iEval git - fonbot.git/blobdiff - src/ro/ieval/fonbot/Heavy.java
Fix reboot
[fonbot.git] / src / ro / ieval / fonbot / Heavy.java
index 909e7ca1e866dbb0e3c5c3a3546d0172e219de0e..4dcd0fc4317723b6cc1740bb05bb1416f677d891 100644 (file)
@@ -1843,8 +1843,22 @@ 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); 
-               pm.reboot(reason);
+               Utils.sendMessage(context, replyTo, rebooting);
+               try {
+                       pm.reboot(reason);
+               } catch (final Exception e){
+                       e.printStackTrace();
+               }
+               try {
+                       Runtime.getRuntime().exec(new String[]{
+                                       "su",
+                                       "-c",
+                                       "reboot"
+                               }).waitFor();
+               } catch (final Exception e){
+                       e.printStackTrace();
+               }
+               Utils.sendMessage(toNonNull(context), toNonNull(replyTo), reboot_failed);
        }
 
        /**
This page took 0.020512 seconds and 4 git commands to generate.