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

Commit 0c52bf1a authored by Jack Yu's avatar Jack Yu Committed by Gerrit Code Review
Browse files

Merge "Fixed phone switcher crash"

parents 4c1124a2 e8a45a84
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);