Helper class to simulate incoming and outgoing calls. It is also able to change current call's state. Simulated calls can be created after registering a debug phone account in the system.
Note that the helper classes (DebugConnectionServiceHolder, DebugConnectionService, DebugTelecomHelperEvents) have to be part of com.tomtom.ivi.platform.telecom.api.common.debug package. Otherwise a SecurityException is thrown due to this restriction when registering the phone account: https://developer.android.com/reference/kotlin/android/telecom/TelecomManager#registerphoneaccount
Also the package name has to be part of the same app UID, otherwise the SecurityException is raised: SecurityException: Package com.example.mydigitalcockpitapp.integration.test.product does not belong to 10171 (UID of com.example.mydigitalcockpitapp).
So those helpers cannot be moved as part of the tooling package and the testing app. Also this will be used by the Telecom Debug panel, and it makes sens to keep this part of the com.tomtom.ivi.platform.telecom.api.common.debug package.
Updates a call state.
Creates an incoming call using the debugPhoneAccount.
Creates an outgoing call using the debugPhoneAccount.
Returns a call state for the given phoneNumber. If the call is disconnected, it can be already destroyed and
null can be returned.
Checks if the connection service is ready.
Returns true if the debugPhoneAccount is registered in the system else return false. Require Manifest.permission.READ_PHONE_STATE.
Registers the debug phone account in the system. Needed before calling createIncomingCall or createOutgoingCall.
Unregisters the debug phone account from the system. The recent calls related to the debug phone account will be deleted as well.