Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3652363e authored by jianzhou's avatar jianzhou
Browse files

Settings: Fix sim settings crash issue

mSelectableSubInfos is not initialized.

Initialize mSelectableSubInfos in createPreferences together with
mAvailableSubInfos, do the same as google logic.

Change-Id: I33ce1a70b8b6c3b491f6ec8bf237dd11eeea32ce
CRs-Fixed: 809006
parent d1ae07ea
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
     * By UX design we have use only one Subscription Information(SubInfo) record per SIM slot.
     * mAvalableSubInfos is the list of SubInfos we present to the user.
     * mSubInfoList is the list of all SubInfos.
     * mSelectableSubInfos is the list of SubInfos that a user can select for data, calls, and SMS.
     */
    private List<SubscriptionInfo> mAvailableSubInfos = null;
    private List<SubscriptionInfo> mSubInfoList = null;
@@ -254,6 +255,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
                (PreferenceCategory)findPreference(SIM_ENABLER_CATEGORY);

        mAvailableSubInfos = new ArrayList<SubscriptionInfo>(mNumSlots);
        mSelectableSubInfos = new ArrayList<SubscriptionInfo>();
        mSimEnablers = new ArrayList<MultiSimEnablerPreference>(mNumSlots);
        for (int i = 0; i < mNumSlots; ++i) {
            final SubscriptionInfo sir = Utils.findRecordBySlotId(getActivity(), i);
@@ -269,6 +271,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
            if ((sir != null) && (sir.getStatus() == SubscriptionManager.ACTIVE)) {
                mNumSims++;
                mAvailableSubInfos.add(sir);
                mSelectableSubInfos.add(sir);
            }
        }