altosdroid: really don't need to store a local copy of the device name
authorMike Beattie <mike@ethernal.org>
Mon, 27 Aug 2012 07:39:09 +0000 (19:39 +1200)
committerMike Beattie <mike@ethernal.org>
Mon, 27 Aug 2012 07:39:09 +0000 (19:39 +1200)
Signed-off-by: Mike Beattie <mike@ethernal.org>
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java

index c809f733971d0a7ccdda93005da731498834c24d..14e41ba0cb5a8aa6d2c4dd2b088f7da77938097e 100644 (file)
@@ -68,7 +68,6 @@ public class TelemetryService extends Service {
 
        // Name of the connected device
        private BluetoothDevice device = null;
-       private String mConnectedDeviceName = null;
        private AltosBluetooth mAltosBluetooth = null;
        private int state = STATE_NONE;
        LinkedBlockingQueue<AltosLine> telem;
@@ -102,8 +101,7 @@ public class TelemetryService extends Service {
                                break;
                        case MSG_CONNECTED:
                                if (D) Log.d(TAG, "Connected to device");
-                               s.mConnectedDeviceName = s.device.getName();
-                               s.sendMessageToClients(Message.obtain(null, AltosDroid.MSG_DEVNAME, s.mConnectedDeviceName));
+                               s.sendMessageToClients(Message.obtain(null, AltosDroid.MSG_DEVNAME, s.device.getName()));
                                s.setState(STATE_CONNECTED);
                                s.mAltosBluetooth.add_monitor(s.telem);
                                break;
@@ -131,7 +129,6 @@ public class TelemetryService extends Service {
                        mAltosBluetooth.close();
                        mAltosBluetooth = null;
                }
-               mConnectedDeviceName = null;
                device = null;
                telem.clear();
        }