diff options
author | William Escande <wescande@google.com> | 2022-01-26 17:28:36 +0100 |
---|---|---|
committer | William Escande <wescande@google.com> | 2022-01-26 21:18:16 +0100 |
commit | 367f6ed2f28c3f82e480c027053ce9f2684bee92 (patch) | |
tree | 575f00698d0669282c92b9f0155ba08f1e6b99c0 /framework/java/android/bluetooth/BluetoothProfileConnector.java | |
parent | 94339d1b2b992c495ba123d9e3be284391d38874 (diff) |
re-use CURRENT_OR_SELF not CURRENT
CURRENT_OR_SELF is hidden so this is a workaround to have the same thing
CURRENT_OR_SELF is needed to pass the bluetooth cts test
Test: atest CtsBluetoothTestCases
Tag: #refactor
Bug: 200200870
Change-Id: I089ffc75da934a023a3fea5088f9e133abeab5c0
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothProfileConnector.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothProfileConnector.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/BluetoothProfileConnector.java b/framework/java/android/bluetooth/BluetoothProfileConnector.java index 79373f1a32..12d95ccb90 100644 --- a/framework/java/android/bluetooth/BluetoothProfileConnector.java +++ b/framework/java/android/bluetooth/BluetoothProfileConnector.java @@ -51,6 +51,9 @@ public abstract class BluetoothProfileConnector<T> { private final String mServiceName; private volatile T mService; + // -3 match with UserHandle.USER_CURRENT_OR_SELF + private static final UserHandle USER_HANDLE_CURRENT_OR_SELF = UserHandle.of(-3); + private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { public void onBluetoothStateChange(boolean up) { @@ -131,7 +134,7 @@ public abstract class BluetoothProfileConnector<T> { 0); intent.setComponent(comp); if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, - UserHandle.CURRENT)) { + USER_HANDLE_CURRENT_OR_SELF)) { logError("Could not bind to Bluetooth Service with " + intent); return false; } |