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

Commit 0a981cf5 authored by Steven Ross's avatar Steven Ross
Browse files

No blackscreen when dialog is showing fixes 5511992

When a dialog is activated, we won't show the blackscreen
until after the lockscreen comes back in focus, which occurs
when the dialog closes.
The user may toggle the power button, causing onScreenTurnedOff to
reset mHasOverlay, even though the dialog is still on top of the window.
Thus, the dialog will have a black box behind it without this change.

Change-Id: I6bec7984b88454e9fff22147cbbfc27b9c0a74f2
parent bf677de4
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -147,6 +147,9 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
    //Also true if we've activated a phone call, either emergency dialing or incoming
    //This resets when the phone is turned off with no current call
    private boolean mHasOverlay;
    //True if a dialog is currently displaying on top of this window
    //Unlike other overlays, this does not close with a power button cycle
    private boolean mHasDialog = false;


    /**
@@ -556,7 +559,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
        if (DEBUG) Log.d(TAG, "screen off");
        mScreenOn = false;
        mForgotPattern = false;
        mHasOverlay = mUpdateMonitor.getPhoneState() != TelephonyManager.CALL_STATE_IDLE;
        mHasOverlay = mUpdateMonitor.getPhoneState() != TelephonyManager.CALL_STATE_IDLE ||
                mHasDialog;
        if (mMode == Mode.LockScreen) {
            ((KeyguardScreen) mLockScreen).onPause();
        } else {
@@ -643,8 +647,9 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
            mHasOverlay = true;
            stopAndUnbindFromFaceLock();
            hideFaceLockArea();
        } else if (runFaceLock) {
            activateFaceLockIfAble();
        } else {
            mHasDialog = false;
            if (runFaceLock) activateFaceLockIfAble();
        }
    }

@@ -1043,6 +1048,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
    }

    private void showDialog(String title, String message) {
        mHasDialog = true;
        final AlertDialog dialog = new AlertDialog.Builder(mContext)
            .setTitle(title)
            .setMessage(message)