Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 367f6ed2 authored by William Escande's avatar William Escande
Browse files

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
parent 94339d1b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
                    }