Android 拨号器应用程序中的MMI代码发出呼叫请求

Android 拨号器应用程序中的MMI代码发出呼叫请求,android,android-dialer,android-phone-call,Android,Android Dialer,Android Phone Call,上下文: Log.d("CALL", "to :" + dialNumber + ".. \n"); intent.setData(Uri.parse("tel:"+dialNumber)); intent.putExtra("com.android.phone.force.slot", true); Log.d("CALL", "ACCOUNTS :" + phoneAccountHandleList.size() + ".. \n"); if (sim == 0) { inten

上下文:

Log.d("CALL", "to :" + dialNumber + ".. \n");
intent.setData(Uri.parse("tel:"+dialNumber));
intent.putExtra("com.android.phone.force.slot", true);

Log.d("CALL", "ACCOUNTS :" + phoneAccountHandleList.size() + ".. \n");

if (sim == 0)
{
    intent.putExtra("com.android.phone.extra.slot", 0);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 0)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(0));
    }
 }
 else
 {
    intent.putExtra("com.android.phone.extra.slot", 1);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 1)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(1));
    }

 }

 context.startActivity(intent);
我正在开发一个android拨号器应用程序(手机应用程序) 通过哪个应用程序拨号板,应用程序呼叫管理完成

这是我的拨号盘:

你看*123#是打出来的

Sim卡选择:

Log.d("CALL", "to :" + dialNumber + ".. \n");
intent.setData(Uri.parse("tel:"+dialNumber));
intent.putExtra("com.android.phone.force.slot", true);

Log.d("CALL", "ACCOUNTS :" + phoneAccountHandleList.size() + ".. \n");

if (sim == 0)
{
    intent.putExtra("com.android.phone.extra.slot", 0);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 0)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(0));
    }
 }
 else
 {
    intent.putExtra("com.android.phone.extra.slot", 1);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 1)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(1));
    }

 }

 context.startActivity(intent);

Sim卡选择底部对话框

底部对话框中运行的代码:

Log.d("CALL", "to :" + dialNumber + ".. \n");
intent.setData(Uri.parse("tel:"+dialNumber));
intent.putExtra("com.android.phone.force.slot", true);

Log.d("CALL", "ACCOUNTS :" + phoneAccountHandleList.size() + ".. \n");

if (sim == 0)
{
    intent.putExtra("com.android.phone.extra.slot", 0);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 0)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(0));
    }
 }
 else
 {
    intent.putExtra("com.android.phone.extra.slot", 1);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 1)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(1));
    }

 }

 context.startActivity(intent);
呼叫服务管理呼叫:

Log.d("CALL", "to :" + dialNumber + ".. \n");
intent.setData(Uri.parse("tel:"+dialNumber));
intent.putExtra("com.android.phone.force.slot", true);

Log.d("CALL", "ACCOUNTS :" + phoneAccountHandleList.size() + ".. \n");

if (sim == 0)
{
    intent.putExtra("com.android.phone.extra.slot", 0);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 0)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(0));
    }
 }
 else
 {
    intent.putExtra("com.android.phone.extra.slot", 1);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 1)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(1));
    }

 }

 context.startActivity(intent);
在InCallService中,我管理呼叫。如果添加了调用,则我从下面的代码开始调用活动

callType = CallType.CALL_OUT;

Call.Details details = call.getDetails();
String CallingNumber = details.getHandle().getSchemeSpecificPart();
CallActivity.start(this, CallingNumber, callType, false);
我的通话活动:

Log.d("CALL", "to :" + dialNumber + ".. \n");
intent.setData(Uri.parse("tel:"+dialNumber));
intent.putExtra("com.android.phone.force.slot", true);

Log.d("CALL", "ACCOUNTS :" + phoneAccountHandleList.size() + ".. \n");

if (sim == 0)
{
    intent.putExtra("com.android.phone.extra.slot", 0);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 0)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(0));
    }
 }
 else
 {
    intent.putExtra("com.android.phone.extra.slot", 1);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 1)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(1));
    }

 }

 context.startActivity(intent);

我的问题是什么:

Log.d("CALL", "to :" + dialNumber + ".. \n");
intent.setData(Uri.parse("tel:"+dialNumber));
intent.putExtra("com.android.phone.force.slot", true);

Log.d("CALL", "ACCOUNTS :" + phoneAccountHandleList.size() + ".. \n");

if (sim == 0)
{
    intent.putExtra("com.android.phone.extra.slot", 0);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 0)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(0));
    }
 }
 else
 {
    intent.putExtra("com.android.phone.extra.slot", 1);
    if (phoneAccountHandleList != null && phoneAccountHandleList.size() > 1)
    {
        intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandleList.get(1));
    }

 }

 context.startActivity(intent);
  • 你可以看到上面我从拨号器拨了*123,但它只是在拨*123
  • 它必须没有启动呼叫活动,而必须作为MMI代码请求
  • 非常感谢您的帮助或指导,请提前感谢。

    我想您可以:

    String encode_hash = Uri.encode("#");
    intent.setData(Uri.parse("tel:"+dialNumber + encode_hash));