]> iEval git - fonbot.git/blobdiff - src/ro/ieval/fonbot/Heavy.java
Remove the SHUTDOWN command
[fonbot.git] / src / ro / ieval / fonbot / Heavy.java
index df48722ea5b6dacb9cd65102165b54945481d1a2..3af6bc463e6da2b1e236048c7a67ba4360213ff3 100644 (file)
@@ -166,6 +166,7 @@ final class Heavy {
                        final Date locationDate=new Date(loc.getTime());
                        sb.append(" ");
                        sb.append(toNonNull(context.getString(at)));
+                       sb.append(" ");
                        sb.append(locationDate.toString());
                        Utils.sendMessage(toNonNull(context), toNonNull(replyTo), toNonNull(sb.toString()));
                }
@@ -460,9 +461,6 @@ final class Heavy {
                case REBOOT:
                        Utils.sendMessage(context, replyTo, reboot_help);
                        break;
-               case SHUTDOWN:
-                       Utils.sendMessage(context, replyTo, shutdown_help);
-                       break;
                case NOTIFY:
                        Utils.sendMessage(context, replyTo, notify_help);
                }
@@ -938,7 +936,7 @@ final class Heavy {
         * @see LocationManager#requestLocationUpdates(String, long, float, LocationListener)
         */
        public static void location(final Context context, final Address replyTo, final String provider,final long minTime,final float minDistance){
-               final LocationManager man=(LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
+               final LocationManager man=(LocationManager) context.getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
                if(locationListener!=null)
                        nolocation(context, toNonNull(Address.BLACKHOLE));
                Utils.registerOngoing(context, toNonNull(OngoingEvent.LOCATION));
@@ -1048,7 +1046,7 @@ final class Heavy {
         */
        public static void nolocation(final Context context, final Address replyTo){
                Utils.unregisterOngoing(context, toNonNull(OngoingEvent.LOCATION));
-               final LocationManager man=(LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
+               final LocationManager man=(LocationManager) context.getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
                man.removeUpdates(locationListener);
                locationListener=null;
                Utils.sendMessage(context, replyTo, no_longer_listening_for_location_updates);
@@ -1507,7 +1505,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 +1517,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.023734 seconds and 4 git commands to generate.