Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

android - How to merge Call programmatically while other call is running (Conference call)

My requirement is like this: Say I am calling a number on that time and I want to call another number programmatically. So far what I have done is: I am able to call to a particular number while some call is already going. For example, suppose I am calling on number 123 and after 1 minute (by using Alarm Manger I trigger an event to call on another number 456 and that is done!

Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:456"));
startActivity(intent);

I am using such intent to call and now I am able to see the screen on my phone with a button to merge the calls:

screenshot of phone

In this image you can see a button of Merging calls. Now when the user clicks on merge, it will merge all 3 Calls. I want to do it programmatically, not with the user interface.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Your question seemed interesting so I started digging in Android Source. Here is what I found:

The activity in the picture you posted is called InCallUI

When you start looking around you will find InCallPresenter which at line 463 has:

final boolean canMerge = activeCall.can(Capabilities.MERGE_CALLS);

and then at 472:

CallCommandClient.getInstance().merge();

when you check that merge() method in CallCommandClient you will find it uses ICallCommandService interface which I think is what you where looking for :)

Initialization of that CallCommandClient is in CallHandlerService around line 193.

Hope this helps & good luck.

PS. The APIs I listed are mostly internal Android stuff. You may have to use reflection to call it or it might not be possible at all - it may be inaccesible for your app because it's not marked as system app.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...