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

Commit 8d94fedb authored by Jorim Jaggi's avatar Jorim Jaggi Committed by android-build-merger
Browse files

Merge "Fix IME Keyguard exit animation" into oc-dev am: b4566b30

am: 6a5cefcf

Change-Id: If7ae622824fed84e56088bc92c5d01f7a4401983
parents 8b46904e 6a5cefcf
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2494,7 +2494,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    void startKeyguardExitOnNonAppWindows(boolean onWallpaper, boolean goingToShade) {
    void startKeyguardExitOnNonAppWindows(boolean onWallpaper, boolean goingToShade) {
        final WindowManagerPolicy policy = mService.mPolicy;
        final WindowManagerPolicy policy = mService.mPolicy;
        forAllWindows(w -> {
        forAllWindows(w -> {
            if (w.mAppToken == null && policy.canBeHiddenByKeyguardLw(w)) {
            if (w.mAppToken == null && policy.canBeHiddenByKeyguardLw(w)
                    && w.wouldBeVisibleIfPolicyIgnored() && !w.isVisible()) {
                w.mWinAnimator.setAnimation(
                w.mWinAnimator.setAnimation(
                        policy.createHiddenByKeyguardExit(onWallpaper, goingToShade));
                        policy.createHiddenByKeyguardExit(onWallpaper, goingToShade));
            }
            }
+7 −29
Original line number Original line Diff line number Diff line
@@ -1292,36 +1292,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP


    @Override
    @Override
    boolean isVisible() {
    boolean isVisible() {
        // TODO: The check for hiddenRequested is commented out below, because the window can still
        return wouldBeVisibleIfPolicyIgnored() && mPolicyVisibility;
        // be visible on screen when the flag is true. We would like the isVisible() method to
        // return an answer closer to if the window is truly visible (can't be an exact answer
        // without checking the surface state), so comment out the check for now so we can test to
        // see what problem it causes.
        // If it doesn't cause any issues, then we can remove just before we lock down the current
        // release (O) and also consolidate this method with #isVisibleUnchecked() and possibly
        // other methods like isVisibleNow().
        // If it does cause problems, then we can look if there are other ways to solve the problem.
        // If there isn't then uncomment and document here why it is needed.
        if (/*(mAppToken == null || !mAppToken.hiddenRequested) && */isVisibleUnchecked()
            // TODO: The window isn't considered visible when the token is hidden, however
            // uncommenting the check below breaks the visual transition from an app to the launcher
            // if the home buttons is pressed. Need to investigate an fix that issue before
            // uncommenting.
            /* && !mToken.hidden*/) {
            // Is this window visible?  It is not visible if there is no surface, or we are in the
            // process of running an exit animation that will remove the surface, or its app token
            // has been hidden.
            return true;
        }
        return false;
    }
    }


    /**
    /**
     * Does the minimal check for visibility. Callers generally want to use one of the public
     * @return True if the window would be visible if we'd ignore policy visibility, false
     * methods as they perform additional checks on the app token.
     *         otherwise.
     * TODO: See if there are other places we can use this check below instead of duplicating...
     */
     */
    private boolean isVisibleUnchecked() {
    boolean wouldBeVisibleIfPolicyIgnored() {
        return mHasSurface && mPolicyVisibility && !isParentWindowHidden()
        return mHasSurface && mPolicyVisibility && !isParentWindowHidden()
                && !mAnimatingExit && !mDestroying && (!mIsWallpaper || mWallpaperVisible);
                && !mAnimatingExit && !mDestroying && (!mIsWallpaper || mWallpaperVisible);
    }
    }
@@ -1338,7 +1316,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    // TODO: Can we consolidate this with #isVisible() or have a more appropriate name for this?
    // TODO: Can we consolidate this with #isVisible() or have a more appropriate name for this?
    boolean isWinVisibleLw() {
    boolean isWinVisibleLw() {
        return (mAppToken == null || !mAppToken.hiddenRequested || mAppToken.mAppAnimator.animating)
        return (mAppToken == null || !mAppToken.hiddenRequested || mAppToken.mAppAnimator.animating)
                && isVisibleUnchecked();
                && isVisible();
    }
    }


    /**
    /**
@@ -1347,7 +1325,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     */
     */
    boolean isVisibleNow() {
    boolean isVisibleNow() {
        return (!mToken.hidden || mAttrs.type == TYPE_APPLICATION_STARTING)
        return (!mToken.hidden || mAttrs.type == TYPE_APPLICATION_STARTING)
                && isVisibleUnchecked();
                && isVisible();
    }
    }


    /**
    /**
@@ -2063,7 +2041,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            // If app died visible, apply a dim over the window to indicate that it's inactive
            // If app died visible, apply a dim over the window to indicate that it's inactive
            dc.mDimLayerController.applyDimAbove(getDimLayerUser(), mWinAnimator);
            dc.mDimLayerController.applyDimAbove(getDimLayerUser(), mWinAnimator);
        } else if ((mAttrs.flags & FLAG_DIM_BEHIND) != 0
        } else if ((mAttrs.flags & FLAG_DIM_BEHIND) != 0
                && dc != null && !mAnimatingExit && isVisibleUnchecked()) {
                && dc != null && !mAnimatingExit && isVisible()) {
            dc.mDimLayerController.applyDimBehind(getDimLayerUser(), mWinAnimator);
            dc.mDimLayerController.applyDimBehind(getDimLayerUser(), mWinAnimator);
        }
        }
    }
    }