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

Commit 58a5624f authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

Merge "Keep wallpaper on top when finish a non-fullscreen unoccluding window"...

Merge "Keep wallpaper on top when finish a non-fullscreen unoccluding window" into tm-dev am: 3b3491b9 am: 5f4a6cde

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17244748



Change-Id: Idd3743997f9908bb93b44873ecbf8ceb3c0e53bd
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1bf02e84 5f4a6cde
Loading
Loading
Loading
Loading
+22 −9
Original line number Original line Diff line number Diff line
@@ -132,7 +132,12 @@ class WallpaperController {
                return false;
                return false;
            }
            }
        } else {
        } 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.
                // An activity that is not going to remain visible shouldn't be the target.
                return false;
                return false;
            }
            }
@@ -157,15 +162,18 @@ class WallpaperController {
                & TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER) != 0);
                & TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER) != 0);


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


        if (keyguardGoingAwayWithWallpaper || needsShowWhenLockedWallpaper) {
        if (keyguardGoingAwayWithWallpaper || needsShowWhenLockedWallpaper) {
            // Keep the wallpaper during Keyguard exit but also when it's needed for a
            // Keep the wallpaper during Keyguard exit but also when it's needed for a
@@ -288,6 +296,11 @@ class WallpaperController {
                && (mWallpaperTarget != winGoingAway || mPrevWallpaperTarget != null)) {
                && (mWallpaperTarget != winGoingAway || mPrevWallpaperTarget != null)) {
            return;
            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--) {
        for (int i = mWallpaperTokens.size() - 1; i >= 0; i--) {
            final WallpaperWindowToken token = mWallpaperTokens.get(i);
            final WallpaperWindowToken token = mWallpaperTokens.get(i);
            token.setVisibility(false);
            token.setVisibility(false);