Add subscriptions list to the multi-network header

The new UX for showing multiple active mobile plan subscriptions (SIMs,
eSIMs, etc.)  needs a header at the top of the Network & internet page
that shows wifi status and a list of active mobile subscriptions in the
form of one Preference per subscription.

This CL adds display of the mobile subscriptions to this header. It does
not yet show the correct summary text or do anything when you tap on
them - that will be coming in subsequent CLs. Also, since adding a
variable number of items to the top of the page messes up our current
strategy of having a fixed number of hidden items at the bottom based on
overall item count, this CL just makes all items visible. Subsequent CLs
can restore this behavior with dynamic adjustment.

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: Ibfadf8cb61f6f5aff6ce38b7974267b1e4ddc719
This commit is contained in:
Antony Sargent
2018-12-12 09:09:45 -08:00
parent 3f5966bb48
commit e92e07eb97
7 changed files with 594 additions and 5 deletions

View File

@@ -24,8 +24,20 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import androidx.annotation.VisibleForTesting;
public class SubscriptionUtil {
private static List<SubscriptionInfo> sResultsForTesting;
@VisibleForTesting
static void setAvailableSubscriptionsForTesting(List<SubscriptionInfo> results) {
sResultsForTesting = results;
}
public static List<SubscriptionInfo> getAvailableSubscriptions(SubscriptionManager manager) {
if (sResultsForTesting != null) {
return sResultsForTesting;
}
List<SubscriptionInfo> subscriptions = manager.getAvailableSubscriptionInfoList();
if (subscriptions == null) {
subscriptions = new ArrayList<>();