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

Commit 5c6bd9f6 authored by Arthur (Min-Hsin) Lee's avatar Arthur (Min-Hsin) Lee Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE Ensure swipe down works for bouncer to dismiss" into udc-dev

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

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

    @VisibleForTesting
@@ -543,6 +545,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
@@ -309,6 +309,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
@@ -771,6 +771,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);
    }