Merge "Ensure primary provider is contained in the list of enabled providers" into udc-dev am: 8587f769e8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23065921

Change-Id: I281670c85cc44722e974fb7c1c55cbf03b9b2323
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-05-06 01:19:41 +00:00
committed by Automerger Merge Worker

View File

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