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

Commit 1c3adbb4 authored by Reema Bajwa's avatar Reema Bajwa Committed by Automerger Merge Worker
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 am: de076d0d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24531777



Change-Id: I4d260fbbd015f882b4d49d35b839f641ca9416ea
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c02ad5a5 de076d0d
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());