OSDN Git Service

Fixed HDP Disconnection issue. Included channel to list of channels when channel...
authorPriti Aghera <paghera@broadcom.com>
Sat, 12 May 2012 02:05:04 +0000 (19:05 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 17 Jul 2012 05:06:26 +0000 (22:06 -0700)
Change-Id: Icd361a3f19b883b3cca27fe9eb0cafc3b969290b

src/com/android/bluetooth/hdp/HealthService.java

index 085fcc8..9ab65ea 100755 (executable)
@@ -170,7 +170,6 @@ public class HealthService extends ProfileService {
                                                   BluetoothHealth.STATE_CHANNEL_DISCONNECTED,
                                                   BluetoothHealth.STATE_CHANNEL_DISCONNECTING,
                                                   chan.mChannelFd, chan.mChannelId);
-                        mHealthChannels.remove(chan);
                     }
                 }
                     break;
@@ -214,6 +213,7 @@ public class HealthService extends ProfileService {
                         BluetoothDevice device = getDevice(channelStateEvent.mAddr);
                         chan = new HealthChannel(device, appConfig, appConfig.getChannelType());
                         chan.mChannelId = channelStateEvent.mChannelId;
+                        mHealthChannels.add(chan);
                     }
                     newState = convertHalChannelState(channelStateEvent.mState);
                     if (newState == BluetoothHealth.STATE_CHANNEL_CONNECTED) {
@@ -499,7 +499,6 @@ public class HealthService extends ProfileService {
         }
 
         HealthChannel chan = new HealthChannel(device, config, channelType);
-        mHealthChannels.add(chan);
 
         Message msg = mHandler.obtainMessage(MESSAGE_CONNECT_CHANNEL);
         msg.obj = chan;