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

Commit 165615a4 authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Fixed the usage of the menu key to unlock" into nyc-dev

am: 99cb3346

* commit '99cb3346':
  Fixed the usage of the menu key to unlock
parents 936778e6 99cb3346
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
     * @return true if the menu key should be enabled
     */
    private static final String ENABLE_MENU_KEY_FILE = "/data/local/enable_menu_key";
    private boolean shouldEnableMenuKey() {
    public boolean shouldEnableMenuKey() {
        final Resources res = getResources();
        final boolean configDisabled = res.getBoolean(R.bool.config_disableMenuKeyInLockScreen);
        final boolean isTestHarness = ActivityManager.isRunningInTestHarness();
@@ -421,15 +421,6 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
        return !configDisabled || isTestHarness || fileOverride;
    }

    public boolean handleMenuKey() {
        // The following enables the MENU key to work for testing automation
        if (shouldEnableMenuKey()) {
            dismiss();
            return true;
        }
        return false;
    }

    public void setViewMediatorCallback(ViewMediatorCallback viewMediatorCallback) {
        mViewMediatorCallback = viewMediatorCallback;
        // Update ViewMediator with the current input method requirements
+2 −13
Original line number Diff line number Diff line
@@ -276,19 +276,8 @@ public class KeyguardBouncer {
        return mKeyguardView == null || mKeyguardView.getSecurityMode() != SecurityMode.None;
    }

    public boolean onMenuPressed() {
        ensureView();
        if (mKeyguardView.handleMenuKey()) {

            // We need to show it in case it is secure. If not, it will get dismissed in any case.
            mRoot.setVisibility(View.VISIBLE);
            mFalsingManager.onBouncerShown();
            mKeyguardView.requestFocus();
            mKeyguardView.onResume();
            return true;
        } else {
            return false;
        }
    public boolean shouldDismissOnMenuPressed() {
        return mKeyguardView.shouldEnableMenuKey();
    }

    public boolean interceptMediaKey(KeyEvent event) {
+7 −1
Original line number Diff line number Diff line
@@ -3879,7 +3879,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    }

    public boolean onMenuPressed() {
        return mState == StatusBarState.KEYGUARD && mStatusBarKeyguardViewManager.onMenuPressed();
        if (mDeviceInteractive && mState != StatusBarState.SHADE
                && mStatusBarKeyguardViewManager.shouldDismissOnMenuPressed()) {
            animateCollapsePanels(
                    CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL /* flags */, true /* force */);
            return true;
        }
        return false;
    }

    public void endAffordanceLaunch() {
+2 −2
Original line number Diff line number Diff line
@@ -509,8 +509,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        return !(mLastShowing && !mLastOccluded) || mLastBouncerShowing || mLastRemoteInputActive;
    }

    public boolean onMenuPressed() {
        return mBouncer.onMenuPressed();
    public boolean shouldDismissOnMenuPressed() {
        return mBouncer.shouldDismissOnMenuPressed();
    }

    public boolean interceptMediaKey(KeyEvent event) {