I am programming an application that automatically answers a call. The problem is that he should not answer if I am already calling and someone is calling. Is there any way to achieve this?
According to the document, if I check the status with TelephonyManager
, it will be CALL_STATE_RINGING
, not CALL_STATE_OFFTHEHOOK
.
Do I need to add a variable that is set in the changing state of the phone, so I know that there is an ongoing call or is there a better solution?
Thanks!
/ edit: I answer the call without the permission of Modify_Phone_State
, so it only finds out that there is already a call.
Force source share