summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beverly Tai <beverlyt@google.com> 2023-04-03 18:00:44 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-04-03 18:00:44 +0000
commit2e03f9f59ae566a9aafeeb4b1036fbc1cee395de (patch)
tree7941623896f078d34fe0b47950e9e9a0d7952ca6
parentc21978b1afbbc5db45937d8c3240052bb9be3ecd (diff)
parent19854e7b50168096814535e499a9a4008b930181 (diff)
Merge "Set text color in the KeyguardIndication" into udc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index fda227795915..765c93ed209b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -869,12 +869,9 @@ public class KeyguardIndicationController {
// Walk down a precedence-ordered list of what indication
// should be shown based on device state
if (mDozing) {
+ boolean useMisalignmentColor = false;
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.
- mTopIndicationView.setTextColor(Color.WHITE);
-
CharSequence newIndication;
if (!TextUtils.isEmpty(mBiometricMessage)) {
newIndication = mBiometricMessage; // note: doesn't show mBiometricMessageFollowUp
@@ -885,8 +882,8 @@ public class KeyguardIndicationController {
mIndicationArea.setVisibility(GONE);
return;
} else if (!TextUtils.isEmpty(mAlignmentIndication)) {
+ useMisalignmentColor = true;
newIndication = mAlignmentIndication;
- mTopIndicationView.setTextColor(mContext.getColor(R.color.misalignment_text_color));
} else if (mPowerPluggedIn || mEnableBatteryDefender) {
newIndication = computePowerIndication();
} else {
@@ -896,7 +893,14 @@ public class KeyguardIndicationController {
if (!TextUtils.equals(mTopIndicationView.getText(), newIndication)) {
mWakeLock.setAcquired(true);
- mTopIndicationView.switchIndication(newIndication, null,
+ mTopIndicationView.switchIndication(newIndication,
+ new KeyguardIndication.Builder()
+ .setMessage(newIndication)
+ .setTextColor(ColorStateList.valueOf(
+ useMisalignmentColor
+ ? mContext.getColor(R.color.misalignment_text_color)
+ : Color.WHITE))
+ .build(),
true, () -> mWakeLock.setAcquired(false));
}
return;