How to find out which SIM is making the outgoing call (Dual SIM)

前端 未结 5 1409
[愿得一人]
[愿得一人] 2020-12-31 19:47

I would like to check which SIM is making an outgoing call for DUAL SIM android phones. Read this article Android : Check whether the phone is dual SIM.

Works like a

5条回答
  •  长情又很酷
    2020-12-31 20:30

    You can create BroadcastReceiver, which will accept all outgoing calls. Then:

        String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
        int slot=intent.getIntExtra("com.android.phone.extra.slot",-1); 
        //0 or 1 are valid in my case
    

    number is dialed number
    slot is through which slot you make that call
    You will need to register that receiver, and give proper permissions. This works for dialed USSD codes also. It is tested on Privileg GSM S7589 2 SIM cards, Android 4.2.1

提交回复
热议问题