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

Commit 73466111 authored by Aaron Liu's avatar Aaron Liu Committed by Automerger Merge Worker
Browse files

DO NOT MERGE Ensure swipe down works for bouncer to dismiss am: 41a7bbcf

parents d02f9a6e 41a7bbcf
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -282,6 +282,8 @@ public class KeyguardSecurityContainer extends ConstraintLayout {

    public interface SwipeListener {
        void onSwipeUp();
        /** */
        void onSwipeDown();
    }

    @VisibleForTesting
@@ -544,6 +546,11 @@ public class KeyguardSecurityContainer extends ConstraintLayout {
                if (mSwipeListener != null) {
                    mSwipeListener.onSwipeUp();
                }
            } else if (getTranslationY() > TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                    MIN_DRAG_SIZE, getResources().getDisplayMetrics())) {
                if (mSwipeListener != null) {
                    mSwipeListener.onSwipeDown();
                }
            }
        }
        return true;
+5 −0
Original line number Diff line number Diff line
@@ -310,6 +310,11 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
                        "swipeUpOnBouncer");
            }
        }

        @Override
        public void onSwipeDown() {
            mViewMediatorCallback.onBouncerSwipeDown();
        }
    };
    private final ConfigurationController.ConfigurationListener mConfigurationListener =
            new ConfigurationController.ConfigurationListener() {
+5 −0
Original line number Diff line number Diff line
@@ -104,4 +104,9 @@ public interface ViewMediatorCallback {
     * Call when cancel button is pressed in bouncer.
     */
    void onCancelClicked();

    /**
     * Determines if bouncer has swiped down.
     */
    void onBouncerSwipeDown();
}
+5 −0
Original line number Diff line number Diff line
@@ -873,6 +873,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            mKeyguardViewControllerLazy.get().onCancelClicked();
        }

        @Override
        public void onBouncerSwipeDown() {
            mKeyguardViewControllerLazy.get().reset(/* hideBouncerWhenShowing= */ true);
        }

        @Override
        public void playTrustedSound() {
            KeyguardViewMediator.this.playTrustedSound();
+5 −0
Original line number Diff line number Diff line
@@ -802,6 +802,11 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        assertTrue(mViewMediator.isShowingAndNotOccluded());
    }

    @Test
    public void testBouncerSwipeDown() {
        mViewMediator.getViewMediatorCallback().onBouncerSwipeDown();
        verify(mStatusBarKeyguardViewManager).reset(true);
    }
    private void createAndStartViewMediator() {
        createAndStartViewMediator(false);
    }