altosdroid: move methods around
authorMike Beattie <mike@ethernal.org>
Tue, 28 Aug 2012 10:08:49 +0000 (22:08 +1200)
committerMike Beattie <mike@ethernal.org>
Tue, 28 Aug 2012 10:08:49 +0000 (22:08 +1200)
Signed-off-by: Mike Beattie <mike@ethernal.org>
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java

index e3e6012e7357b0501b187c60ec92c1dd6eb40db3..8e63f6305773617fac8fedaca6d2ef1b0b254ac5 100644 (file)
@@ -139,6 +139,30 @@ public class AltosDroid extends Activity {
        };
 
 
+       void doBindService() {
+               bindService(new Intent(this, TelemetryService.class), mConnection, Context.BIND_AUTO_CREATE);
+               mIsBound = true;
+       }
+
+       void doUnbindService() {
+               if (mIsBound) {
+                       // If we have received the service, and hence registered with it, then now is the time to unregister.
+                       if (mService != null) {
+                               try {
+                                       Message msg = Message.obtain(null, TelemetryService.MSG_UNREGISTER_CLIENT);
+                                       msg.replyTo = mMessenger;
+                                       mService.send(msg);
+                               } catch (RemoteException e) {
+                                       // There is nothing special we need to do if the service has crashed.
+                               }
+                       }
+                       // Detach our existing connection.
+                       unbindService(mConnection);
+                       mIsBound = false;
+               }
+       }
+
+
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
@@ -286,28 +310,4 @@ public class AltosDroid extends Activity {
                return false;
        }
 
-
-       void doBindService() {
-               bindService(new Intent(this, TelemetryService.class), mConnection, Context.BIND_AUTO_CREATE);
-               mIsBound = true;
-       }
-
-       void doUnbindService() {
-               if (mIsBound) {
-                       // If we have received the service, and hence registered with it, then now is the time to unregister.
-                       if (mService != null) {
-                               try {
-                                       Message msg = Message.obtain(null, TelemetryService.MSG_UNREGISTER_CLIENT);
-                                       msg.replyTo = mMessenger;
-                                       mService.send(msg);
-                               } catch (RemoteException e) {
-                                       // There is nothing special we need to do if the service has crashed.
-                               }
-                       }
-                       // Detach our existing connection.
-                       unbindService(mConnection);
-                       mIsBound = false;
-               }
-       }
-
 }