2

The self-managed PhoneAccount is being registered like this:

PhoneAccount phoneAccount = PhoneAccount.builder(phoneAccountHandle, name)
                .addSupportedUriScheme(CUSTOM_URI_SCHEME)
                .setCapabilities(
                        PhoneAccount.CAPABILITY_SELF_MANAGED |
                        PhoneAccount.CAPABILITY_VIDEO_CALLING |
                        PhoneAccount.CAPABILITY_SUPPORTS_VIDEO_CALLING)
                .setShortDescription(name)
                .build();
telecomManager.registerPhoneAccount(phoneAccount);

When using .placeCall():

Bundle extra = new Bundle();
extra.putParcelable(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandle);
telecomManager.placeCall(Uri.parse(CUSTOM_URI_SCHEME + ":" + "[call address] param"), extra);

The ConnectionService is not triggered, and below alert message popup:

Call not sent, no valid number entered.


Additionally, I've tested not using custom URI, using "tel:" scheme, found the phone must have SIM card, in order to trigger the ConnectionService, this behaviour is not the same as document as self-managed, anyone encountered and able to resolve either the above scenarios?

Amos
  • 2,222
  • 1
  • 26
  • 42
  • You can use VoIP instead of Tel, Tel won't work without a registered Network connection ( Sim Card) This article may solve your issue: https://developer.android.com/guide/topics/connectivity/telecom#integrateCalling – puspak saha Dec 23 '20 at 12:12
  • Thanks for your suggestion, that article is what I'm using, which indeed using the telecom framework. – Amos Dec 24 '20 at 12:05
  • This problems seems to be API dependent: it works in API 31, fails in API 29 and below (with different error messages) which suggests it's an Android bug. – Gene S Jan 07 '23 at 03:59

0 Answers0