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

Commit 1217cba8 authored by Alex Stetson's avatar Alex Stetson
Browse files

Only call IStatusBarService from foreground user

Launching activities for visible background users should not cause
panels to collapse for visible foreground users.

Bug: 332222893
Bug: 349876134
Test: manual
Flag: NONE bugfix
Change-Id: Iaf8d06f70b0c3a2c39e51ab8ca562144c477696d
parent 7e843335
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1618,8 +1618,10 @@ class ActivityStarter {
                    currentTop, currentTop.mDisplayContent, false /* deferResume */);
        }

        if (!avoidMoveToFront() && mDoResume && mRootWindowContainer
                .hasVisibleWindowAboveButDoesNotOwnNotificationShade(started.launchedFromUid)) {
        if (!avoidMoveToFront() && mDoResume
                && !mService.getUserManagerInternal().isVisibleBackgroundFullUser(started.mUserId)
                && mRootWindowContainer.hasVisibleWindowAboveButDoesNotOwnNotificationShade(
                started.launchedFromUid)) {
            // If the UID launching the activity has a visible window on top of the notification
            // shade and it's launching an activity that's going to be at the front, we should move
            // the shade out of the way so the user can see it. We want to avoid the case where the
+9 −0
Original line number Diff line number Diff line
@@ -283,6 +283,7 @@ import com.android.server.am.PendingIntentRecord;
import com.android.server.am.UserState;
import com.android.server.firewall.IntentFirewall;
import com.android.server.grammaticalinflection.GrammaticalInflectionManagerInternal;
import com.android.server.pm.UserManagerInternal;
import com.android.server.pm.UserManagerService;
import com.android.server.policy.PermissionPolicyInternal;
import com.android.server.sdksandbox.SdkSandboxManagerLocal;
@@ -382,6 +383,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
    private PermissionPolicyInternal mPermissionPolicyInternal;
    private StatusBarManagerInternal mStatusBarManagerInternal;
    private WallpaperManagerInternal mWallpaperManagerInternal;
    private UserManagerInternal mUserManagerInternal;
    @VisibleForTesting
    final ActivityTaskManagerInternal mInternal;
    private PowerManagerInternal mPowerManagerInternal;
@@ -5464,6 +5466,13 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        return mWallpaperManagerInternal;
    }

    UserManagerInternal getUserManagerInternal() {
        if (mUserManagerInternal == null) {
            mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
        }
        return mUserManagerInternal;
    }

    AppWarnings getAppWarningsLocked() {
        return mAppWarnings;
    }