From ea5fe9e95a888d623329d17d048ee360ea114ad1 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Tue, 28 Aug 2012 22:08:49 +1200 Subject: [PATCH] altosdroid: move methods around Signed-off-by: Mike Beattie --- .../altusmetrum/AltosDroid/AltosDroid.java | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java index e3e6012e..8e63f630 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java @@ -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; - } - } - } -- 2.30.2