OSDN Git Service

HDP-App crash fix
authorPriti Aghera <paghera@broadcom.com>
Mon, 18 Jun 2012 20:57:50 +0000 (13:57 -0700)
committerMatthew Xie <mattx@google.com>
Wed, 25 Jul 2012 08:27:26 +0000 (01:27 -0700)
Set the channel fd to null in channel state callback if new state is not CONNECTED

Change-Id: Id540d9ca2e20ef3e03b11a61634b8a2cb4e05df1

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

index 4f2d20a..b843bc6 100755 (executable)
@@ -252,6 +252,10 @@ public class HealthService extends ProfileService {
                             break;
                         }
                     }
+                    /*set the channel fd to null if channel state isnot equal to connected*/
+                    else{
+                        chan.mChannelFd = null;
+                    }
                     callHealthChannelCallback(chan.mConfig, chan.mDevice, newState,
                                               chan.mState, chan.mChannelFd, chan.mChannelId);
                     chan.mState = newState;