1. Download our Official Android App: Forums for Android!

Apps How to replace native ConnectionService?

Discussion in 'Android Development' started by Halvisch, Apr 13, 2016.

  1. Halvisch

    Halvisch Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Apr 13, 2016

    Apr 13, 2016
    1
    0
    5
    Male
    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.
     

    Advertisement

Share This Page

Loading...