X-Git-Url: http://git.ieval.ro/?p=fonbot.git;a=blobdiff_plain;f=src%2Fro%2Fieval%2Ffonbot%2FHeavy.java;h=4dcd0fc4317723b6cc1740bb05bb1416f677d891;hp=e4ff0a4cb2dd2f45939d4f970d3bc9b779326a1f;hb=ba6b96a349051e64a04e8969bb1f907d9d4b01a7;hpb=828b60f224e51edfb1840d03f7a6d745b44e01b7 diff --git a/src/ro/ieval/fonbot/Heavy.java b/src/ro/ieval/fonbot/Heavy.java index e4ff0a4..4dcd0fc 100644 --- a/src/ro/ieval/fonbot/Heavy.java +++ b/src/ro/ieval/fonbot/Heavy.java @@ -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); } /**