Loading core/res/res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1756,6 +1756,10 @@ <string name="lockscreen_pattern_wrong">Try again</string> <!-- On the unlock password screen, shown when the user enters the wrong lock password and must try again. --> <string name="lockscreen_password_wrong">Try again</string> <!-- On the keyguard screen, this string explains that some features or data may not be available until the device is unlocked. [CHAR LIMIT=48] --> <string name="lockscreen_storage_locked">Unlock for all features and data</string> <!-- Shown when face unlock failed multiple times so we're just using the backup --> <string name="faceunlock_multiple_failures">Maximum Face Unlock attempts exceeded</string> Loading core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2646,6 +2646,8 @@ <!-- Colon separated list of package names that should be granted DND access --> <java-symbol type="string" name="config_defaultDndAccessPackages" /> <java-symbol type="string" name="lockscreen_storage_locked" /> <!-- Used for MimeIconUtils. --> <java-symbol type="drawable" name="ic_doc_apk" /> <java-symbol type="drawable" name="ic_doc_audio" /> Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +25 −22 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar; import android.app.ActivityManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading @@ -30,6 +31,7 @@ import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; import android.os.UserManager; import android.text.TextUtils; import android.text.format.Formatter; import android.util.Log; Loading Loading @@ -57,6 +59,7 @@ public class KeyguardIndicationController { private final Context mContext; private final KeyguardIndicationTextView mTextView; private final UserManager mUserManager; private final IBatteryStats mBatteryInfo; private final int mSlowThreshold; Loading Loading @@ -85,9 +88,10 @@ public class KeyguardIndicationController { mSlowThreshold = res.getInteger(R.integer.config_chargingSlowlyThreshold); mFastThreshold = res.getInteger(R.integer.config_chargingFastThreshold); mUserManager = context.getSystemService(UserManager.class); mBatteryInfo = IBatteryStats.Stub.asInterface( ServiceManager.getService(BatteryStats.SERVICE_NAME)); KeyguardUpdateMonitor.getInstance(context).registerCallback(mUpdateMonitor); context.registerReceiverAsUser(mReceiver, UserHandle.SYSTEM, new IntentFilter(Intent.ACTION_TIME_TICK), null, null); Loading Loading @@ -155,30 +159,29 @@ public class KeyguardIndicationController { private void updateIndication() { if (mVisible) { mTextView.switchIndication(computeIndication()); mTextView.setTextColor(computeColor()); } } // Walk down a precedence-ordered list of what should indication // should be shown based on user or device state if (!mUserManager.isUserUnlocked(ActivityManager.getCurrentUser())) { mTextView.switchIndication(com.android.internal.R.string.lockscreen_storage_locked); mTextView.setTextColor(Color.WHITE); private int computeColor() { if (!TextUtils.isEmpty(mTransientIndication)) { return mTransientTextColor; } return Color.WHITE; } } else if (!TextUtils.isEmpty(mTransientIndication)) { mTextView.switchIndication(mTransientIndication); mTextView.setTextColor(mTransientTextColor); private String computeIndication() { if (!TextUtils.isEmpty(mTransientIndication)) { return mTransientIndication; } if (mPowerPluggedIn) { } else if (mPowerPluggedIn) { String indication = computePowerIndication(); if (DEBUG_CHARGING_SPEED) { indication += ", " + (mChargingWattage / 1000) + " mW"; } return indication; mTextView.switchIndication(indication); mTextView.setTextColor(Color.WHITE); } else { mTextView.switchIndication(mRestingIndication); mTextView.setTextColor(Color.WHITE); } } return mRestingIndication; } private String computePowerIndication() { Loading services/core/java/com/android/server/LockSettingsService.java +3 −16 Original line number Diff line number Diff line Loading @@ -304,7 +304,9 @@ public class LockSettingsService extends ILockSettings.Stub { final boolean isSecure = mStorage.hasPassword(user.id) || mStorage.hasPattern(user.id); if (isSecure && !mUserManager.isUserUnlockingOrUnlocked(userHandle)) { if (!user.isManagedProfile()) { showEncryptionNotification(userHandle); // When the user is locked, we communicate it loud-and-clear // on the lockscreen; we only show a notification below for // locked managed profiles. } else { UserInfo parent = mUserManager.getProfileParent(user.id); if (parent != null && Loading Loading @@ -340,21 +342,6 @@ public class LockSettingsService extends ILockSettings.Stub { showEncryptionNotification(user, title, message, detail, intent); } private void showEncryptionNotification(UserHandle user) { Resources r = mContext.getResources(); CharSequence title = r.getText( com.android.internal.R.string.user_encrypted_title); CharSequence message = r.getText( com.android.internal.R.string.user_encrypted_message); CharSequence detail = r.getText( com.android.internal.R.string.user_encrypted_detail); PendingIntent intent = PendingIntent.getActivity(mContext, 0, ACTION_NULL, PendingIntent.FLAG_UPDATE_CURRENT); showEncryptionNotification(user, title, message, detail, intent); } private void showEncryptionNotification(UserHandle user, CharSequence title, CharSequence message, CharSequence detail, PendingIntent intent) { if (DEBUG) Slog.v(TAG, "showing encryption notification, user: " + user.getIdentifier()); Loading Loading
core/res/res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1756,6 +1756,10 @@ <string name="lockscreen_pattern_wrong">Try again</string> <!-- On the unlock password screen, shown when the user enters the wrong lock password and must try again. --> <string name="lockscreen_password_wrong">Try again</string> <!-- On the keyguard screen, this string explains that some features or data may not be available until the device is unlocked. [CHAR LIMIT=48] --> <string name="lockscreen_storage_locked">Unlock for all features and data</string> <!-- Shown when face unlock failed multiple times so we're just using the backup --> <string name="faceunlock_multiple_failures">Maximum Face Unlock attempts exceeded</string> Loading
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2646,6 +2646,8 @@ <!-- Colon separated list of package names that should be granted DND access --> <java-symbol type="string" name="config_defaultDndAccessPackages" /> <java-symbol type="string" name="lockscreen_storage_locked" /> <!-- Used for MimeIconUtils. --> <java-symbol type="drawable" name="ic_doc_apk" /> <java-symbol type="drawable" name="ic_doc_audio" /> Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +25 −22 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar; import android.app.ActivityManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading @@ -30,6 +31,7 @@ import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; import android.os.UserManager; import android.text.TextUtils; import android.text.format.Formatter; import android.util.Log; Loading Loading @@ -57,6 +59,7 @@ public class KeyguardIndicationController { private final Context mContext; private final KeyguardIndicationTextView mTextView; private final UserManager mUserManager; private final IBatteryStats mBatteryInfo; private final int mSlowThreshold; Loading Loading @@ -85,9 +88,10 @@ public class KeyguardIndicationController { mSlowThreshold = res.getInteger(R.integer.config_chargingSlowlyThreshold); mFastThreshold = res.getInteger(R.integer.config_chargingFastThreshold); mUserManager = context.getSystemService(UserManager.class); mBatteryInfo = IBatteryStats.Stub.asInterface( ServiceManager.getService(BatteryStats.SERVICE_NAME)); KeyguardUpdateMonitor.getInstance(context).registerCallback(mUpdateMonitor); context.registerReceiverAsUser(mReceiver, UserHandle.SYSTEM, new IntentFilter(Intent.ACTION_TIME_TICK), null, null); Loading Loading @@ -155,30 +159,29 @@ public class KeyguardIndicationController { private void updateIndication() { if (mVisible) { mTextView.switchIndication(computeIndication()); mTextView.setTextColor(computeColor()); } } // Walk down a precedence-ordered list of what should indication // should be shown based on user or device state if (!mUserManager.isUserUnlocked(ActivityManager.getCurrentUser())) { mTextView.switchIndication(com.android.internal.R.string.lockscreen_storage_locked); mTextView.setTextColor(Color.WHITE); private int computeColor() { if (!TextUtils.isEmpty(mTransientIndication)) { return mTransientTextColor; } return Color.WHITE; } } else if (!TextUtils.isEmpty(mTransientIndication)) { mTextView.switchIndication(mTransientIndication); mTextView.setTextColor(mTransientTextColor); private String computeIndication() { if (!TextUtils.isEmpty(mTransientIndication)) { return mTransientIndication; } if (mPowerPluggedIn) { } else if (mPowerPluggedIn) { String indication = computePowerIndication(); if (DEBUG_CHARGING_SPEED) { indication += ", " + (mChargingWattage / 1000) + " mW"; } return indication; mTextView.switchIndication(indication); mTextView.setTextColor(Color.WHITE); } else { mTextView.switchIndication(mRestingIndication); mTextView.setTextColor(Color.WHITE); } } return mRestingIndication; } private String computePowerIndication() { Loading
services/core/java/com/android/server/LockSettingsService.java +3 −16 Original line number Diff line number Diff line Loading @@ -304,7 +304,9 @@ public class LockSettingsService extends ILockSettings.Stub { final boolean isSecure = mStorage.hasPassword(user.id) || mStorage.hasPattern(user.id); if (isSecure && !mUserManager.isUserUnlockingOrUnlocked(userHandle)) { if (!user.isManagedProfile()) { showEncryptionNotification(userHandle); // When the user is locked, we communicate it loud-and-clear // on the lockscreen; we only show a notification below for // locked managed profiles. } else { UserInfo parent = mUserManager.getProfileParent(user.id); if (parent != null && Loading Loading @@ -340,21 +342,6 @@ public class LockSettingsService extends ILockSettings.Stub { showEncryptionNotification(user, title, message, detail, intent); } private void showEncryptionNotification(UserHandle user) { Resources r = mContext.getResources(); CharSequence title = r.getText( com.android.internal.R.string.user_encrypted_title); CharSequence message = r.getText( com.android.internal.R.string.user_encrypted_message); CharSequence detail = r.getText( com.android.internal.R.string.user_encrypted_detail); PendingIntent intent = PendingIntent.getActivity(mContext, 0, ACTION_NULL, PendingIntent.FLAG_UPDATE_CURRENT); showEncryptionNotification(user, title, message, detail, intent); } private void showEncryptionNotification(UserHandle user, CharSequence title, CharSequence message, CharSequence detail, PendingIntent intent) { if (DEBUG) Slog.v(TAG, "showing encryption notification, user: " + user.getIdentifier()); Loading