Loading packages/SystemUI/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1195,6 +1195,9 @@ <!-- Indication on the keyguard that appears when a trust agents unlocks the device. [CHAR LIMIT=40] --> <string name="keyguard_indication_trust_granted">Unlocked for <xliff:g id="user_name" example="John Doe">%1$s</xliff:g></string> <!-- Indication on the keyguard that appears when a trust agent is active and available. [CHAR LIMIT=40] --> <string name="keyguard_indication_trust_managed"><xliff:g id="trust_agent" example="Smart Lock">%1$s</xliff:g> is running</string> <!-- Indication on the keyguard that appears when the user disables trust agents until the next time they unlock manually. [CHAR LIMIT=NONE] --> <string name="keyguard_indication_trust_disabled">Device will stay locked until you manually unlock</string> Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +19 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -207,7 +206,16 @@ public class KeyguardIndicationController { * * @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; } Loading Loading @@ -281,16 +289,17 @@ public class KeyguardIndicationController { 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(); Loading @@ -299,7 +308,11 @@ public class KeyguardIndicationController { } 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); Loading Loading
packages/SystemUI/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1195,6 +1195,9 @@ <!-- Indication on the keyguard that appears when a trust agents unlocks the device. [CHAR LIMIT=40] --> <string name="keyguard_indication_trust_granted">Unlocked for <xliff:g id="user_name" example="John Doe">%1$s</xliff:g></string> <!-- Indication on the keyguard that appears when a trust agent is active and available. [CHAR LIMIT=40] --> <string name="keyguard_indication_trust_managed"><xliff:g id="trust_agent" example="Smart Lock">%1$s</xliff:g> is running</string> <!-- Indication on the keyguard that appears when the user disables trust agents until the next time they unlock manually. [CHAR LIMIT=NONE] --> <string name="keyguard_indication_trust_disabled">Device will stay locked until you manually unlock</string> Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +19 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -207,7 +206,16 @@ public class KeyguardIndicationController { * * @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; } Loading Loading @@ -281,16 +289,17 @@ public class KeyguardIndicationController { 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(); Loading @@ -299,7 +308,11 @@ public class KeyguardIndicationController { } 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); Loading