Don't call pollServer from a BroadcastRecevier
[fonbot.git] / src / ro / ieval / fonbot / FonBotMainService.java
index a751d231c434173188b16dcd6a6037273eb83430..753425d18081daa9a54c67eb1f2c2ac8248f5612 100644 (file)
@@ -70,6 +70,8 @@ public final class FonBotMainService extends Service {
         * Broadcast action: remove an ongoing event
         */
        public static final String ACTION_DELETE_ONGOING="ro.ieval.fonbot.FonBotMainService.ACTION_DELETE_ONGOING";
+       /** Broadcast action: trigger a server poll */
+       public static final String ACTION_TRIGGER_POLL="ro.ieval.fonbot.FonBotMainService.ACTION_TRIGGER_POLL";
        /**
         * Extra: ongoing event id
         *
@@ -139,6 +141,9 @@ public final class FonBotMainService extends Service {
                        LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(ACTION_ONGOING_UPDATE));
                }
 
+               if(intent!=null && intent.getAction()==ACTION_TRIGGER_POLL)
+                       Utils.pollServer(this);
+
                final boolean runForeground=PreferenceManager.getDefaultSharedPreferences(this).getBoolean("foreground", false);
                if(!runForeground)
                        stopForeground(true);
This page took 0.009664 seconds and 4 git commands to generate.