Ensure primary provider is contained in the list of enabled providers

Test: build local
Bug: 281121157

Change-Id: I3d9f8a57ab4fc89bbc91c43d050fc0d05ee998e7
This commit is contained in:
Jerry Shi
2023-05-05 15:15:22 -07:00
committed by Guangjie (Jerry) Shi
parent 38c3b84ec9
commit e0daeb4c2b

View File

@@ -25,7 +25,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.provider.Settings;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageInfo;
@@ -727,10 +726,13 @@ public final class CredentialManagerService
"setEnabledProviders",
null);
Set<String> enableProvider = new HashSet<>(providers);
enableProvider.addAll(primaryProviders);
boolean writeEnabledStatus =
Settings.Secure.putStringForUser(getContext().getContentResolver(),
Settings.Secure.CREDENTIAL_SERVICE,
String.join(":", providers),
String.join(":", enableProvider),
userId);
boolean writePrimaryStatus =