0

Context :

I am developing an android dialer app ( Phone app ) Via which app dial pad, app call management is done.

This is my dial pad :

Dialer

You see *123# is typed

The Sim Selection :

Sim selection

Sim selection bottom dialog

What code is running in bottom dialog :

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 manage call :

Within the InCallService i manage calls. If a call is added then i starts CallActivity from below code

callType = CallType.CALL_OUT;

Call.Details details = call.getDetails();
String CallingNumber = details.getHandle().getSchemeSpecificPart();
CallActivity.start(this, CallingNumber, callType, false);

My CallActivity :

Call Activity

What are my problems :

  1. You can see above i had dialed *123# from dialer, But it is just calling *123
  2. It must not have started the Call Activity, Instead it must have requested it as MMI CODE

Any help or guidance is appreciated, Thank you in advance.

Rushikant Pawar
  • 428
  • 1
  • 5
  • 14

1 Answers1

0

I think you can do:

String encode_hash = Uri.encode("#");
intent.setData(Uri.parse("tel:"+dialNumber + encode_hash));
kk.
  • 3,747
  • 12
  • 36
  • 67
theccode
  • 1
  • 1