Differences between InCallService and ConnectionService

1k views Asked by At

I want to make a custom dialer app which will replace my default dialer app.I did some searching and I found that a dialer app can be built using either ConnectionService or InCallService. Here they have used connectionService to make a calling app, And here IncallService has been used to make the calling app.

The use cases of ConnectionService :

  1. Can make phone calls (VoIP or otherwise) and want those calls to be integrated into the built-in phone app. Referred to as a system managed ConnectionService.
  2. Are a standalone calling app and don't want their calls to be integrated into the built-in phone app. Referred to as a self managed ConnectionService.

The use cases of InCallService:

This service is implemented by an app that wishes to provide functionality for managing phone calls.

So one difference is video call. Video call is possible using connectionService.Are there any other differences I am missing? And which one should I use to make a custom Dialer App?

1

There are 1 answers

0
Rishabh Gupta On
  • Connection Service:- Responsible for creating a "Connection" object with required properties and abilities, like can_mute, can_hold, can_downgrade_to_voice_call, etc, according to which options are enabled or disabled in UI. A connection object also provides methods for call manipulation, like accepting the call, declining the call, disconnecting the call with a reason, putting the call on hold, etc.

  • InCallService:- The responsibility of InCallService is to provide the UI for call interaction, which includes everything from notifications, call screens, call handling buttons, etc.

Android Telecom listens to the call being created and requests the connection object from ConnectionService. All the call manipulation operations are performed on this Connection Object which stays with the Telecom until it is destroyed after the call ends.

In short, InCallService allows users to interact with the call, while ConnectionService handles the call manipulation, as per user requests made from UI provided by InCallService.

Since you are concerned about making a dialer app, InCallService is the required class to be implemented. You may go for ConnectionService if you want extended control over calls.