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

Commit fed53438 authored by Becca Hughes's avatar Becca Hughes Committed by Automerger Merge Worker
Browse files

Merge "Move DeviceConfig check to Service" into udc-dev am: 5b791819 am: ee74d89f

parents b9bd4ae2 ee74d89f
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -460,9 +460,17 @@ public final class CredentialManager {
        return false;
    }

    /**
     * Returns whether the service is enabled.
     *
     * @hide
     */
    private boolean isServiceEnabled() {
        return DeviceConfig.getBoolean(
                DeviceConfig.NAMESPACE_CREDENTIAL, DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER, true);
        try {
            return mService.isServiceEnabled();
        } catch (RemoteException e) {
            return false;
        }
    }

    /**
+2 −0
Original line number Diff line number Diff line
@@ -58,5 +58,7 @@ interface ICredentialManager {
    List<CredentialProviderInfo> getCredentialProviderServices(in int userId, in int providerFilter);

    List<CredentialProviderInfo> getCredentialProviderServicesForTesting(in int providerFilter);

    boolean isServiceEnabled();
}
+13 −0
Original line number Diff line number Diff line
@@ -784,6 +784,19 @@ public final class CredentialManagerService
                    mContext, userId, providerFilter, getEnabledProviders());
        }

        @Override
        public boolean isServiceEnabled() {
            final long origId = Binder.clearCallingIdentity();
            try {
                return DeviceConfig.getBoolean(
                        DeviceConfig.NAMESPACE_CREDENTIAL,
                        CredentialManager.DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER,
                        false);
            } finally {
                Binder.restoreCallingIdentity(origId);
            }
        }

        @SuppressWarnings("GuardedBy") // ErrorProne requires service.mLock which is the same
        // this.mLock
        private Set<ComponentName> getEnabledProviders() {