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

Commit 333fea1a authored by Malcolm Chen's avatar Malcolm Chen
Browse files

Broadcast ACTION_MULTI_SIM_CONFIG_CHANGED upon ss <-> ds switch.

Bug: 141388730
Test: test app
Change-Id: I9c4f1e8bb21cf12addc612a82a0fc746d495fbeb
Merged-In: I9c4f1e8bb21cf12addc612a82a0fc746d495fbeb
parent 72a242d0
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -16,7 +16,11 @@

package com.android.internal.telephony;

import static android.telephony.TelephonyManager.ACTION_MULTI_SIM_CONFIG_CHANGED;
import static android.telephony.TelephonyManager.EXTRA_NUM_OF_ACTIVE_SIM_SUPPORTED;

import android.content.Context;
import android.content.Intent;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
@@ -378,6 +382,7 @@ public class PhoneConfigurationManager {
        } else {
            log("setMultiSimProperties: Rebooting is not required to switch multi-sim config to "
                    + finalMultiSimConfig);
            broadcastSimSlotNumChange(numOfSims);
            // Register to RIL service if needed.
            for (int i = 0; i < mPhones.length; i++) {
                Phone phone = mPhones[i];
@@ -386,6 +391,13 @@ public class PhoneConfigurationManager {
        }
    }

    private void broadcastSimSlotNumChange(int numOfSims) {
        log("broadcastSimSlotNumChange numOfSims" + numOfSims);
        Intent intent = new Intent(ACTION_MULTI_SIM_CONFIG_CHANGED);
        intent.putExtra(EXTRA_NUM_OF_ACTIVE_SIM_SUPPORTED, numOfSims);
        mContext.sendBroadcast(intent);
    }

    private static void log(String s) {
        Rlog.d(LOG_TAG, s);
    }