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://i.stack.imgur.com/4ofYg.jpg

Did anyone manage it? Thanks.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
willford
  • 39
  • 2
  • 9
  • 1
    There's are two related questions that I answered: https://stackoverflow.com/a/49835987/1916449 https://stackoverflow.com/a/49856583/1916449 including a link to working sample – arekolek May 16 '18 at 22:10
  • @vsemeruk did you find working solution? – Giru Bhai Aug 10 '19 at 04:50
  • 1
    @GiruBhai I believe this guy made everything for us https://github.com/Abror96/CustomPhoneDialer – willford Aug 15 '19 at 10:54

0 Answers0