Added indication text stubs for changes to trust.
Notes:
- Subclasses of KeyguardIndicationController can now provide indication text to be displayed when trust has been granted.
Test: runtest sysui
Bug: 37487319
Change-Id: I030954d51a5c3000c45e465fcd261e4887520aa6
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 0924089..de2bdde 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -89,7 +89,7 @@
private int mChargingWattage;
private String mMessageToShowOnScreenOn;
- private KeyguardUpdateMonitorCallback mUpdateMonitor;
+ private KeyguardUpdateMonitorCallback mUpdateMonitorCallback;
private final DevicePolicyManager mDevicePolicyManager;
private boolean mDozing;
@@ -153,10 +153,10 @@
* same instance.
*/
protected KeyguardUpdateMonitorCallback getKeyguardCallback() {
- if (mUpdateMonitor == null) {
- mUpdateMonitor = new BaseKeyguardCallback();
+ if (mUpdateMonitorCallback == null) {
+ mUpdateMonitorCallback = new BaseKeyguardCallback();
}
- return mUpdateMonitor;
+ return mUpdateMonitorCallback;
}
private void updateDisclosure() {
@@ -203,6 +203,15 @@
}
/**
+ * Returns the indication text indicating that trust has been granted.
+ *
+ * @return {@code null} or an empty string if a trust indication text should not be shown.
+ */
+ protected String getTrustIndication() {
+ return null;
+ }
+
+ /**
* Hides transient indication in {@param delayMs}.
*/
public void hideTransientIndicationDelayed(long delayMs) {
@@ -250,7 +259,7 @@
}
}
- private void updateIndication() {
+ protected final void updateIndication() {
if (TextUtils.isEmpty(mTransientIndication)) {
mWakeLock.setAcquired(false);
}
@@ -270,14 +279,19 @@
return;
}
- if (!mUserManager.isUserUnlocked(ActivityManager.getCurrentUser())) {
+ KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
+ int userId = ActivityManager.getCurrentUser();
+ String trustIndication = getTrustIndication();
+ if (!mUserManager.isUserUnlocked(userId)) {
mTextView.switchIndication(com.android.internal.R.string.lockscreen_storage_locked);
mTextView.setTextColor(Color.WHITE);
-
} else if (!TextUtils.isEmpty(mTransientIndication)) {
mTextView.switchIndication(mTransientIndication);
mTextView.setTextColor(mTransientTextColor);
-
+ } else if (!TextUtils.isEmpty(trustIndication)
+ && updateMonitor.getUserHasTrust(userId)) {
+ mTextView.switchIndication(trustIndication);
+ mTextView.setTextColor(Color.WHITE);
} else if (mPowerPluggedIn) {
String indication = computePowerIndication();
if (DEBUG_CHARGING_SPEED) {