diff options
| author | Treehugger Robot <treehugger-gerrit@google.com> | 2021-10-18 22:33:58 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-10-18 22:33:58 +0000 |
| commit | 47b3a1d69e08c91f87c858bbbbad85b0e6e57b4d (patch) | |
| tree | 0a7baaae9a52459348b61d1216952c9e3b9c44e0 /core/java | |
| parent | 0c43c6f3042acdb87b3418d24b71f9c6a0106710 (diff) | |
| parent | 5ee34126e513a433dd6c14b39c94e37d47f65e99 (diff) | |
Merge "Removed BluetoothDevice#prepareToEnterProcess" am: e722500621 am: 8bc4a18d21 am: 881188aec1 am: 5ee34126e5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1856313
Change-Id: I3c09d03f89dc70363dca395c677a27b77c1bf708
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothDevice.java | 5 | ||||
| -rw-r--r-- | core/java/android/bluetooth/BluetoothManager.java | 13 | ||||
| -rw-r--r-- | core/java/android/content/Intent.java | 11 |
3 files changed, 8 insertions, 21 deletions
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 6e918bd6243d..e968052ff5cf 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -1186,11 +1186,6 @@ public final class BluetoothDevice implements Parcelable, Attributable { mAttributionSource = attributionSource; } - /** {@hide} */ - public void prepareToEnterProcess(@NonNull AttributionSource attributionSource) { - setAttributionSource(attributionSource); - } - @Override public boolean equals(@Nullable Object o) { if (o instanceof BluetoothDevice) { 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); } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 882a624df500..9626ed2dee80 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -31,7 +31,6 @@ import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.TestApi; import android.app.AppGlobals; -import android.bluetooth.BluetoothDevice; import android.compat.annotation.UnsupportedAppUsage; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; @@ -11478,16 +11477,6 @@ public class Intent implements Parcelable, Cloneable { if (fromProtectedComponent) { mLocalFlags |= LOCAL_FLAG_FROM_PROTECTED_COMPONENT; } - - // Special attribution fix-up logic for any BluetoothDevice extras - // passed via Bluetooth intents - if (mAction != null && mAction.startsWith("android.bluetooth.") - && hasExtra(BluetoothDevice.EXTRA_DEVICE)) { - final BluetoothDevice device = getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); - if (device != null) { - device.prepareToEnterProcess(source); - } - } } /** @hide */ |
