altosdroid: need sendMessageToClients() for setState().. oops!
authorMike Beattie <mike@ethernal.org>
Sun, 26 Aug 2012 11:24:13 +0000 (23:24 +1200)
committerMike Beattie <mike@ethernal.org>
Sun, 26 Aug 2012 11:24:13 +0000 (23:24 +1200)
Signed-off-by: Mike Beattie <mike@ethernal.org>
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java

index 1903cc1de2d8c2084cebfebda7cdabad9a3590ac..9c2fde97b778dc434a8e060f1d2f9a048a634710 100644 (file)
@@ -102,6 +102,16 @@ public class TelemetryService extends Service {
                }
        }
 
+       private void sendMessageToClients(Message m) {
+               for (int i=mClients.size()-1; i>=0; i--) {
+                       try {
+                               mClients.get(i).send(m);
+                       } catch (RemoteException e) {
+                               mClients.remove(i);
+                       }
+               }
+       }
+
        private void stopAltosBluetooth() {
                setState(STATE_READY);
                if (mAltosBluetooth != null) {