I'm trying to develop a really simple in call app to replace the stock version. Basically, I just want to answer incoming calls and present the user with a really simple customized UI. There is no need for outgoing calls or any fancy stuff.
Searching the web I've found package android.telecom.incallservice
(available in API 23). This service is implemented by any app that wishes to provide the user-interface for managing phone calls.
It seems promising but I'm having trouble getting it to work. I've created simple service extending InCallService and declared it in my manifest as described by the docs. However, I would expect to be able to change the default phone app in the settings to my own, but I can only find the stock phone app.
This is the manifest declaration from the docs. I've replaced BIND_IN_CALL_SERVICE
with BIND_INCALL_SERVICE
since I guess this is a typo.
<service android:name="your.package.YourInCallServiceImplementation" android:permission="android.permission.BIND_INCALL_SERVICE"> <meta-data android:name="android.telecom.IN_CALL_SERVICE_UI" android:value="true" /> <intent-filter> <action android:name="android.telecom.InCallService"/> </intent-filter> </service>
Is it even possible for third-party app to replace the default in call app?
Are there any sample implementations using this API out there I may use as a reference? I've found the google implementation, but this is a system app which makes use of some permissions that are not available for other apps (ex: android.permission.MODIFY_PHONE_STATE
).
Am I correct in the assumption that after providing a correct InCallService
manifest registration and a stub implementation I could expect to find my app under Default Apps -> Phone
? Do I need to declare something else?
Thanks.
Numbr is a private phone number app specifically designed for iPhone to protect the user's privacy. It is a simple and inexpensive way for those who need a disposable number to make international and domestic calls, send text messages or to have an anonymous backup number for everyday situations.
First, swipe down once or twice from the top of the screen—depending on your phone—to open the notification shade and tap the gear icon. Next, go to “Apps.” Select “Default Apps” or “Choose Default Apps” on a Samsung phone. There are a few different categories of default apps here, the one we want is “Phone App.”
Classic Hangouts is being replaced by Google Chat for everyone. You are no longer able to use classic Hangouts on most platforms.
- Is it even possible for third-party app to replace the default in call app?
Yes, starting with API 23 it is possible.
- Are there any sample implementations using this API out there I may use as a reference? I've found the google implementation, but this is a system app which makes use of some permissions that are not available for other apps (ex:
android.permission.MODIFY_PHONE_STATE
).
The only one I'm aware of, is the sample I created https://github.com/arekolek/simple-phone that was already mentioned in the other answer as well.
- Am I correct in the assumption that after providing a correct
InCallService
manifest registration and a stub implementation I could expect to find my app underDefault Apps -> Phone
? Do I need to declare something else?
Actually, no.
Like mentioned in another answer on the topic, you don't need InCallService
at all to appear on that list.
What you need though, is to register an activity with two intent filters, one with a tel
Uri scheme, and one with an empty scheme (having just one of them is not enough):
<intent-filter> <action android:name="android.intent.action.DIAL" /> <data android:scheme="tel" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.DIAL" /> </intent-filter>
It is vaguely mentioned in the docs, and stated explicitly in AOSP code.
That is enough to appear on that list. Only then, to provide the UI for the call, will you actually need the InCallService
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With