From 4a057a184445ea2b0edc3e10e9b6b8f6ab1cfc64 Mon Sep 17 00:00:00 2001 From: Beverly Date: Fri, 25 Jun 2021 12:55:31 -0400 Subject: Update co-ex error logic KeyguardIndication (bottom text area on LS) - show transient messages for a minimum of 2000ms not including animation time - if dual auth is enrolled: only show face auth errors if the user explicitly requested face auth In general, don't request face auth on the global actions menu (likely left over from when the power menu had affordances for components requiring authentication) Test: atest SystemUITest Fixes: 186302245 Bug: 183698582 Change-Id: I0290c66addc9981bf3fe20de24110e2d35e1f8eb --- .../KeyguardSecurityContainerController.java | 2 +- .../android/keyguard/KeyguardUpdateMonitor.java | 12 ++++++++-- .../systemui/globalactions/GlobalActionsImpl.java | 7 +----- .../systemui/keyguard/KeyguardIndication.java | 28 ++++++++++++++++++++-- ...KeyguardIndicationRotateTextViewController.java | 2 ++ .../statusbar/KeyguardIndicationController.java | 19 ++++++++++++++- .../phone/KeyguardIndicationTextView.java | 9 +++++-- .../statusbar/phone/KeyguardLiftController.kt | 2 +- .../phone/NotificationPanelViewController.java | 4 ++-- .../systemui/statusbar/phone/StatusBar.java | 4 ++-- .../keyguard/KeyguardUpdateMonitorTest.java | 2 +- 11 files changed, 71 insertions(+), 20 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java index 4827cab3b5c0..fde8213de0c6 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java @@ -173,7 +173,7 @@ public class KeyguardSecurityContainerController extends ViewController mMessages = new LinkedList<>(); @@ -104,8 +104,13 @@ public class KeyguardIndicationTextView extends TextView { long delay = Math.max(0, mNextAnimationTime - timeInMillis); setNextAnimationTime(timeInMillis + delay + getFadeOutDuration()); + final long minDurationMillis = + (indication != null && indication.getMinVisibilityMillis() != null) + ? indication.getMinVisibilityMillis() + : MSG_MIN_DURATION_MILLIS_DEFAULT; + if (!text.equals("") || hasIcon) { - setNextAnimationTime(mNextAnimationTime + MSG_DURATION_MILLIS); + setNextAnimationTime(mNextAnimationTime + minDurationMillis); animSetBuilder.before(getInAnimator()); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt index bfe0684b5411..ec2d0364a3a6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt @@ -53,7 +53,7 @@ class KeyguardLiftController constructor( // Not listening anymore since trigger events unregister themselves isListening = false updateListeningState() - keyguardUpdateMonitor.requestFaceAuth() + keyguardUpdateMonitor.requestFaceAuth(true) } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 5d31786dd638..8fee1b040776 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -2038,7 +2038,7 @@ public class NotificationPanelViewController extends PanelViewController { // When expanding QS, let's authenticate the user if possible, // this will speed up notification actions. if (height == 0) { - mStatusBar.requestFaceAuth(); + mStatusBar.requestFaceAuth(false); } } @@ -3176,7 +3176,7 @@ public class NotificationPanelViewController extends PanelViewController { case KEYGUARD: if (!mDozingOnDown) { if (mKeyguardBypassController.getBypassEnabled()) { - mUpdateMonitor.requestFaceAuth(); + mUpdateMonitor.requestFaceAuth(true); } else { mLockscreenGestureLogger.write(MetricsEvent.ACTION_LS_HINT, 0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 3f07785520cf..312dc23e366e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -1723,9 +1723,9 @@ public class StatusBar extends SystemUI implements DemoMode, /** * Asks {@link KeyguardUpdateMonitor} to run face auth. */ - public void requestFaceAuth() { + public void requestFaceAuth(boolean userInitiatedRequest) { if (!mKeyguardStateController.canDismissLockScreen()) { - mKeyguardUpdateMonitor.requestFaceAuth(); + mKeyguardUpdateMonitor.requestFaceAuth(userInitiatedRequest); } } diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java index 3d4da270dd44..a625bb6ec201 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java @@ -569,7 +569,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { // Stop scanning when bouncer becomes visible setKeyguardBouncerVisibility(true); clearInvocations(mFaceManager); - mKeyguardUpdateMonitor.requestFaceAuth(); + mKeyguardUpdateMonitor.requestFaceAuth(true); verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt()); } -- cgit v1.2.3-59-g8ed1b