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

Commit e8a45a84 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed phone switcher crash

Fixed a crash when change from single SIM
to dual SIM.

Fix: 186849453
Test: Manual
Merged-In: If442489bc8dbb797be41c0913dae4970c5e3896e
Change-Id: If442489bc8dbb797be41c0913dae4970c5e3896e
(cherry picked from commit 98bc007b)
parent c2179c96
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -707,10 +707,13 @@ public class PhoneSwitcher extends Handler {

        mPhoneSubscriptions = copyOf(mPhoneSubscriptions, mActiveModemCount);
        mPhoneStates = copyOf(mPhoneStates, mActiveModemCount);
        //clear the list in case of multisim config change
        mCurrentDdsSwitchFailure.clear();

        // Single SIM -> dual SIM switch.
        // Dual SIM -> Single SIM switch.
        for (int phoneId = oldActiveModemCount - 1; phoneId >= mActiveModemCount; phoneId--) {
            mCurrentDdsSwitchFailure.remove(phoneId);
        }

        // Single SIM -> Dual SIM switch.
        for (int phoneId = oldActiveModemCount; phoneId < mActiveModemCount; phoneId++) {
            mPhoneStates[phoneId] = new PhoneState();
            Phone phone = PhoneFactory.getPhone(phoneId);