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

Commit 9020925a authored by William Escande's avatar William Escande
Browse files

SystemServer: Always set current user context

user context was soak within airplane flag, but we need to use it for
other flag before removing the airplane flag.

Bug: 323060869
Bug: 316946334
Test: m Bluetooth
Change-Id: I235d4acf4dcfb39f915135d5c6248031a209c894
parent 3a744246
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -1295,11 +1295,11 @@ class BluetoothManagerService {

    @VisibleForTesting
    void initialize(UserHandle userHandle) {
        if (mUseNewAirplaneMode) {
        mCurrentUserContext =
                requireNonNull(
                        mContext.createContextAsUser(userHandle, 0),
                        "Current User Context cannot be null");
        if (mUseNewAirplaneMode) {
            AirplaneModeListener.initialize(
                    mLooper,
                    mContentResolver,
@@ -1936,9 +1936,7 @@ class BluetoothManagerService {
                        mBluetoothNotificationManager.createNotificationChannels();
                    }

                    if (mUseNewAirplaneMode) {
                    mCurrentUserContext = mContext.createContextAsUser(userTo, 0);
                    }

                    /* disable and enable BT when detect a user switch */
                    if (mAdapter != null && mState.oneOf(STATE_ON)) {