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

Commit 9dc06cc2 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #2264162 and #2252436: Now playing screens problems when locked.

We now treat the case where the lock screen is hidden to be basically the same as
it being removed for purposes of event dispatching and other things in the policy.

Change-Id: I7386220594ad6e89e1493d643b1f0603663ae72a
parent a8730f98
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -421,6 +421,13 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
        return mShowing;
    }

    /**
     * Is the keyguard currently showing and not being force hidden?
     */
    public boolean isShowingAndNotHidden() {
        return mShowing && !mHidden;
    }

    /**
     * Notify us when the keyguard is hidden by another window
     */
+5 −5
Original line number Diff line number Diff line
@@ -441,7 +441,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (mGlobalActions == null) {
            mGlobalActions = new GlobalActions(mContext);
        }
        final boolean keyguardShowing = mKeyguardMediator.isShowing();
        final boolean keyguardShowing = mKeyguardMediator.isShowingAndNotHidden();
        mGlobalActions.showDialog(keyguardShowing, isDeviceProvisioned());
        if (keyguardShowing) {
            // since it took two seconds of long press to bring this up,
@@ -1108,7 +1108,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     * given the situation with the keyguard.
     */
    void launchHomeFromHotKey() {
        if (!mHideLockScreen && mKeyguardMediator.isShowing()) {
        if (mKeyguardMediator.isShowingAndNotHidden()) {
            // don't launch home if keyguard showing
        } else if (!mHideLockScreen && mKeyguardMediator.isInputRestricted()) {
            // when in keyguard restricted mode, must first verify unlock
@@ -1923,7 +1923,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {

    /** {@inheritDoc} */
    public boolean keyguardIsShowingTq() {
        return mKeyguardMediator.isShowing();
        return mKeyguardMediator.isShowingAndNotHidden();
    }

    /** {@inheritDoc} */
@@ -2193,7 +2193,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean always) {
        final boolean hapticsDisabled = Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) == 0;
        if (!always && (hapticsDisabled || mKeyguardMediator.isShowing())) {
        if (!always && (hapticsDisabled || mKeyguardMediator.isShowingAndNotHidden())) {
            return false;
        }
        switch (effectId) {
@@ -2221,7 +2221,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }
    
    public void screenOnStoppedLw() {
        if (!mKeyguardMediator.isShowing() && mPowerManager.isScreenOn()) {
        if (!mKeyguardMediator.isShowingAndNotHidden() && mPowerManager.isScreenOn()) {
            long curTime = SystemClock.uptimeMillis();
            mPowerManager.userActivity(curTime, false, LocalPowerManager.OTHER_EVENT);
        }