Detect which SIM card has received the message

I am trying to determine which SIM card received an incoming message in BroadcastReceiver on a Dual or Triple SIM support phone.

Note: All SIM cards have the same SMSC.

+4
source share
2 answers

It seems that the information may be in Intent extra with the key "simSlot".

public void onReceive(Context context, Intent intent) {
    ...        
    int simSlot = intent.getIntExtra("simSlot", -1);
    ...
}

I also could not find information about this in my admittedly brief search, so I'm not sure how universal it is or in which version of Android it could be introduced. I found it by dropping all the add-ons in the supplied intent in the receiver on my device.

+1

Lenovo Mediatek

public void onReceive(Context context, Intent intent) {
    ...        
    int simId = intent.getIntExtra("simId", -1);
    ...
}
0

All Articles