X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fro%2Fieval%2Ffonbot%2FHeavy.java;h=4e064a718433493838212b6064c66a551229a1e0;hb=ca40a5cc0f95f37d2ac3008d5fa3f0adaf47d736;hp=f1afb0b3842f4f458ea489b74a94813c8be46247;hpb=72de2947b5234e3b8495065e358530d9fddf3fb8;p=fonbot.git diff --git a/src/ro/ieval/fonbot/Heavy.java b/src/ro/ieval/fonbot/Heavy.java index f1afb0b..4e064a7 100644 --- a/src/ro/ieval/fonbot/Heavy.java +++ b/src/ro/ieval/fonbot/Heavy.java @@ -737,9 +737,6 @@ final class Heavy { case LOCATION: nolocation(context, toNonNull(Address.BLACKHOLE)); break; - case POLL: - poll(context, toNonNull(Address.BLACKHOLE), 0); - break; case RING: ring(context, toNonNull(Address.BLACKHOLE), false); break; @@ -1548,30 +1545,7 @@ final class Heavy { */ public static void poll(final Context context, final Address replyTo) { Utils.sendMessage(context, replyTo, polling_server); - Utils.pollServer(context); - } - - /** - * Change the server poll interval. - * - * @param context Context instance - * @param replyTo reply Address - * @param ms server poll interval in milliseconds. If 0, server poll is disabled - */ - public static void poll(final Context context, final Address replyTo, final long ms){ - final AlarmManager man=(AlarmManager) context.getSystemService(Context.ALARM_SERVICE); - final Intent pollAlarm=new Intent(context, FonBotMainService.class); - pollAlarm.setAction(FonBotMainService.ACTION_TRIGGER_POLL); - final PendingIntent intent=PendingIntent.getService(context, 0, pollAlarm, 0); - if(ms==0){ - Utils.unregisterOngoing(context, toNonNull(OngoingEvent.POLL)); - man.cancel(intent); - Utils.sendMessage(context, replyTo, polling_stopped); - } else { - Utils.registerOngoing(context, toNonNull(OngoingEvent.POLL)); - man.setRepeating(AlarmManager.RTC_WAKEUP, 0, ms, intent); - Utils.sendMessage(context, replyTo, polling_every_milliseconds, Long.valueOf(ms)); - } + context.startService(new Intent(context, FonBotMainService.class)); } /**