diff options
author | Jim Miller <jaggies@google.com> | 2012-12-03 17:55:16 -0800 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2012-12-03 18:48:52 -0800 |
commit | 147f9568afe645d9bfb91f3037f5336d8a2482cc (patch) | |
tree | 9777001561de5e90fca88e151cab25c9928c95ef | |
parent | e431e6a352125f2c51507130cc64e3405625a7ec (diff) | |
download | frameworks_base-147f9568afe645d9bfb91f3037f5336d8a2482cc.zip frameworks_base-147f9568afe645d9bfb91f3037f5336d8a2482cc.tar.gz frameworks_base-147f9568afe645d9bfb91f3037f5336d8a2482cc.tar.bz2 |
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
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java | 7 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index 4fb7a61..a947bb5 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -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() { diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java index efd09e0..dac852a 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java @@ -216,6 +216,7 @@ public class KeyguardViewManager { if (force || mKeyguardView == null) { inflateKeyguardView(options); + mKeyguardView.requestFocus(); } updateUserActivityTimeoutInWindowLayoutParams(); mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams); |