Loading packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +11 −0 Original line number Diff line number Diff line Loading @@ -374,6 +374,17 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> return !configDisabled || isTestHarness || fileOverride; } /** * @return true if the current bouncer is password */ public boolean dispatchBackKeyEventPreIme() { if (mKeyguardSecurityContainerController.getCurrentSecurityMode() == SecurityMode.Password) { return true; } return false; } /** * Allows the media keys to work when the keyguard is showing. * The media keys should be of no interest to the actual keyguard view(s), Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +8 −0 Original line number Diff line number Diff line Loading @@ -494,6 +494,14 @@ public class KeyguardBouncer { return mKeyguardViewController.interceptMediaKey(event); } /** * @return true if the pre IME back event should be handled */ public boolean dispatchBackKeyEventPreIme() { ensureView(); return mKeyguardViewController.dispatchBackKeyEventPreIme(); } public void notifyKeyguardAuthenticated(boolean strongAuth) { ensureView(); mKeyguardViewController.finish(strongAuth, KeyguardUpdateMonitor.getCurrentUser()); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java +7 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,11 @@ public class NotificationShadeWindowView extends FrameLayout { return mInteractionEventHandler.dispatchKeyEvent(event); } @Override public boolean dispatchKeyEventPreIme(KeyEvent event) { return mInteractionEventHandler.dispatchKeyEventPreIme(event); } protected void setInteractionEventHandler(InteractionEventHandler listener) { mInteractionEventHandler = listener; } Loading Loading @@ -361,6 +366,8 @@ public class NotificationShadeWindowView extends FrameLayout { boolean interceptMediaKey(KeyEvent event); boolean dispatchKeyEvent(KeyEvent event); boolean dispatchKeyEventPreIme(KeyEvent event); } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java +5 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,11 @@ public class NotificationShadeWindowViewController { return mService.interceptMediaKey(event); } @Override public boolean dispatchKeyEventPreIme(KeyEvent event) { return mService.dispatchKeyEventPreIme(event); } @Override public boolean dispatchKeyEvent(KeyEvent event) { boolean down = event.getAction() == KeyEvent.ACTION_DOWN; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +17 −0 Original line number Diff line number Diff line Loading @@ -3520,6 +3520,23 @@ public class StatusBar extends SystemUI implements DemoMode, && mStatusBarKeyguardViewManager.interceptMediaKey(event); } /** * While IME is active and a BACK event is detected, check with * {@link StatusBarKeyguardViewManager#dispatchBackKeyEventPreIme(KeyEvent)} to see if the event * should be handled before routing to IME, in order to prevent the user having to hit back * twice to exit bouncer. */ public boolean dispatchKeyEventPreIme(KeyEvent event) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_BACK: if (mState == StatusBarState.KEYGUARD && mStatusBarKeyguardViewManager.dispatchBackKeyEventPreIme()) { return onBackPressed(); } } return false; } protected boolean shouldUnlockOnMenuPressed() { return mDeviceInteractive && mState != StatusBarState.SHADE && mStatusBarKeyguardViewManager.shouldDismissOnMenuPressed(); Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +11 −0 Original line number Diff line number Diff line Loading @@ -374,6 +374,17 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> return !configDisabled || isTestHarness || fileOverride; } /** * @return true if the current bouncer is password */ public boolean dispatchBackKeyEventPreIme() { if (mKeyguardSecurityContainerController.getCurrentSecurityMode() == SecurityMode.Password) { return true; } return false; } /** * Allows the media keys to work when the keyguard is showing. * The media keys should be of no interest to the actual keyguard view(s), Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +8 −0 Original line number Diff line number Diff line Loading @@ -494,6 +494,14 @@ public class KeyguardBouncer { return mKeyguardViewController.interceptMediaKey(event); } /** * @return true if the pre IME back event should be handled */ public boolean dispatchBackKeyEventPreIme() { ensureView(); return mKeyguardViewController.dispatchBackKeyEventPreIme(); } public void notifyKeyguardAuthenticated(boolean strongAuth) { ensureView(); mKeyguardViewController.finish(strongAuth, KeyguardUpdateMonitor.getCurrentUser()); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java +7 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,11 @@ public class NotificationShadeWindowView extends FrameLayout { return mInteractionEventHandler.dispatchKeyEvent(event); } @Override public boolean dispatchKeyEventPreIme(KeyEvent event) { return mInteractionEventHandler.dispatchKeyEventPreIme(event); } protected void setInteractionEventHandler(InteractionEventHandler listener) { mInteractionEventHandler = listener; } Loading Loading @@ -361,6 +366,8 @@ public class NotificationShadeWindowView extends FrameLayout { boolean interceptMediaKey(KeyEvent event); boolean dispatchKeyEvent(KeyEvent event); boolean dispatchKeyEventPreIme(KeyEvent event); } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java +5 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,11 @@ public class NotificationShadeWindowViewController { return mService.interceptMediaKey(event); } @Override public boolean dispatchKeyEventPreIme(KeyEvent event) { return mService.dispatchKeyEventPreIme(event); } @Override public boolean dispatchKeyEvent(KeyEvent event) { boolean down = event.getAction() == KeyEvent.ACTION_DOWN; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +17 −0 Original line number Diff line number Diff line Loading @@ -3520,6 +3520,23 @@ public class StatusBar extends SystemUI implements DemoMode, && mStatusBarKeyguardViewManager.interceptMediaKey(event); } /** * While IME is active and a BACK event is detected, check with * {@link StatusBarKeyguardViewManager#dispatchBackKeyEventPreIme(KeyEvent)} to see if the event * should be handled before routing to IME, in order to prevent the user having to hit back * twice to exit bouncer. */ public boolean dispatchKeyEventPreIme(KeyEvent event) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_BACK: if (mState == StatusBarState.KEYGUARD && mStatusBarKeyguardViewManager.dispatchBackKeyEventPreIme()) { return onBackPressed(); } } return false; } protected boolean shouldUnlockOnMenuPressed() { return mDeviceInteractive && mState != StatusBarState.SHADE && mStatusBarKeyguardViewManager.shouldDismissOnMenuPressed(); Loading