Do a null check before returning the primary providers

Test: local build
Bug: 280492574

Change-Id: I0182c2060fbe5c74027785d539671f9eaaaf2a25
This commit is contained in:
Jerry Shi
2023-05-04 10:53:16 -07:00
committed by Guangjie (Jerry) Shi
parent 93c08296fc
commit bcd608643c

View File

@@ -290,6 +290,9 @@ public final class CredentialManagerService
mContext, Settings.Secure.CREDENTIAL_SERVICE_PRIMARY,
/* isMultipleMode= */ true);
String[] serviceNames = resolver.readServiceNameList(resolvedUserId);
if (serviceNames == null) {
return new HashSet<String>();
}
return new HashSet<String>(Arrays.asList(serviceNames));
}