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

Commit 8b604ab4 authored by Reema Bajwa's avatar Reema Bajwa
Browse files

Fix bug in credential manager settings

Crash due to null ServiceInfo when base class getServiceInfo is called. This is because the base serviceInfo is not populated until an update happens.

Bug: 264279975
Test: Build locally

Change-Id: I80b7ad2885dcfa675e2dffffb249ab33b117d77d
parent 613dc260
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -247,6 +247,8 @@ public final class CredentialManagerService
            return cancelTransport;
        }

	@SuppressWarnings("GuardedBy") // ErrorProne requires listEnabledProviders
        // to be guarded by 'service.mLock', which is the same as mLock.
        @Override
        public ICancellationSignal listEnabledProviders(IListEnabledProvidersCallback callback) {
            Log.i(TAG, "listEnabledProviders");
@@ -256,7 +258,7 @@ public final class CredentialManagerService
            runForUser(
                    (service) -> {
                        enabledProviders.add(
                                service.getServiceInfo().getComponentName().flattenToString());
                                service.getComponentName().flattenToString());
                    });

            // Call the callback.
+5 −0
Original line number Diff line number Diff line
@@ -53,6 +53,11 @@ public final class CredentialManagerServiceImpl extends
        }
    }

    @GuardedBy("mLock")
    public ComponentName getComponentName() {
        return mInfo.getServiceInfo().getComponentName();
    }

    @Override // from PerUserSystemService
    @GuardedBy("mLock")
    protected ServiceInfo newServiceInfoLocked(@NonNull ComponentName serviceComponent)