[Provider Model] Show all carrier's name on MobileNetworkSummaryController's summary
Screenshot of Provider Model: https://screenshot.googleplex.com/6mKLeMWGWZJh86u.png Screenshot of current: https://screenshot.googleplex.com/Abncb2QGh5TWxEv.png Doc: https://docs.google.com/presentation/d/1azrZVS54pxM2lt9LkZHtFh_6W3fyDw_kTTPVQ_mJCi4/edit#slide=id.g9c7123c172_0_448 Bug: 172229551 Test: manual and make RunSettingsRoboTests ROBOTEST_FILTER=MobileNetworkSummaryControllerTest Change-Id: I0f2a23659ef80b6a76b34af9503ad8d746967859
This commit is contained in:
@@ -45,6 +45,7 @@ import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class MobileNetworkSummaryController extends AbstractPreferenceController implements
|
||||
SubscriptionsChangeListener.SubscriptionsChangeListenerClient, LifecycleObserver,
|
||||
@@ -124,12 +125,20 @@ public class MobileNetworkSummaryController extends AbstractPreferenceController
|
||||
return subs.get(0).getDisplayName();
|
||||
}
|
||||
} else {
|
||||
if (com.android.settings.Utils.isProviderModelEnabled(mContext)) {
|
||||
return getSummaryForProviderModel(subs);
|
||||
}
|
||||
final int count = subs.size();
|
||||
return mContext.getResources().getQuantityString(R.plurals.mobile_network_summary_count,
|
||||
count, count);
|
||||
}
|
||||
}
|
||||
|
||||
private CharSequence getSummaryForProviderModel(List<SubscriptionInfo> subs) {
|
||||
return String.join(", ", subs.stream().map(SubscriptionInfo::getDisplayName)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private void startAddSimFlow() {
|
||||
final Intent intent = new Intent(EuiccManager.ACTION_PROVISION_EMBEDDED_SUBSCRIPTION);
|
||||
intent.putExtra(EuiccManager.EXTRA_FORCE_PROVISION, true);
|
||||
|
Reference in New Issue
Block a user