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

Commit e23ab8b1 authored by Jim Miller's avatar Jim Miller
Browse files

Selectively enable back button in keyguard for security screens.

This enables the back button on secure keyguard screens so the user can
get back to the initial screen.

Partial fix for bug 7094419

Change-Id: I4dc0ac8facfd2930ccb60710c36015ec1d2c8aa6
parent b45965f5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ public class KeyguardHostView extends KeyguardViewBase {
            });
        }
        updateSecurityViews();
        setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
    }

    private void updateSecurityViews() {
@@ -553,9 +554,13 @@ public class KeyguardHostView extends KeyguardViewBase {
            }
        }

        // Discard current runnable if we're switching back to the selector view

        if (securityMode == SecurityMode.None) {
            // Discard current runnable if we're switching back to the selector view
            setOnDismissRunnable(null);
            setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
        } else {
            setSystemUiVisibility(getSystemUiVisibility() & (~View.STATUS_BAR_DISABLE_BACK));
        }

        mCurrentSecuritySelection = securityMode;
+5 −5
Original line number Diff line number Diff line
@@ -90,11 +90,11 @@ public class KeyguardViewManager {
        maybeCreateKeyguardLocked(enableScreenRotation);
        maybeEnableScreenRotation(enableScreenRotation);

        // Disable aspects of the system/status/navigation bars that are not appropriate or
        // useful for the lockscreen but can be re-shown by dialogs or SHOW_WHEN_LOCKED activities.
        // Other disabled bits are handled by the KeyguardViewMediator talking directly to the
        // status bar service.
        int visFlags = View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_HOME;
        // Disable common aspects of the system/status/navigation bars that are not appropriate or
        // useful on any keyguard screen but can be re-shown by dialogs or SHOW_WHEN_LOCKED
        // activities. Other disabled bits are handled by the KeyguardViewMediator talking
        // directly to the status bar service.
        final int visFlags = View.STATUS_BAR_DISABLE_HOME;
        if (DEBUG) Log.v(TAG, "KGVM: Set visibility on " + mKeyguardHost + " to " + visFlags);
        mKeyguardHost.setSystemUiVisibility(visFlags);

+3 −1
Original line number Diff line number Diff line
@@ -1256,7 +1256,9 @@ public class KeyguardViewMediator {
            // windows that appear on top, ever
            int flags = StatusBarManager.DISABLE_NONE;
            if (mShowing) {
                // disable navigation status bar components (home, recents) if lock screen is up
                // Permanently disable components not available when keyguard is enabled
                // (like recents). Temporary enable/disable (e.g. the "back" button) are
                // done in KeyguardHostView.
                flags |= StatusBarManager.DISABLE_RECENT;
                if (isSecure() || !ENABLE_INSECURE_STATUS_BAR_EXPAND) {
                    // showing secure lockscreen; disable expanding.