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

Commit 91aa2dd5 authored by David Zeuthen's avatar David Zeuthen
Browse files

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
parent 48f7f07d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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 {