3

Does anyone has an experience how to implement InCallService to show my custom Activity during a call instead of default dialer in Android 8.0? I know that the Google added a permission in API 26: ANSWER_PHONE_CALLS. I saw the default Dialer in the Google Source git repository, but there are a lot of stuff to be implemented. I just want a simple call app.

https://developer.android.com/guide/topics/connectivity/telecom/index.html#replacePhoneApp

Here is a part of my Manifest file:

<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ANSWER_PHONE_CALLS" />

    <service
        android:name=".InCallServiceImpl"
        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>

And class InCallServiceImpl:

public class InCallServiceImpl extends InCallService {

//Intent intent = new Intent(getApplicationContext(), inCallUI.class);

@Override
public IBinder onBind(Intent intent) {
    final Context context = getApplicationContext();
    return super.onBind(intent);
} }

That's all what I have!

Example: https://imgur.com/a/Z8wUu

Did anyone manage it? Thanks.

Phantômaxx
  • 37,352
  • 21
  • 80
  • 110
vsemeruk
  • 39
  • 2
  • 9

0 Answers0