Fix reboot
[fonbot.git] / src / ro / ieval / fonbot / Heavy.java
index e4ff0a4cb2dd2f45939d4f970d3bc9b779326a1f..4dcd0fc4317723b6cc1740bb05bb1416f677d891 100644 (file)
@@ -1844,12 +1844,21 @@ 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);
-               Runtime.getRuntime().exec(new String[]{
-                               "su",
-                               "-c",
-                               "reboot"
-                       }).waitFor();
+               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.009424 seconds and 4 git commands to generate.