Goal. On the Android platform, determine the phone number of the person with whom the user is currently talking.
Currently, using PhoneListener, there is a certain ambiguity in case of holding calls.
Case: A user is talking to someone during a conversation ("Call 1"). Thus, the user is in an OFFHOOK call state. Then the user is in the RINGING state, indicating an incoming phone call ("Call 2"). Then the state goes into OFFHOOK position. This may indicate one of two possibilities: either the user answered call 2, or moved call 1 on hold. Alternatively, the user rejects call 2 and returns to call 1.
How can two cases be distinguished? Can I determine the CURRENT CALL phone number on the phone?
source share