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

Commit a0e5d7fb authored by Malcolm Chen's avatar Malcolm Chen
Browse files

Use correct activeModemCount upon onMultiSimConfigChanged.

Use the number passed in the callback as activeModemCount which is
more reliable.

Test: manual - no crash for dsds -> single sim switch.
Bug: 145560578
Change-Id: I1e60405edaf3003a9191e5b128f3cee604d5d75f
Merged-In: I1e60405edaf3003a9191e5b128f3cee604d5d75f
parent 105b4a39
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -533,7 +533,9 @@ public class UiccController extends Handler {
                    break;
                case EVENT_MULTI_SIM_CONFIG_CHANGED:
                    if (DBG) log("Received EVENT_MULTI_SIM_CONFIG_CHANGED");
                    onMultiSimConfigChanged();
                    int activeModemCount = (int) ((AsyncResult) msg.obj).result;
                    onMultiSimConfigChanged(activeModemCount);
                    break;
                default:
                    Rlog.e(LOG_TAG, " Unknown Event " + msg.what);
                    break;
@@ -541,10 +543,9 @@ public class UiccController extends Handler {
        }
    }

    private void onMultiSimConfigChanged() {
    private void onMultiSimConfigChanged(int newActiveModemCount) {
        int prevActiveModemCount = mCis.length;
        mCis = PhoneFactory.getCommandsInterfaces();
        int newActiveModemCount = mCis.length;

        logWithLocalLog("onMultiSimConfigChanged: prevActiveModemCount " + prevActiveModemCount
                + ", newActiveModemCount " + newActiveModemCount);