Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +6 −4 Original line number Diff line number Diff line Loading @@ -1452,11 +1452,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public boolean onTouch(MotionEvent event) { boolean handledTouch = false; if (mAlternateBouncerInteractor.isVisibleState()) { if (event.getAction() == MotionEvent.ACTION_DOWN) { final boolean downThenUp = event.getActionMasked() == MotionEvent.ACTION_UP && mAlternateBouncerReceivedDownTouch; final boolean outsideTouch = event.getActionMasked() == MotionEvent.ACTION_OUTSIDE; if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { mAlternateBouncerReceivedDownTouch = true; } else if (event.getAction() == MotionEvent.ACTION_UP && mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime() && mAlternateBouncerReceivedDownTouch) { } else if ((downThenUp || outsideTouch) && mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime()) { showPrimaryBouncer(true); } handledTouch = true; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -786,4 +786,20 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { // THEN the alternateBouncer doesn't hide verify(mAlternateBouncerInteractor, never()).hide(); } @Test public void testAlternateBouncerOnTouch_actionOutside_hidesAlternateBouncer() { reset(mAlternateBouncerInteractor); // GIVEN the alternate bouncer has shown for a minimum amount of time when(mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime()).thenReturn(true); when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true); // WHEN only ACTION_OUTSIDE touch event comes mStatusBarKeyguardViewManager.onTouch( MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_OUTSIDE, 0f, 0f, 0)); // THEN the alternateBouncer hides verify(mAlternateBouncerInteractor).hide(); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +6 −4 Original line number Diff line number Diff line Loading @@ -1452,11 +1452,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public boolean onTouch(MotionEvent event) { boolean handledTouch = false; if (mAlternateBouncerInteractor.isVisibleState()) { if (event.getAction() == MotionEvent.ACTION_DOWN) { final boolean downThenUp = event.getActionMasked() == MotionEvent.ACTION_UP && mAlternateBouncerReceivedDownTouch; final boolean outsideTouch = event.getActionMasked() == MotionEvent.ACTION_OUTSIDE; if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { mAlternateBouncerReceivedDownTouch = true; } else if (event.getAction() == MotionEvent.ACTION_UP && mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime() && mAlternateBouncerReceivedDownTouch) { } else if ((downThenUp || outsideTouch) && mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime()) { showPrimaryBouncer(true); } handledTouch = true; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -786,4 +786,20 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { // THEN the alternateBouncer doesn't hide verify(mAlternateBouncerInteractor, never()).hide(); } @Test public void testAlternateBouncerOnTouch_actionOutside_hidesAlternateBouncer() { reset(mAlternateBouncerInteractor); // GIVEN the alternate bouncer has shown for a minimum amount of time when(mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime()).thenReturn(true); when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true); // WHEN only ACTION_OUTSIDE touch event comes mStatusBarKeyguardViewManager.onTouch( MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_OUTSIDE, 0f, 0f, 0)); // THEN the alternateBouncer hides verify(mAlternateBouncerInteractor).hide(); } }