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

This commit is contained in:
Treehugger Robot
2023-05-06 01:02:50 +00:00
committed by Android (Google) Code Review

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 =