OSDN Git Service

Fix crash during Bluetooth on/off stress test
authorAndre Eisenbach <eisenbach@google.com>
Wed, 29 Oct 2014 19:13:38 +0000 (12:13 -0700)
committerJeff Deng <jeffdeng@google.com>
Fri, 7 Nov 2014 00:19:45 +0000 (00:19 +0000)
Bug: 18106938
Change-Id: Icdeb736d89d5926264f2043455ccbc3760fd5d29
(cherry picked from commit 178d3b54cd50558be789c5dfd8dad80ffdc65021)

core/java/android/bluetooth/BluetoothAdapter.java

index f2e03cf..c262bae 100644 (file)
@@ -1445,7 +1445,7 @@ public final class BluetoothAdapter {
                 if (VDBG) Log.d(TAG, "onBluetoothServiceDown: " + mService);
                 synchronized (mManagerCallback) {
                     mService = null;
-                    mLeScanClients.clear();
+                    if (mLeScanClients != null) mLeScanClients.clear();
                     if (sBluetoothLeAdvertiser != null) sBluetoothLeAdvertiser.cleanup();
                     if (sBluetoothLeScanner != null) sBluetoothLeScanner.cleanup();
                     for (IBluetoothManagerCallback cb : mProxyServiceStateCallbacks ){