Merge "Add missing "try ... finally" safeguards" into nyc-dev am: 0810732a2a
am: 505425c063
* commit '505425c0631585a943de164a051bb6a83fd1ffec':
Add missing "try ... finally" safeguards
Change-Id: I65dd9d226f759b997e548186d5c3c8c85eb44da2
This commit is contained in:
@@ -2045,12 +2045,15 @@ public final class BluetoothAdapter {
|
||||
public void onBluetoothServiceDown() {
|
||||
if (VDBG) Log.d(TAG, "onBluetoothServiceDown: " + mService);
|
||||
|
||||
mServiceLock.writeLock().lock();
|
||||
mService = null;
|
||||
if (mLeScanClients != null) mLeScanClients.clear();
|
||||
if (sBluetoothLeAdvertiser != null) sBluetoothLeAdvertiser.cleanup();
|
||||
if (sBluetoothLeScanner != null) sBluetoothLeScanner.cleanup();
|
||||
mServiceLock.writeLock().unlock();
|
||||
try {
|
||||
mServiceLock.writeLock().lock();
|
||||
mService = null;
|
||||
if (mLeScanClients != null) mLeScanClients.clear();
|
||||
if (sBluetoothLeAdvertiser != null) sBluetoothLeAdvertiser.cleanup();
|
||||
if (sBluetoothLeScanner != null) sBluetoothLeScanner.cleanup();
|
||||
} finally {
|
||||
mServiceLock.writeLock().unlock();
|
||||
}
|
||||
|
||||
synchronized (mProxyServiceStateCallbacks) {
|
||||
for (IBluetoothManagerCallback cb : mProxyServiceStateCallbacks ){
|
||||
|
||||
Reference in New Issue
Block a user