summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aaron Liu <aaronjli@google.com> 2023-06-22 09:46:33 -0700
committer Aaron Liu <aaronjli@google.com> 2023-12-05 19:37:07 +0000
commit41a7bbcfc6aa6371aa355e72df3f7bfd7a96776e (patch)
tree192a98fee8e3f86754d9afc565addbf7c3d5d45c
parent2d25c9b0b547f205d2c1c3a3d479649a254512d6 (diff)
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 3bb092b408363e94eb15ce44cce41da5ede3c1d6)
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java7
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java5
-rw-r--r--packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java5
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java5
5 files changed, 27 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
index 9ff338e8d5ab..42a4e7202c82 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -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;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
index e18050d77847..d3dbc4e8d6e1 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
@@ -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() {
diff --git a/packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java b/packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java
index 50f8f7e61230..14ec27ae6739 100644
--- a/packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java
+++ b/packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java
@@ -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();
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index cba717038871..df6007ddedfb 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -874,6 +874,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
}
@Override
+ public void onBouncerSwipeDown() {
+ mKeyguardViewControllerLazy.get().reset(/* hideBouncerWhenShowing= */ true);
+ }
+
+ @Override
public void playTrustedSound() {
KeyguardViewMediator.this.playTrustedSound();
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
index cfe3b0d2a803..eef5c1dc5309 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
@@ -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);
}