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

Commit 147f9568 authored by Jim Miller's avatar Jim Miller
Browse files

Fix ring volume issue by addressing focus regression in keyguard.

This fixes a regression where ring volume can be changed in keyguard.
Because KeyguardHostView is now being re-created in onScreenTurnedOff(),
it loses focus and the volume keys get handled by the fallback handler.

The fix is to ensure at least one child under KeyguardHostView has focus
whenever we re-create it.

Fixes bug 7546960

Change-Id: I34b7db402401a824f463d35d7546c05dc2979243
parent e431e6a3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -283,6 +283,11 @@ public class KeyguardHostView extends KeyguardViewBase {

        showPrimarySecurityScreen(false);
        updateSecurityViews();

        // Make sure at least this view is focusable in case nothing below it is. Otherwise,
        // requestFocus() on this view will fail and allow events, such as volume keys, to be
        // handled by the fallback handler.  See bug 7546960 for details.
        setFocusableInTouchMode(true);
    }

    private boolean shouldEnableAddWidget() {
@@ -878,6 +883,7 @@ public class KeyguardHostView extends KeyguardViewBase {
        if (mViewStateManager != null) {
            mViewStateManager.showUsabilityHints();
        }
        requestFocus();
    }

    @Override
@@ -897,6 +903,7 @@ public class KeyguardHostView extends KeyguardViewBase {
        if (cameraPage != null) {
            cameraPage.onScreenTurnedOff();
        }
        clearFocus();
    }

    public void clearAppWidgetToShow() {
+1 −0
Original line number Diff line number Diff line
@@ -216,6 +216,7 @@ public class KeyguardViewManager {

        if (force || mKeyguardView == null) {
            inflateKeyguardView(options);
            mKeyguardView.requestFocus();
        }
        updateUserActivityTimeoutInWindowLayoutParams();
        mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams);