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 01552b9e52
commit 6fc8aa4a75

View File

@@ -81,7 +81,7 @@ public class ChooseDataSimPage extends SetupPage {
private SparseArray<CheckBox> mCheckBoxes; private SparseArray<CheckBox> mCheckBoxes;
private TelephonyManager mPhone; private TelephonyManager mPhone;
private List<SubInfoRecord> mSubInfoRecords; private SparseArray<SubInfoRecord> 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;
@@ -102,8 +102,13 @@ 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 = SubscriptionManager.getActiveSubInfoList(); List<SubInfoRecord> subInfoRecords = SubscriptionManager.getActiveSubInfoList();
int simCount = mSubInfoRecords.size(); int simCount = subInfoRecords.size();
mSubInfoRecords = new SparseArray<SubInfoRecord>(simCount);
for (int i = 0; i < simCount; i++) {
SubInfoRecord subInfoRecord = subInfoRecords.get(i);
mSubInfoRecords.put(subInfoRecord.slotId, 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);