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

Commit de076d0d authored by Reema Bajwa's avatar Reema Bajwa Committed by Android (Google) Code Review
Browse files

Merge "Revert to enabling the register/unregister APIs based on the feature...

Merge "Revert to enabling the register/unregister APIs based on the feature flag, as opposed to always enabling them." into udc-qpr-dev
parents c78ab05e d37f5974
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -96,6 +96,9 @@ public final class CredentialManagerService
    private static final String DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER =
            "enable_credential_manager";

    private static final String DEVICE_CONFIG_ENABLE_CREDENTIAL_DESC_API =
            "enable_credential_description_api";

    private final Context mContext;

    /** Cache of system service list per user id. */
@@ -321,7 +324,14 @@ public final class CredentialManagerService
    }

    public static boolean isCredentialDescriptionApiEnabled() {
        return true;
        final long origId = Binder.clearCallingIdentity();
        try {
            return DeviceConfig.getBoolean(
                    DeviceConfig.NAMESPACE_CREDENTIAL, DEVICE_CONFIG_ENABLE_CREDENTIAL_DESC_API,
                    false);
        } finally {
            Binder.restoreCallingIdentity(origId);
        }
    }

    @SuppressWarnings("GuardedBy") // ErrorProne requires initiateProviderSessionForRequestLocked
@@ -954,7 +964,7 @@ public final class CredentialManagerService
            Slog.i(TAG, "registerCredentialDescription with callingPackage: " + callingPackage);

            if (!isCredentialDescriptionApiEnabled()) {
                throw new UnsupportedOperationException();
                throw new UnsupportedOperationException("Feature not supported");
            }

            enforceCallingPackage(callingPackage, Binder.getCallingUid());
@@ -974,7 +984,7 @@ public final class CredentialManagerService


            if (!isCredentialDescriptionApiEnabled()) {
                throw new UnsupportedOperationException();
                throw new UnsupportedOperationException("Feature not supported");
            }

            enforceCallingPackage(callingPackage, Binder.getCallingUid());