I'm trying to replace the default android phone call app. More specifically I want to launch my custom phone call screen everytime a call action is performed.
I understand this is possible since Android's API 24 (Version 7.0 - Nougat) but I found no references on how to achieve this. Just to be clear, I do not want to show an overlay layout for the call screen. I want to set my call app as default.
I found a similar question for the sms app here: Stackoverflow - replace default sms app. The answer made it clear that you need to list all the components for the sms app in order to be able to set it as the default application in android's settings. But I can't find any reference for the phone call components.
How can I achieve this?
For reference this is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mynumbers">
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<uses-permission android:name="android.permission.ANSWER_PHONE_CALLS"/>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="">
<activity
android:name=".MainActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.DIAL" />
<action android:name="android.intent.action.CALL_BUTTON" />
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="tel"/>
</intent-filter>
</activity>
<activity
android:name=".NumberManagementActivity"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity
android:name=".CallActivity"
android:parentActivityName=".MainDialerActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainDialerActivity" />
<intent-filter>
<action android:name="android.permission.CALL_PHONE" />
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</activity>
<activity
android:name=".MainDialerActivity"
android:parentActivityName=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<action android:name="android.intent.action.CALL_BUTTON"/>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<action android:name="android.permission.CALL_PHONE"/>
<data android:scheme="tel"/>
</intent-filter>
</activity>
<receiver
android:name=".PhoneCallListener">
<intent-filter android:priority="1">
<action android:name="android.intent.action.PHONE_STATE" />
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
<!-- Incoming call activity -->
<activity
android:name=".IncomingCallActivity"
android:configChanges="orientation"
android:label="@string/title_activity_fullscreen"
android:theme="@style/IncomingCallTheme">
<intent-filter>
<action android:name="android.intent.action.ANSWER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".DefaultConfigurationActivity"
android:parentActivityName=".MainActivity">
</activity>
</application>
</manifest>