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

Commit 41a7bbcf authored by Aaron Liu's avatar Aaron Liu
Browse files

DO NOT MERGE Ensure swipe down works for bouncer to dismiss

Also ensure that we don't set translation for sim screens. The
translation is causing some nasty flickering and the translation does
not serve any purpose.

Fixes: 191211136
Test: swipe down to dismiss from sim pin/puk view.
Test: swipe down to dismiss from pin view.
Test: swipe down to dismis from pattern/password view.

Change-Id: I8c2d2ccd7907fa732551fbecb8f0a7c37d4c4755
(cherry picked from commit 3bb092b4)
parent 2d25c9b0
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);
    }