diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 9f315904f115c..7e14728dc40e0 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -775,6 +775,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab if (msgId == FingerprintManager.FINGERPRINT_ERROR_LOCKOUT || msgId == FingerprintManager.FINGERPRINT_ERROR_LOCKOUT_PERMANENT) { mFingerprintLockedOut = true; + if (isUdfpsEnrolled()) { + updateFingerprintListeningState(); + } } for (int i = 0; i < mCallbacks.size(); i++) { @@ -2115,7 +2118,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab || (!getUserCanSkipBouncer(getCurrentUser()) && !isEncryptedOrLockdown(getCurrentUser()) && !userNeedsStrongAuth() - && userDoesNotHaveTrust); + && userDoesNotHaveTrust + && !mFingerprintLockedOut); return shouldListenKeyguardState && shouldListenUserState && shouldListenBouncerState && shouldListenUdfpsState; } @@ -3259,6 +3263,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab pw.println(" strongAuthFlags=" + Integer.toHexString(strongAuthFlags)); pw.println(" trustManaged=" + getUserTrustIsManaged(userId)); pw.println(" udfpsEnrolled=" + isUdfpsEnrolled()); + pw.println(" mFingerprintLockedOut=" + mFingerprintLockedOut); pw.println(" enabledByUser=" + mBiometricEnabledForUser.get(userId)); if (isUdfpsEnrolled()) { pw.println(" shouldListenForUdfps=" + shouldListenForFingerprint(true)); diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java index bec4ce6ba6588..fc5f3b8ae994b 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java @@ -20,7 +20,6 @@ import android.annotation.Nullable; import android.content.res.ColorStateList; import android.graphics.Color; import android.text.TextUtils; -import android.view.View; import androidx.annotation.IntDef; @@ -202,10 +201,7 @@ public class KeyguardIndicationRotateTextViewController extends mCurrIndicationType = type; mIndicationQueue.removeIf(x -> x == type); - if (mCurrIndicationType == INDICATION_TYPE_NONE) { - mView.setVisibility(View.GONE); - } else { - mView.setVisibility(View.VISIBLE); + if (mCurrIndicationType != INDICATION_TYPE_NONE) { mIndicationQueue.add(type); // re-add to show later } @@ -299,7 +295,7 @@ public class KeyguardIndicationRotateTextViewController extends } } - private static final int INDICATION_TYPE_NONE = -1; + static final int INDICATION_TYPE_NONE = -1; public static final int INDICATION_TYPE_OWNER_INFO = 0; public static final int INDICATION_TYPE_DISCLOSURE = 1; public static final int INDICATION_TYPE_LOGOUT = 2; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index 91a0e6fedef8d..0bb702f6c9e42 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -112,6 +112,7 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private ViewGroup mIndicationArea; private KeyguardIndicationTextView mTopIndicationView; + private KeyguardIndicationTextView mLockScreenIndicationView; private final IBatteryStats mBatteryInfo; private final SettableWakeLock mWakeLock; private final DockManager mDockManager; @@ -208,17 +209,21 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal mKeyguardUpdateMonitor.registerCallback(mTickReceiver); mStatusBarStateController.addCallback(mStatusBarStateListener); mKeyguardStateController.addCallback(this); + + mStatusBarStateListener.onDozingChanged(mStatusBarStateController.isDozing()); } public void setIndicationArea(ViewGroup indicationArea) { mIndicationArea = indicationArea; mTopIndicationView = indicationArea.findViewById(R.id.keyguard_indication_text); + mLockScreenIndicationView = indicationArea.findViewById( + R.id.keyguard_indication_text_bottom); mInitialTextColorState = mTopIndicationView != null ? mTopIndicationView.getTextColors() : ColorStateList.valueOf(Color.WHITE); mRotateTextViewController = new KeyguardIndicationRotateTextViewController( - indicationArea.findViewById(R.id.keyguard_indication_text_bottom), - mExecutor, - mStatusBarStateController); + mLockScreenIndicationView, + mExecutor, + mStatusBarStateController); updateIndication(false /* animate */); updateDisclosure(); if (mBroadcastReceiver == null) { @@ -630,6 +635,7 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal // should be shown based on user or device state // AoD if (mDozing) { + mLockScreenIndicationView.setVisibility(View.GONE); mTopIndicationView.setVisibility(VISIBLE); // When dozing we ignore any text color and use white instead, because // colors can be hard to read in low brightness. @@ -659,6 +665,8 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal // LOCK SCREEN mTopIndicationView.setVisibility(GONE); + mTopIndicationView.setText(null); + mLockScreenIndicationView.setVisibility(View.VISIBLE); updateIndications(animate, KeyguardUpdateMonitor.getCurrentUser()); } @@ -914,7 +922,8 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal } else if (mStatusBarKeyguardViewManager.isBouncerShowing()) { mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState); } else if (mKeyguardUpdateMonitor.isScreenOn()) { - showTransientIndication(errString); + showTransientIndication(errString, /* isError */ true, + /* hideOnScreenOff */ true); // We want to keep this message around in case the screen was off hideTransientIndicationDelayed(HIDE_DELAY_MS); } else { @@ -1032,9 +1041,8 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal if (mHideTransientMessageOnScreenOff && mDozing) { hideTransientIndication(); - } else { - updateIndication(false); } + updateIndication(false); } }; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java index 68e20705fbeb2..96276f46d23d4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java @@ -38,7 +38,7 @@ import java.util.LinkedList; * A view to show hints on Keyguard ("Swipe up to unlock", "Tap again to open"). */ public class KeyguardIndicationTextView extends TextView { - private static final long MSG_DURATION_MILLIS = 600; + private static final long MSG_DURATION_MILLIS = 1500; private long mNextAnimationTime = 0; private boolean mAnimationsEnabled = true; private LinkedList mMessages = new LinkedList<>(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java index 2f78532b9e711..51576687880cc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java @@ -34,7 +34,6 @@ import android.content.res.ColorStateList; import android.graphics.Color; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper.RunWithLooper; -import android.view.View; import androidx.test.filters.SmallTest; @@ -258,8 +257,8 @@ public class KeyguardIndicationRotateTextViewControllerTest extends SysuiTestCas // WHEN the device is dozing mStatusBarStateListener.onDozingChanged(true); - // THEN the view is GONE - verify(mView).setVisibility(View.GONE); + // THEN switch to INDICATION_TYPE_NONE + verify(mView).switchIndication(null); } @Test