RESTRICT AUTOMERGE Show primary bouncer on TOUCH_OUTSIDE
The notification shade isn't showing over occluding apps, so it doesn't intercept touches for the alternate bouncer. Therefore, the AlternateBouncer needs to rely on TOUCH_OUTSIDE. This was fixed in udc-dev but also needs to be fixed in tm-qpr. Test: atest StatusBarKeyguardViewManagerTest Test: manually bring up altBouncer with UDFPS over an occluding app and tap outside UDFPS area, the primary bouncer will show Fixes: 274587619 Change-Id: I257221ad5f5a3fc127a588faea09f5057c2d9977
This commit is contained in:
@@ -1452,11 +1452,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public boolean onTouch(MotionEvent event) {
|
public boolean onTouch(MotionEvent event) {
|
||||||
boolean handledTouch = false;
|
boolean handledTouch = false;
|
||||||
if (mAlternateBouncerInteractor.isVisibleState()) {
|
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;
|
mAlternateBouncerReceivedDownTouch = true;
|
||||||
} else if (event.getAction() == MotionEvent.ACTION_UP
|
} else if ((downThenUp || outsideTouch)
|
||||||
&& mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime()
|
&& mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime()) {
|
||||||
&& mAlternateBouncerReceivedDownTouch) {
|
|
||||||
showPrimaryBouncer(true);
|
showPrimaryBouncer(true);
|
||||||
}
|
}
|
||||||
handledTouch = true;
|
handledTouch = true;
|
||||||
|
|||||||
@@ -786,4 +786,20 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
|
|||||||
// THEN the alternateBouncer doesn't hide
|
// THEN the alternateBouncer doesn't hide
|
||||||
verify(mAlternateBouncerInteractor, never()).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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user