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

Commit cc863b90 authored by Guangjie (Jerry) Shi's avatar Guangjie (Jerry) Shi Committed by Android (Google) Code Review
Browse files

Merge "Add flag to credential manager"

parents 018ce9f0 4014c90e
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.os.CancellationSignal;
import android.os.ICancellationSignal;
import android.os.OutcomeReceiver;
import android.os.RemoteException;
import android.provider.DeviceConfig;
import android.util.Log;

import java.util.List;
@@ -49,6 +50,8 @@ import java.util.concurrent.Executor;
@SystemService(Context.CREDENTIAL_SERVICE)
public final class CredentialManager {
    private static final String TAG = "CredentialManager";
    private static final String DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER =
            "enable_credential_manager";

    private final Context mContext;
    private final ICredentialManager mService;
@@ -266,6 +269,16 @@ public final class CredentialManager {
        }
    }

    /**
     * Returns whether the service is enabled.
     *
     * @hide
     */
    public static boolean isServiceEnabled() {
        return DeviceConfig.getBoolean(
                DeviceConfig.NAMESPACE_CREDENTIAL, DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER, true);
    }

    private static class GetCredentialTransport extends IGetCredentialCallback.Stub {
        // TODO: listen for cancellation to release callback.