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

Commit d19273d2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't allow notification shade to handle touches if altBouncer is visible" into main

parents cd72ed50 257afc74
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4974,6 +4974,12 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
                return false;
            }

            if (DeviceEntryUdfpsRefactor.isEnabled()
                    && mAlternateBouncerInteractor.isVisibleState()) {
                // never send touches to shade if the alternate bouncer is showing
                return false;
            }

            if (event.getAction() == MotionEvent.ACTION_DOWN) {
                if (event.getDownTime() == mLastTouchDownTime) {
                    // An issue can occur when swiping down after unlock, where multiple down
+2 −2
Original line number Diff line number Diff line
@@ -897,8 +897,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
        mConfigurationController.onConfigurationChanged(configuration);
    }

    protected void onTouchEvent(MotionEvent ev) {
        mTouchHandler.onTouch(mView, ev);
    protected boolean onTouchEvent(MotionEvent ev) {
        return mTouchHandler.onTouch(mView, ev);
    }

    protected void setDozing(boolean dozing, boolean dozingAlwaysOn) {
+18 −0
Original line number Diff line number Diff line
@@ -363,6 +363,24 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        assertThat(mNotificationPanelViewController.isTracking()).isFalse();
    }

    @Test
    public void alternateBouncerVisible_onTouchEvent_notHandled() {
        mSetFlagsRule.enableFlags(com.android.systemui.Flags.FLAG_DEVICE_ENTRY_UDFPS_REFACTOR);
        // GIVEN alternate bouncer is visible
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);

        // WHEN touch DOWN event received; THEN touch is NOT handled
        assertThat(onTouchEvent(MotionEvent.obtain(0L /* downTime */,
                0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */,
                0 /* metaState */))).isFalse();

        // WHEN touch MOVE event received; THEN touch is NOT handled
        assertThat(onTouchEvent(MotionEvent.obtain(0L /* downTime */,
                0L /* eventTime */, MotionEvent.ACTION_MOVE, 0f /* x */, 200f /* y */,
                0 /* metaState */))).isFalse();

    }

    @Test
    public void test_onTouchEvent_startTracking() {
        // GIVEN device is NOT pulsing