Making a call from a dual sim android device using adb

寵の児 提交于 2019-12-24 09:35:55

问题


I am trying to make a call from a specific sim on a dual sim phone (SIM 0 and SIM 1) using adb and I can't figure out how to direct the call to that particular sim slot. So far, I have tried making a call using the following command:

adb shell am start -a android.intent.action.CALL -d tel:XXXXXXXXXX

This works fine, but it always calls using SIM 0.

I tried using radiooptions as:

adb shell radiooptions

but it turns out, radiooptions is not supported on this particular device.

/system/bin/sh: radiooptions: not found

I did try it on another device, which is not dual sim, and radiooptions seems to work on that. That was the whole reason I was trying out radiooptions in the first place because it has a very clear cut implementation for selecting specific sim cards.

Anyways, I found the following questions for dual sim android phones, but they are not adb based. they are all Java questions.

Make call using a specified SIM in a Dual SIM Device

Call from second sim

They seem to help and give some clues as to how it can be done,especially this one:

SO Answer for changing SIM

This is very close to what I need, but I don't know how to convert this into a command prompt friendly code.

The method "intent" used in the above links has a documentation here:

https://developer.android.com/reference/android/content/Intent.html

Multi sim android official documentation: https://developer.android.com/about/versions/android-5.1.html#multisim

Any help is greatly appreciated.


回答1:


SIM Card is just a container. The name of the entity being used by the phone to register with the network and to make calls is SubscriberID. A single SIM Card may contain multiple SubscriberIDs.

So instead of asking how to make a call from another SIM Card you should be asking how to make a call using SubscriberID other than the default one - whether this other SubscriberID is stored on the same or another SIM Card is mostly irrelevant.

I do not know if there is a way to specify a different SubscriberID for a single call. But you should be fine with setting a new default SubscriberID before the call and then reverting it back afterwards.

To find out the current ID value run:

adb shell settings get global multi_sim_voice_call

Then change the active Subscriber via UI and run the command again to get another ID.

Use this command to switch to the appropriate ID before calling:

adb shell settings put global multi_sim_voice_call <ID>

To change data call settings - use multi_sim_data_call instead of multi_sim_voice_call.



来源:https://stackoverflow.com/questions/43665583/making-a-call-from-a-dual-sim-android-device-using-adb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!