SetupWizard: Don't assume order of SubInfoRecords

Change-Id: I3b4132afccc96a5d08986a3cb902bd384931f21f
This commit is contained in:
cretin45 2015-04-03 16:07:01 -07:00
parent 22df00177f
commit e79aa7f0bf
1 changed files with 10 additions and 4 deletions

View File

@ -78,7 +78,7 @@ public class ChooseDataSimPage extends SetupPage {
} }
public class ChooseDataSimFragment extends SetupPageFragment { public static class ChooseDataSimFragment extends SetupPageFragment {
private ViewGroup mPageView; private ViewGroup mPageView;
private SparseArray<TextView> mNameViews; private SparseArray<TextView> mNameViews;
@ -86,7 +86,7 @@ public class ChooseDataSimPage extends SetupPage {
private SparseArray<CheckBox> mCheckBoxes; private SparseArray<CheckBox> mCheckBoxes;
private TelephonyManager mPhone; private TelephonyManager mPhone;
private List<SubscriptionInfo> mSubInfoRecords; private SparseArray<SubscriptionInfo> mSubInfoRecords;
private SparseArray<SignalStrength> mSignalStrengths; private SparseArray<SignalStrength> mSignalStrengths;
private SparseArray<ServiceState> mServiceStates; private SparseArray<ServiceState> mServiceStates;
private SparseArray<PhoneStateListener> mPhoneStateListeners; private SparseArray<PhoneStateListener> mPhoneStateListeners;
@ -108,8 +108,14 @@ public class ChooseDataSimPage extends SetupPage {
@Override @Override
protected void initializePage() { protected void initializePage() {
mPageView = (ViewGroup)mRootView.findViewById(R.id.page_view); mPageView = (ViewGroup)mRootView.findViewById(R.id.page_view);
mSubInfoRecords = mSubscriptionManager.getActiveSubscriptionInfoList(); List<SubscriptionInfo> subInfoRecords = SubscriptionController
int simCount = mSubInfoRecords.size(); .getInstance().getActiveSubscriptionInfoList();
int simCount = subInfoRecords.size();
mSubInfoRecords = new SparseArray<SubscriptionInfo>(simCount);
for (int i = 0; i < simCount; i++) {
SubscriptionInfo subInfoRecord = subInfoRecords.get(i);
mSubInfoRecords.put(subInfoRecord.getSubscriptionId(), subInfoRecord);
}
mNameViews = new SparseArray<TextView>(simCount); mNameViews = new SparseArray<TextView>(simCount);
mSignalViews = new SparseArray<ImageView>(simCount); mSignalViews = new SparseArray<ImageView>(simCount);
mCheckBoxes = new SparseArray<CheckBox>(simCount); mCheckBoxes = new SparseArray<CheckBox>(simCount);