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

Commit 7d7808fc authored by Craig Mautner's avatar Craig Mautner
Browse files

Show all windows from activity that hides keyguard

Popup windows from the activity hiding the keyguard weren't being
shown. This change retrieves that activity from PhoneWindowManager
and applies the show or hide call to the windows that match the
activity.

Fixes bug 16479813.

Change-Id: Ia6fe97240aec85c5233eee9038138f7d48095a6e
parent c13fcace
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -637,6 +637,11 @@ public interface WindowManagerPolicy {
     */
    public boolean canBeForceHidden(WindowState win, WindowManager.LayoutParams attrs);

    /**
     * Return the window that is hiding the keyguard, if such a thing exists.
     */
    public WindowState getWinShowWhenLockedLw();

    /**
     * Called when the system would like to show a UI to indicate that an
     * application is starting.  You can use this to add a
+6 −1
Original line number Diff line number Diff line
@@ -1759,6 +1759,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    @Override
    public WindowState getWinShowWhenLockedLw() {
        return mWinShowWhenLocked;
    }

    /** {@inheritDoc} */
    @Override
    public View addStartingWindow(IBinder appToken, String packageName, int theme,
@@ -3795,7 +3800,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                mShowingLockscreen = true;
            }
            boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW
                    && attrs.type <= LAST_APPLICATION_WINDOW;
                    && attrs.type < FIRST_SYSTEM_WINDOW;
            if (attrs.type == TYPE_DREAM) {
                // If the lockscreen was showing when the dream started then wait
                // for the dream to draw before hiding the lockscreen.
+6 −2
Original line number Diff line number Diff line
@@ -252,6 +252,10 @@ public class WindowAnimator {
        final boolean showImeOverKeyguard = imeTarget != null && imeTarget.isVisibleNow() &&
                (imeTarget.getAttrs().flags & FLAG_SHOW_WHEN_LOCKED) != 0;

        final WindowState winShowWhenLocked = (WindowState) mPolicy.getWinShowWhenLockedLw();
        final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ?
                null : winShowWhenLocked.mAppToken;

        for (int i = windows.size() - 1; i >= 0; i--) {
            WindowState win = windows.get(i);
            WindowStateAnimator winAnimator = win.mWinAnimator;
@@ -316,8 +320,8 @@ public class WindowAnimator {
                            + " hidden=" + win.mRootToken.hidden
                            + " anim=" + win.mWinAnimator.mAnimation);
                } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) {
                    final boolean hideWhenLocked = (flags & FLAG_SHOW_WHEN_LOCKED) == 0 &&
                            !(win.mIsImWindow && showImeOverKeyguard);
                    final boolean hideWhenLocked = !((win.mIsImWindow && showImeOverKeyguard) ||
                            (appShowWhenLocked != null && appShowWhenLocked == win.mAppToken));
                    final boolean changed;
                    if (((mForceHiding == KEYGUARD_ANIMATING_IN)
                                && (!winAnimator.isAnimating() || hideWhenLocked))