Loading framework/java/android/bluetooth/BluetoothAdapter.java +9 −15 Original line number Original line Diff line number Diff line Loading @@ -1092,12 +1092,6 @@ public final class BluetoothAdapter { BluetoothAdapter(IBluetoothManager managerService, AttributionSource attributionSource) { BluetoothAdapter(IBluetoothManager managerService, AttributionSource attributionSource) { mManagerService = requireNonNull(managerService); mManagerService = requireNonNull(managerService); mAttributionSource = requireNonNull(attributionSource); mAttributionSource = requireNonNull(attributionSource); mServiceLock.writeLock().lock(); try { mService = getBluetoothService(mManagerCallback); } finally { mServiceLock.writeLock().unlock(); } Consumer<IBluetooth> registerQualityReportCallbackConsumer = Consumer<IBluetooth> registerQualityReportCallbackConsumer = (IBluetooth service) -> { (IBluetooth service) -> { Loading Loading @@ -1165,6 +1159,13 @@ public final class BluetoothAdapter { new CallbackWrapper( new CallbackWrapper( registerBluetoothConnectionCallbackConsumer, registerBluetoothConnectionCallbackConsumer, unregisterBluetoothConnectionCallbackConsumer); unregisterBluetoothConnectionCallbackConsumer); mServiceLock.writeLock().lock(); try { mService = registerBlueoothManagerCallback(mManagerCallback); } finally { mServiceLock.writeLock().unlock(); } } } /** /** Loading Loading @@ -4211,15 +4212,8 @@ public final class BluetoothAdapter { } } } } /** /** Registers a IBluetoothManagerCallback and returns the cached service proxy object. */ * Registers a IBluetoothManagerCallback and returns the cached Bluetooth service proxy object. IBluetooth registerBlueoothManagerCallback(IBluetoothManagerCallback cb) { * * <p>TODO: rename this API to registerBlueoothManagerCallback or something? the current name * does not match what it does very well. * * <p>/ @UnsupportedAppUsage /*package */ IBluetooth getBluetoothService(IBluetoothManagerCallback cb) { requireNonNull(cb); requireNonNull(cb); if (Flags.getProfileUseLock()) { if (Flags.getProfileUseLock()) { sServiceLock.writeLock().lock(); sServiceLock.writeLock().lock(); Loading Loading
framework/java/android/bluetooth/BluetoothAdapter.java +9 −15 Original line number Original line Diff line number Diff line Loading @@ -1092,12 +1092,6 @@ public final class BluetoothAdapter { BluetoothAdapter(IBluetoothManager managerService, AttributionSource attributionSource) { BluetoothAdapter(IBluetoothManager managerService, AttributionSource attributionSource) { mManagerService = requireNonNull(managerService); mManagerService = requireNonNull(managerService); mAttributionSource = requireNonNull(attributionSource); mAttributionSource = requireNonNull(attributionSource); mServiceLock.writeLock().lock(); try { mService = getBluetoothService(mManagerCallback); } finally { mServiceLock.writeLock().unlock(); } Consumer<IBluetooth> registerQualityReportCallbackConsumer = Consumer<IBluetooth> registerQualityReportCallbackConsumer = (IBluetooth service) -> { (IBluetooth service) -> { Loading Loading @@ -1165,6 +1159,13 @@ public final class BluetoothAdapter { new CallbackWrapper( new CallbackWrapper( registerBluetoothConnectionCallbackConsumer, registerBluetoothConnectionCallbackConsumer, unregisterBluetoothConnectionCallbackConsumer); unregisterBluetoothConnectionCallbackConsumer); mServiceLock.writeLock().lock(); try { mService = registerBlueoothManagerCallback(mManagerCallback); } finally { mServiceLock.writeLock().unlock(); } } } /** /** Loading Loading @@ -4211,15 +4212,8 @@ public final class BluetoothAdapter { } } } } /** /** Registers a IBluetoothManagerCallback and returns the cached service proxy object. */ * Registers a IBluetoothManagerCallback and returns the cached Bluetooth service proxy object. IBluetooth registerBlueoothManagerCallback(IBluetoothManagerCallback cb) { * * <p>TODO: rename this API to registerBlueoothManagerCallback or something? the current name * does not match what it does very well. * * <p>/ @UnsupportedAppUsage /*package */ IBluetooth getBluetoothService(IBluetoothManagerCallback cb) { requireNonNull(cb); requireNonNull(cb); if (Flags.getProfileUseLock()) { if (Flags.getProfileUseLock()) { sServiceLock.writeLock().lock(); sServiceLock.writeLock().lock(); Loading