Merge "Hide "additional services" if there is only a single primary services" into main
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user