Make IdentityCredentialStore.getInstance() return null if credstore is not installed.
Having this method return null is the expected and documented behavior when either the IC HAL or credstore isn't available. Test: atest android.security.identity.cts (with credstore not running) Bug: 148495024 Change-Id: Ifa17c58a84057499b1aeb8404959d5c0badfe52a
This commit is contained in:
@@ -38,6 +38,10 @@ class CredstoreIdentityCredentialStore extends IdentityCredentialStore {
|
||||
ICredentialStoreFactory storeFactory =
|
||||
ICredentialStoreFactory.Stub.asInterface(
|
||||
ServiceManager.getService("android.security.identity"));
|
||||
if (storeFactory == null) {
|
||||
// This can happen if credstore is not running or not installed.
|
||||
return null;
|
||||
}
|
||||
|
||||
ICredentialStore credStore = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user