Added indication text stubs for changes to trust being managed.
Notes:
- Subclasses of KeyguardIndicationController can now provide indication text
to be displayed when a trust agent is managed.
Test: runtest sysui
Bug: 38397982
Change-Id: I1b7ee3041aceae94d12da25608f8e7b2e9ebbbe2
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 2094362d..49c3f7e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -16,7 +16,6 @@
package com.android.systemui.statusbar;
-import android.app.ActivityManager;
import android.app.admin.DevicePolicyManager;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -207,7 +206,16 @@
*
* @return {@code null} or an empty string if a trust indication text should not be shown.
*/
- protected String getTrustIndication() {
+ protected String getTrustGrantedIndication() {
+ return null;
+ }
+
+ /**
+ * Returns the indication text indicating that trust is currently being managed.
+ *
+ * @return {@code null} or an empty string if a trust managed text should not be shown.
+ */
+ protected String getTrustManagedIndication() {
return null;
}
@@ -281,16 +289,17 @@
KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
int userId = KeyguardUpdateMonitor.getCurrentUser();
- String trustIndication = getTrustIndication();
+ String trustGrantedIndication = getTrustGrantedIndication();
+ String trustManagedIndication = getTrustManagedIndication();
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)
+ } else if (!TextUtils.isEmpty(trustGrantedIndication)
&& updateMonitor.getUserHasTrust(userId)) {
- mTextView.switchIndication(trustIndication);
+ mTextView.switchIndication(trustGrantedIndication);
mTextView.setTextColor(Color.WHITE);
} else if (mPowerPluggedIn) {
String indication = computePowerIndication();
@@ -299,7 +308,11 @@
}
mTextView.switchIndication(indication);
mTextView.setTextColor(Color.WHITE);
-
+ } else if (!TextUtils.isEmpty(trustManagedIndication)
+ && updateMonitor.getUserTrustIsManaged(userId)
+ && !updateMonitor.getUserHasTrust(userId)) {
+ mTextView.switchIndication(trustManagedIndication);
+ mTextView.setTextColor(Color.WHITE);
} else {
mTextView.switchIndication(mRestingIndication);
mTextView.setTextColor(Color.WHITE);