Loading service/java/com/android/server/bluetooth/BluetoothManagerService.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -302,6 +302,8 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { // Save a ProfileServiceConnections object for each of the bound // Save a ProfileServiceConnections object for each of the bound // bluetooth profile services // bluetooth profile services private final Map<Integer, ProfileServiceConnections> mProfileServices = new HashMap<>(); private final Map<Integer, ProfileServiceConnections> mProfileServices = new HashMap<>(); @GuardedBy("mProfileServices") private boolean mUnbindingAll = false; private final IBluetoothCallback mBluetoothCallback = new IBluetoothCallback.Stub() { private final IBluetoothCallback mBluetoothCallback = new IBluetoothCallback.Stub() { @Override @Override Loading Loading @@ -1600,13 +1602,16 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { Log.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e); Log.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e); } } if (!mUnbindingAll) { mProfileServices.remove(profile); mProfileServices.remove(profile); } } } } } } } private void unbindAllBluetoothProfileServices() { private void unbindAllBluetoothProfileServices() { synchronized (mProfileServices) { synchronized (mProfileServices) { mUnbindingAll = true; for (Integer i : mProfileServices.keySet()) { for (Integer i : mProfileServices.keySet()) { ProfileServiceConnections psc = mProfileServices.get(i); ProfileServiceConnections psc = mProfileServices.get(i); try { try { Loading @@ -1616,6 +1621,7 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { } } psc.removeAllProxies(); psc.removeAllProxies(); } } mUnbindingAll = false; mProfileServices.clear(); mProfileServices.clear(); } } } } Loading Loading
service/java/com/android/server/bluetooth/BluetoothManagerService.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -302,6 +302,8 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { // Save a ProfileServiceConnections object for each of the bound // Save a ProfileServiceConnections object for each of the bound // bluetooth profile services // bluetooth profile services private final Map<Integer, ProfileServiceConnections> mProfileServices = new HashMap<>(); private final Map<Integer, ProfileServiceConnections> mProfileServices = new HashMap<>(); @GuardedBy("mProfileServices") private boolean mUnbindingAll = false; private final IBluetoothCallback mBluetoothCallback = new IBluetoothCallback.Stub() { private final IBluetoothCallback mBluetoothCallback = new IBluetoothCallback.Stub() { @Override @Override Loading Loading @@ -1600,13 +1602,16 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { Log.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e); Log.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e); } } if (!mUnbindingAll) { mProfileServices.remove(profile); mProfileServices.remove(profile); } } } } } } } private void unbindAllBluetoothProfileServices() { private void unbindAllBluetoothProfileServices() { synchronized (mProfileServices) { synchronized (mProfileServices) { mUnbindingAll = true; for (Integer i : mProfileServices.keySet()) { for (Integer i : mProfileServices.keySet()) { ProfileServiceConnections psc = mProfileServices.get(i); ProfileServiceConnections psc = mProfileServices.get(i); try { try { Loading @@ -1616,6 +1621,7 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { } } psc.removeAllProxies(); psc.removeAllProxies(); } } mUnbindingAll = false; mProfileServices.clear(); mProfileServices.clear(); } } } } Loading