]> iEval git - fonbot.git/blobdiff - src/ro/ieval/fonbot/Heavy.java
Remove LocalBroadcastReceiver
[fonbot.git] / src / ro / ieval / fonbot / Heavy.java
index df48722ea5b6dacb9cd65102165b54945481d1a2..f734437f4c452d8c3ee8dc11f25db109dbfa11f1 100644 (file)
@@ -1507,7 +1507,7 @@ final class Heavy {
         */
        public static void poll(final Context context, final Address replyTo) {
                Utils.sendMessage(context, replyTo, polling_server);
-               new PollServerAsyncTask().execute();
+               Utils.pollServer(context);
        }
 
        /**
@@ -1519,9 +1519,9 @@ final class Heavy {
         */
        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, LocalBroadcastReceiver.class);
-               pollAlarm.setAction(LocalBroadcastReceiver.ACTION_POLL_ALARM);
-               final PendingIntent intent=PendingIntent.getBroadcast(context, 0, pollAlarm, 0);
+               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);
This page took 0.023009 seconds and 4 git commands to generate.