Loading service/src/com/android/server/bluetooth/BluetoothManagerService.java +7 −7 Original line number Diff line number Diff line Loading @@ -295,8 +295,7 @@ class BluetoothManagerService { // bluetooth profile services private final Map<Integer, ProfileServiceConnections> mProfileServices = new HashMap<>(); @GuardedBy("mProfileServices") private boolean mUnbindingAll = false; private volatile boolean mUnbindingAll = false; private final IBluetoothCallback mBluetoothCallback = new IBluetoothCallback.Stub() { Loading Loading @@ -1387,6 +1386,9 @@ class BluetoothManagerService { void unbindBluetoothProfileService( int bluetoothProfile, IBluetoothProfileServiceConnection proxy) { if (mUnbindingAll) { return; } synchronized (mProfileServices) { ProfileServiceConnections psc = mProfileServices.get(bluetoothProfile); if (psc == null) { Loading @@ -1400,16 +1402,14 @@ class BluetoothManagerService { } catch (IllegalArgumentException e) { Log.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e); } if (!mUnbindingAll) { mProfileServices.remove(bluetoothProfile); } } } } private void unbindAllBluetoothProfileServices() { synchronized (mProfileServices) { mUnbindingAll = true; synchronized (mProfileServices) { for (Integer i : mProfileServices.keySet()) { ProfileServiceConnections psc = mProfileServices.get(i); try { Loading @@ -1419,9 +1419,9 @@ class BluetoothManagerService { } psc.removeAllProxies(); } mUnbindingAll = false; mProfileServices.clear(); } mUnbindingAll = false; } /** Loading Loading
service/src/com/android/server/bluetooth/BluetoothManagerService.java +7 −7 Original line number Diff line number Diff line Loading @@ -295,8 +295,7 @@ class BluetoothManagerService { // bluetooth profile services private final Map<Integer, ProfileServiceConnections> mProfileServices = new HashMap<>(); @GuardedBy("mProfileServices") private boolean mUnbindingAll = false; private volatile boolean mUnbindingAll = false; private final IBluetoothCallback mBluetoothCallback = new IBluetoothCallback.Stub() { Loading Loading @@ -1387,6 +1386,9 @@ class BluetoothManagerService { void unbindBluetoothProfileService( int bluetoothProfile, IBluetoothProfileServiceConnection proxy) { if (mUnbindingAll) { return; } synchronized (mProfileServices) { ProfileServiceConnections psc = mProfileServices.get(bluetoothProfile); if (psc == null) { Loading @@ -1400,16 +1402,14 @@ class BluetoothManagerService { } catch (IllegalArgumentException e) { Log.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e); } if (!mUnbindingAll) { mProfileServices.remove(bluetoothProfile); } } } } private void unbindAllBluetoothProfileServices() { synchronized (mProfileServices) { mUnbindingAll = true; synchronized (mProfileServices) { for (Integer i : mProfileServices.keySet()) { ProfileServiceConnections psc = mProfileServices.get(i); try { Loading @@ -1419,9 +1419,9 @@ class BluetoothManagerService { } psc.removeAllProxies(); } mUnbindingAll = false; mProfileServices.clear(); } mUnbindingAll = false; } /** Loading