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

Commit 1333639b authored by Marzia Favaro's avatar Marzia Favaro Committed by Automerger Merge Worker
Browse files

Merge "Correct behaviour of update function to handle multiple wallpapers"...

Merge "Correct behaviour of update function to handle multiple wallpapers" into udc-qpr-dev am: 16434906

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



Change-Id: Iaa77b97a397ebdc808ddaf71222ef1d896f07726
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ed509a6e 16434906
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1065,7 +1065,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        if (obscuredChanged && w.isVisible() && mWallpaperController.isWallpaperTarget(w)) {
            // This is the wallpaper target and its obscured state changed... make sure the
            // current wallpaper's visibility has been updated accordingly.
            mWallpaperController.updateWallpaperVisibility();
            mWallpaperController.updateWallpaperTokens(mDisplayContent.isKeyguardLocked());
        }

        w.handleWindowMovedIfNeeded();
+11 −19
Original line number Diff line number Diff line
@@ -308,29 +308,12 @@ class WallpaperController {
        }
    }

    private boolean shouldWallpaperBeVisible(WindowState wallpaperTarget) {
        if (DEBUG_WALLPAPER) {
            Slog.v(TAG, "Wallpaper vis: target " + wallpaperTarget + " prev="
                    + mPrevWallpaperTarget);
        }
        return wallpaperTarget != null || mPrevWallpaperTarget != null;
    }

    boolean isWallpaperTargetAnimating() {
        return mWallpaperTarget != null && mWallpaperTarget.isAnimating(TRANSITION | PARENTS)
                && (mWallpaperTarget.mActivityRecord == null
                        || !mWallpaperTarget.mActivityRecord.isWaitingForTransitionStart());
    }

    void updateWallpaperVisibility() {
        final boolean visible = shouldWallpaperBeVisible(mWallpaperTarget);

        for (int curTokenNdx = mWallpaperTokens.size() - 1; curTokenNdx >= 0; curTokenNdx--) {
            final WallpaperWindowToken token = mWallpaperTokens.get(curTokenNdx);
            token.setVisibility(visible);
        }
    }

    /**
     * Make one wallpaper visible, according to {@attr showHome}.
     * This is called during the keyguard unlocking transition
@@ -801,11 +784,20 @@ class WallpaperController {
        result.setWallpaperTarget(wallpaperTarget);
    }

    public void updateWallpaperTokens(boolean keyguardLocked) {
        if (DEBUG_WALLPAPER) {
            Slog.v(TAG, "Wallpaper vis: target " + mWallpaperTarget + " prev="
                    + mPrevWallpaperTarget);
        }
        updateWallpaperTokens(mWallpaperTarget != null || mPrevWallpaperTarget != null,
                keyguardLocked);
    }

    /**
     * Change the visibility of the top wallpaper to {@param visibility} and hide all the others.
     */
    private void updateWallpaperTokens(boolean visibility, boolean locked) {
        WindowState topWallpaper = mFindResults.getTopWallpaper(locked);
    private void updateWallpaperTokens(boolean visibility, boolean keyguardLocked) {
        WindowState topWallpaper = mFindResults.getTopWallpaper(keyguardLocked);
        WallpaperWindowToken topWallpaperToken =
                topWallpaper == null ? null : topWallpaper.mToken.asWallpaperToken();
        for (int curTokenNdx = mWallpaperTokens.size() - 1; curTokenNdx >= 0; curTokenNdx--) {