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

Commit 99a88eca authored by Victor Chang's avatar Victor Chang Committed by Android (Google) Code Review
Browse files

Merge "Temp fix for NPE when race condition happens in TrustedCredentialsSettings" into nyc-dev

parents 290ca6ec 00859bd5
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -695,16 +695,18 @@ public class TrustedCredentialsSettings extends OptionsMenuFragment
                    for (int i = 0; i < n; ++i) {
                        UserHandle profile = profiles.get(i);
                        int profileId = profile.getIdentifier();
                        if (shouldSkipProfile(profile)) {
                            certHoldersByProfile.put(profileId, new ArrayList<CertHolder>(0));
                            continue;
                        }
                        List<ParcelableString> aliases = aliasesByProfileId.get(profileId);
                        if (isCancelled()) {
                            return new SparseArray<List<CertHolder>>();
                        }
                        IKeyChainService service = mKeyChainConnectionByProfileId.get(profileId)
                                .getService();
                        KeyChainConnection keyChainConnection = mKeyChainConnectionByProfileId.get(
                                profileId);
                        if (shouldSkipProfile(profile) || aliases == null
                                || keyChainConnection == null) {
                            certHoldersByProfile.put(profileId, new ArrayList<CertHolder>(0));
                            continue;
                        }
                        IKeyChainService service = keyChainConnection.getService();
                        List<CertHolder> certHolders = new ArrayList<CertHolder>(max);
                        final int aliasMax = aliases.size();
                        for (int j = 0; j < aliasMax; ++j) {