diff options
author | cretin45 <cretin45@gmail.com> | 2015-04-03 16:07:01 -0700 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2015-04-09 13:32:59 -0700 |
commit | e79aa7f0bfd431eea2dddbe4be7fb0fd9ba39ee7 (patch) | |
tree | d861881ef8a05f9ae6a2977ec9647b8f88eb998e /src/com/cyanogenmod/setupwizard/setup | |
parent | 22df00177f2044c8b6f63f4a2194ecb35b822300 (diff) | |
download | packages_apps_SetupWizard-e79aa7f0bfd431eea2dddbe4be7fb0fd9ba39ee7.zip packages_apps_SetupWizard-e79aa7f0bfd431eea2dddbe4be7fb0fd9ba39ee7.tar.gz packages_apps_SetupWizard-e79aa7f0bfd431eea2dddbe4be7fb0fd9ba39ee7.tar.bz2 |
SetupWizard: Don't assume order of SubInfoRecords
Change-Id: I3b4132afccc96a5d08986a3cb902bd384931f21f
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java b/src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java index 303c7e5..7536a5e 100644 --- a/src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java @@ -78,7 +78,7 @@ public class ChooseDataSimPage extends SetupPage { } - public class ChooseDataSimFragment extends SetupPageFragment { + public static class ChooseDataSimFragment extends SetupPageFragment { private ViewGroup mPageView; private SparseArray<TextView> mNameViews; @@ -86,7 +86,7 @@ public class ChooseDataSimPage extends SetupPage { private SparseArray<CheckBox> mCheckBoxes; private TelephonyManager mPhone; - private List<SubscriptionInfo> mSubInfoRecords; + private SparseArray<SubscriptionInfo> mSubInfoRecords; private SparseArray<SignalStrength> mSignalStrengths; private SparseArray<ServiceState> mServiceStates; private SparseArray<PhoneStateListener> mPhoneStateListeners; @@ -108,8 +108,14 @@ public class ChooseDataSimPage extends SetupPage { @Override protected void initializePage() { mPageView = (ViewGroup)mRootView.findViewById(R.id.page_view); - mSubInfoRecords = mSubscriptionManager.getActiveSubscriptionInfoList(); - int simCount = mSubInfoRecords.size(); + List<SubscriptionInfo> subInfoRecords = SubscriptionController + .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); mSignalViews = new SparseArray<ImageView>(simCount); mCheckBoxes = new SparseArray<CheckBox>(simCount); |