X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fro%2Fieval%2Ffonbot%2FHeavy.java;h=e4ff0a4cb2dd2f45939d4f970d3bc9b779326a1f;hb=828b60f224e51edfb1840d03f7a6d745b44e01b7;hp=7ebd3883644df71a6f280d4c4197eb5be60cccb1;hpb=0645109c10283b3f062b73b58d4ddafe94d71db2;p=fonbot.git diff --git a/src/ro/ieval/fonbot/Heavy.java b/src/ro/ieval/fonbot/Heavy.java index 7ebd388..e4ff0a4 100644 --- a/src/ro/ieval/fonbot/Heavy.java +++ b/src/ro/ieval/fonbot/Heavy.java @@ -1427,7 +1427,7 @@ final class Heavy { sent.putExtra(SmsStatusReceiver.EXTRA_PART, i+1); sent.putExtra(SmsStatusReceiver.EXTRA_TOTAL, messages.size()); sent.putExtra(SmsStatusReceiver.EXTRA_REPLY_TO, replyTo.toString()); - sent.setAction(SmsStatusReceiver.SENT_ACTION+i);//actions must be unique + sent.setAction(SmsStatusReceiver.SENT_ACTION+i+System.currentTimeMillis());//actions must be unique sents.add(PendingIntent.getBroadcast(context, 0, sent, PendingIntent.FLAG_UPDATE_CURRENT)); final Intent delivered=new Intent(context, SmsStatusReceiver.class); @@ -1435,7 +1435,7 @@ final class Heavy { delivered.putExtra(SmsStatusReceiver.EXTRA_PART, i+1); delivered.putExtra(SmsStatusReceiver.EXTRA_TOTAL, messages.size()); delivered.putExtra(SmsStatusReceiver.EXTRA_REPLY_TO, replyTo.toString()); - delivered.setAction(SmsStatusReceiver.DELIVERED_ACTION+i);//actions must be unique + delivered.setAction(SmsStatusReceiver.DELIVERED_ACTION+i+System.currentTimeMillis());//actions must be unique delivereds.add(PendingIntent.getBroadcast(context, 0, delivered, PendingIntent.FLAG_UPDATE_CURRENT)); } @@ -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(); } /**