Setupwizard: Fix msim NPE where sim only in slot 2
Change-Id: I919129185cb49c51f9f02d9718e116e7d02b0d2c
This commit is contained in:
@@ -124,9 +124,8 @@ public class ChooseDataSimPage extends SetupPage {
|
||||
List<SubscriptionInfo> subInfoRecords = mSubscriptionManager.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);
|
||||
for (SubscriptionInfo subInfoRecord : subInfoRecords) {
|
||||
mSubInfoRecords.put(subInfoRecord.getSimSlotIndex(), subInfoRecord);
|
||||
}
|
||||
mNameViews = new SparseArray<TextView>(simCount);
|
||||
mSignalViews = new SparseArray<ImageView>(simCount);
|
||||
@@ -170,7 +169,7 @@ public class ChooseDataSimPage extends SetupPage {
|
||||
mIsAttached = true;
|
||||
mPhone = (TelephonyManager)getActivity().getSystemService(Context.TELEPHONY_SERVICE);
|
||||
for (int i = 0; i < mPhoneStateListeners.size(); i++) {
|
||||
mPhone.listen(mPhoneStateListeners.get(i),
|
||||
mPhone.listen(mPhoneStateListeners.valueAt(i),
|
||||
PhoneStateListener.LISTEN_SERVICE_STATE
|
||||
| PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);
|
||||
}
|
||||
@@ -189,7 +188,7 @@ public class ChooseDataSimPage extends SetupPage {
|
||||
super.onPause();
|
||||
mIsAttached = false;
|
||||
for (int i = 0; i < mPhoneStateListeners.size(); i++) {
|
||||
mPhone.listen(mPhoneStateListeners.get(i), PhoneStateListener.LISTEN_NONE);
|
||||
mPhone.listen(mPhoneStateListeners.valueAt(i), PhoneStateListener.LISTEN_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user