summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothManager.java
diff options
context:
space:
mode:
authorEtienne Ruffieux <eruffieux@google.com>2021-10-25 21:38:16 +0000
committerEtienne Ruffieux <eruffieux@google.com>2021-10-25 21:42:17 +0000
commit255c70fbbcf9f4521cbc8dad7f8a7f16c7c0e305 (patch)
tree0ff12f6f2b278657db7dfa811fc78c23ce862b7e /core/java/android/bluetooth/BluetoothManager.java
parente8f2077feec8c548dbc2c6d08016b76edcc56eb8 (diff)
Revert "Removed BluetoothDevice#prepareToEnterProcess"
This reverts commit e8f2077feec8c548dbc2c6d08016b76edcc56eb8. Reason for revert: Introducing regression for gms core Test: None Change-Id: I644b10c1869c12e1622300de43bfbdb57fb583d8
Diffstat (limited to 'core/java/android/bluetooth/BluetoothManager.java')
-rw-r--r--core/java/android/bluetooth/BluetoothManager.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/core/java/android/bluetooth/BluetoothManager.java b/core/java/android/bluetooth/BluetoothManager.java
index b5df4db2460d..20152f3d2471 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 static AttributionSource sAttributionSource = null;
+ private final AttributionSource mAttributionSource;
private final BluetoothAdapter mAdapter;
/**
* @hide
*/
public BluetoothManager(Context context) {
- sAttributionSource = resolveAttributionSource(context);
- mAdapter = BluetoothAdapter.createAdapter(sAttributionSource);
+ mAttributionSource = resolveAttributionSource(context);
+ mAdapter = BluetoothAdapter.createAdapter(mAttributionSource);
}
/** {@hide} */
@@ -79,9 +79,6 @@ public final class BluetoothManager {
if (context != null) {
res = context.getAttributionSource();
}
- else if (sAttributionSource != null) {
- return sAttributionSource;
- }
if (res == null) {
res = ActivityThread.currentAttributionSource();
}
@@ -201,8 +198,8 @@ public final class BluetoothManager {
IBluetoothGatt iGatt = managerService.getBluetoothGatt();
if (iGatt == null) return devices;
devices = Attributable.setAttributionSource(
- iGatt.getDevicesMatchingConnectionStates(states, sAttributionSource),
- sAttributionSource);
+ iGatt.getDevicesMatchingConnectionStates(states, mAttributionSource),
+ mAttributionSource);
} catch (RemoteException e) {
Log.e(TAG, "", e);
}