diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 9097c5375e13d..8e9847575485a 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1192,6 +1192,9 @@ %3$s, which can monitor your personal network activity. + + Unlocked for %1$s + Device will stay locked until you manually unlock diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index 092408961eab8..de2bdde080370 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 @@ public class KeyguardIndicationController { private int mChargingWattage; private String mMessageToShowOnScreenOn; - private KeyguardUpdateMonitorCallback mUpdateMonitor; + private KeyguardUpdateMonitorCallback mUpdateMonitorCallback; private final DevicePolicyManager mDevicePolicyManager; private boolean mDozing; @@ -153,10 +153,10 @@ public class KeyguardIndicationController { * same instance. */ protected KeyguardUpdateMonitorCallback getKeyguardCallback() { - if (mUpdateMonitor == null) { - mUpdateMonitor = new BaseKeyguardCallback(); + if (mUpdateMonitorCallback == null) { + mUpdateMonitorCallback = new BaseKeyguardCallback(); } - return mUpdateMonitor; + return mUpdateMonitorCallback; } private void updateDisclosure() { @@ -202,6 +202,15 @@ public class KeyguardIndicationController { public void setUserInfoController(UserInfoController userInfoController) { } + /** + * 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}. */ @@ -250,7 +259,7 @@ public class KeyguardIndicationController { } } - private void updateIndication() { + protected final void updateIndication() { if (TextUtils.isEmpty(mTransientIndication)) { mWakeLock.setAcquired(false); } @@ -270,14 +279,19 @@ public class KeyguardIndicationController { 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) {