I am creating an application that is to replace an application for handling telephone calls. I have implemented InCallService, I register Call.Callback in the onCallAdded event. After making an outgoing call using the telecomManager.placeCall(uri, extras) method, when the other party rejects the call, on my end the call is not ended immediately, but a message sent by the operator is heard on the phone stating that the number I want to call is busy and only after the message ends the connection is terminated and until then no event is triggered in the application. There is no such thing in the built-in application, the conversation is ended immediately. Is there any way to detect that the other party rejected the call?
I tried to implement ConnectionService with the idea that it would detect a rejected connection in one of the events of the Connection object, but without success, when trying to make a connection, the application ended with an exception about the lack of permission android.permission.BIND_TELECOM_CONNECTION_SERVICE. Similarly with PhoneStateListener.LISTEN_CALL_DISCONNECT_CAUSES, permission missing android.permission.READ_PRECISE_PHONE_STATE.
Slavva is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.