Merge "Hide "additional services" if there is only a single primary services" into main

This commit is contained in:
Becca Hughes
2024-02-15 23:54:59 +00:00
committed by Android (Google) Code Review
2 changed files with 36 additions and 1 deletions

View File

@@ -166,7 +166,7 @@ public class CredentialManagerPreferenceController extends BasePreferenceControl
return CONDITIONALLY_UNAVAILABLE;
}
if (mServices.isEmpty()) {
if (!hasNonPrimaryServices()) {
return CONDITIONALLY_UNAVAILABLE;
}
@@ -428,6 +428,17 @@ public class CredentialManagerPreferenceController extends BasePreferenceControl
}
}
@VisibleForTesting
public boolean hasNonPrimaryServices() {
for (CredentialProviderInfo availableService : mServices) {
if (!availableService.isPrimary()) {
return true;
}
}
return false;
}
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);