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

Commit f657346f authored by Shuang Hao's avatar Shuang Hao
Browse files

Not to start CredentialManagerService on wear if flag not enabled.

DD: go/wear-dd-credential-manager
Bug: 301168341
Tested: enable/disabled flag with adb command and reboot the system, ·getSystemService("credential")· returns non-null/null result correspondingly.
Change-Id: Id5140bc13e691cf2c5c5be22884d06292107e369
parent 3459cd0e
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import android.content.pm.PackageManagerInternal;
import android.content.res.Configuration;
import android.content.res.Resources.Theme;
import android.credentials.CredentialManager;
import android.credentials.flags.Flags;
import android.database.sqlite.SQLiteCompatibilityWalFlags;
import android.database.sqlite.SQLiteGlobal;
import android.graphics.GraphicsStatsService;
@@ -2782,9 +2783,14 @@ public final class SystemServer implements Dumpable {
                    DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_CREDENTIAL,
                    CredentialManager.DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER, true);
            if (credentialManagerEnabled) {
                if(isWatch &&
                  !android.credentials.flags.Flags.wearCredentialManagerEnabled()) {
                  Slog.d(TAG, "CredentialManager disabled on wear.");
                } else {
                  t.traceBegin("StartCredentialManagerService");
                  mSystemServiceManager.startService(CREDENTIAL_MANAGER_SERVICE_CLASS);
                  t.traceEnd();
                }
            } else {
                Slog.d(TAG, "CredentialManager disabled.");
            }