diff options
author | Etienne Ruffieux <eruffieux@google.com> | 2021-10-13 10:46:12 +0000 |
---|---|---|
committer | Etienne Ruffieux <eruffieux@google.com> | 2021-10-15 14:41:32 +0000 |
commit | 39639385f90678e97aa6848ae3b43de6bfb3b49e (patch) | |
tree | 4c5a6a6ccc6dc55a1e815b97d8d3721ca4419975 /framework/java/android/bluetooth/BluetoothManager.java | |
parent | 68e41e54ff587aa4d6976b57f91c2c71dda03227 (diff) |
Removed BluetoothDevice#prepareToEnterProcess
Tag: #feature
Bug: 200202780
Test: manual
Change-Id: I8d4be1da1bcb5b819c324f1a3a89c7dc317c31d6
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothManager.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothManager.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/framework/java/android/bluetooth/BluetoothManager.java b/framework/java/android/bluetooth/BluetoothManager.java index 20152f3d24..b5df4db246 100644 --- a/framework/java/android/bluetooth/BluetoothManager.java +++ b/framework/java/android/bluetooth/BluetoothManager.java @@ -62,15 +62,15 @@ public final class BluetoothManager { private static final String TAG = "BluetoothManager"; private static final boolean DBG = false; - private final AttributionSource mAttributionSource; + private static AttributionSource sAttributionSource = null; private final BluetoothAdapter mAdapter; /** * @hide */ public BluetoothManager(Context context) { - mAttributionSource = resolveAttributionSource(context); - mAdapter = BluetoothAdapter.createAdapter(mAttributionSource); + sAttributionSource = resolveAttributionSource(context); + mAdapter = BluetoothAdapter.createAdapter(sAttributionSource); } /** {@hide} */ @@ -79,6 +79,9 @@ public final class BluetoothManager { if (context != null) { res = context.getAttributionSource(); } + else if (sAttributionSource != null) { + return sAttributionSource; + } if (res == null) { res = ActivityThread.currentAttributionSource(); } @@ -198,8 +201,8 @@ public final class BluetoothManager { IBluetoothGatt iGatt = managerService.getBluetoothGatt(); if (iGatt == null) return devices; devices = Attributable.setAttributionSource( - iGatt.getDevicesMatchingConnectionStates(states, mAttributionSource), - mAttributionSource); + iGatt.getDevicesMatchingConnectionStates(states, sAttributionSource), + sAttributionSource); } catch (RemoteException e) { Log.e(TAG, "", e); } |