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

Commit 4014c90e authored by Becca Hughes's avatar Becca Hughes
Browse files

Add flag to credential manager

Test: make
Bug: 253157366

Change-Id: I7968214cc8e7902b231a6f0a2c1d3b7e677b5c95
parent acaebf68
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.