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

Commit 400dfdb2 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
parent da0712f8
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -530,7 +530,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;
@@ -538,10 +540,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);