Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52221d80 authored by Rubin Xu's avatar Rubin Xu
Browse files

Do not show key entries used for user authentication flow

Bug: 33126414
Test: Enable new authentication flow; go to user credentials in Settings
      observe no entries related to user authentication are shown.
Change-Id: I62e5796cc73213b23ca7809a77082350a883fbee
parent 3fca717d
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -264,11 +264,17 @@ public class UserCredentialsSettings extends OptionsMenuFragment implements OnIt
            final SortedMap<String, Credential> aliasMap = new TreeMap<>();
            for (final Credential.Type type : Credential.Type.values()) {
                for (final String alias : keyStore.list(type.prefix, uid)) {
                    if (UserHandle.getAppId(uid) == Process.SYSTEM_UID) {
                        // Do not show work profile keys in user credentials
                        if (alias.startsWith(LockPatternUtils.PROFILE_KEY_NAME_ENCRYPT) ||
                                alias.startsWith(LockPatternUtils.PROFILE_KEY_NAME_DECRYPT)) {
                            continue;
                        }
                        // Do not show synthetic password keys in user credential
                        if (alias.startsWith(LockPatternUtils.SYNTHETIC_PASSWORD_KEY_PREFIX)) {
                            continue;
                        }
                    }
                    Credential c = aliasMap.get(alias);
                    if (c == null) {
                        c = new Credential(alias, uid);