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

Commit 3b3491b9 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Keep wallpaper on top when finish a non-fullscreen unoccluding window" into tm-dev

parents e6289981 74132799
Loading
Loading
Loading
Loading
+22 −9
Original line number Diff line number Diff line
@@ -132,7 +132,12 @@ class WallpaperController {
                return false;
            }
        } else {
            if (w.mActivityRecord != null && !w.mActivityRecord.isVisibleRequested()) {
            final ActivityRecord ar = w.mActivityRecord;
            final TransitionController tc = w.mTransitionController;
            // The animating window can still be visible on screen if it is in transition, so we
            // should check whether this window can be wallpaper target even when visibleRequested
            // is false.
            if (ar != null && !ar.isVisibleRequested() && !tc.inTransition(ar)) {
                // An activity that is not going to remain visible shouldn't be the target.
                return false;
            }
@@ -157,15 +162,18 @@ class WallpaperController {
                & TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER) != 0);

        boolean needsShowWhenLockedWallpaper = false;
        if ((w.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0
                && mService.mPolicy.isKeyguardLocked()
                && (mService.mPolicy.isKeyguardOccluded()
                || mService.mPolicy.isKeyguardUnoccluding())) {
        if ((w.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0 && mService.mPolicy.isKeyguardLocked()) {
            final TransitionController tc = w.mTransitionController;
            final boolean isInTransition = tc.isShellTransitionsEnabled()
                    && tc.inTransition(w);
            if (mService.mPolicy.isKeyguardOccluded() || mService.mPolicy.isKeyguardUnoccluding()
                    || isInTransition) {
                // The lowest show when locked window decides whether we need to put the wallpaper
                // behind.
                needsShowWhenLockedWallpaper = !isFullscreen(w.mAttrs)
                        || (w.mActivityRecord != null && !w.mActivityRecord.fillsParent());
            }
        }

        if (keyguardGoingAwayWithWallpaper || needsShowWhenLockedWallpaper) {
            // Keep the wallpaper during Keyguard exit but also when it's needed for a
@@ -288,6 +296,11 @@ class WallpaperController {
                && (mWallpaperTarget != winGoingAway || mPrevWallpaperTarget != null)) {
            return;
        }
        if (mFindResults.useTopWallpaperAsTarget) {
            // wallpaper target is going away but there has request to use top wallpaper
            // Keep wallpaper visible.
            return;
        }
        for (int i = mWallpaperTokens.size() - 1; i >= 0; i--) {
            final WallpaperWindowToken token = mWallpaperTokens.get(i);
            token.setVisibility(false);