OSDN Git Service

Add missing null pointer check inside HeadSetClientService.stop()
authorLianchao Song <songlianchao@huawei.com>
Mon, 9 May 2016 14:50:57 +0000 (22:50 +0800)
committerZheng Zhang <zhzh@google.com>
Wed, 17 Aug 2016 16:05:44 +0000 (16:05 +0000)
Bug: 28664857

Change-Id: I62abc4eb4127db2d4f0cde44eca618996f099b49
Signed-off-by: Lianchao Song <songlianchao@huawei.com>
cherry-picked from AOSP bebc4dd9edb40710d9588b4a2010eef227756a8e

src/com/android/bluetooth/hfpclient/HeadsetClientService.java

index 8945490..0ea73fa 100644 (file)
@@ -90,7 +90,9 @@ public class HeadsetClientService extends ProfileService {
         } catch (Exception e) {
             Log.w(TAG, "Unable to unregister broadcast receiver", e);
         }
-        mStateMachine.doQuit();
+        if (mStateMachine != null) {
+            mStateMachine.doQuit();
+        }
 
         // Stop the HfpClientConnectionService.
         Intent stopIntent = new Intent(this, HfpClientConnectionService.class);