summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothManager.java
diff options
context:
space:
mode:
authorEtienne Ruffieux <eruffieux@google.com>2021-10-13 10:46:12 +0000
committerEtienne Ruffieux <eruffieux@google.com>2021-10-15 14:41:32 +0000
commite8f2077feec8c548dbc2c6d08016b76edcc56eb8 (patch)
tree1380972156f537526b3258de8ae4f2426c29ba45 /core/java/android/bluetooth/BluetoothManager.java
parent53e8b03baeaaa1b619f2947453aef96725ff21f3 (diff)
Removed BluetoothDevice#prepareToEnterProcess
Tag: #feature Bug: 200202780 Test: manual Change-Id: I8d4be1da1bcb5b819c324f1a3a89c7dc317c31d6
Diffstat (limited to 'core/java/android/bluetooth/BluetoothManager.java')
-rw-r--r--core/java/android/bluetooth/BluetoothManager.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/bluetooth/BluetoothManager.java b/core/java/android/bluetooth/BluetoothManager.java
index 20152f3d2471..b5df4db2460d 100644
--- a/core/java/android/bluetooth/BluetoothManager.java
+++ b/core/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);
}