• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to replace native ConnectionService?

Halvisch

Lurker
I've been trying for two days now, to replace the native ConnectionSerivce, with no success. Here's what I've done, as stated in the documentation.

  • I've created a class which extends ConnectionService.

  • I've registered my implementation in the AndroidManifest.xml:
    <service android:name="se.example.myapplication.MyConnectionService"
    android:label="@String/MyConnectionService"
    android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE">
    <intent-filter>
    <action android:name="android.telecom.ConnectionService" />
    </intent-filter>
    </service>
  • I've registered a new PhoneAccount:
    ComponentName componentName = new ComponentName("se.example.myapplication", "se.example.myapplication.MyConnectionService");
    PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(componentName, "1234");
    PhoneAccount phoneAccount = PhoneAccount.builder(phoneAccountHandle, "Adminn").build();
    telecomManager.registerPhoneAccount(phoneAccount);
The telecom still won't bind to my ConnectionService once I place a call. Does anyone have any ideas, please?
Thanks.
 
Back
Top Bottom