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

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

Merge "Add flag to guard the Credential Manager system service."

parents 7c6e1b25 5c90ad35
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -50,12 +50,18 @@ 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;

    /**
     * Flag to enable and disable Credential Manager.
     *
     * @hide
     */
    public static final String DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER =
            "enable_credential_manager";

    /**
     * @hide instantiated by ContextImpl.
     */
+11 −3
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal;
import android.content.res.Configuration;
import android.content.res.Resources.Theme;
import android.credentials.CredentialManager;
import android.database.sqlite.SQLiteCompatibilityWalFlags;
import android.database.sqlite.SQLiteGlobal;
import android.graphics.GraphicsStatsService;
@@ -2609,9 +2610,16 @@ public final class SystemServer implements Dumpable {
        }

        if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_CREDENTIALS)) {
            boolean credentialManagerEnabled =
                    DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_CREDENTIAL,
                    CredentialManager.DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER, true);
            if (credentialManagerEnabled) {
                t.traceBegin("StartCredentialManagerService");
                mSystemServiceManager.startService(CREDENTIAL_MANAGER_SERVICE_CLASS);
                t.traceEnd();
            } else {
                Slog.d(TAG, "CredentialManager disabled.");
            }
        }

        // Translation manager service