From a user perspective, when we make an outgoing call, here are the steps involved:
1. Open dialer app and dial a number (or select a contact directly)
2. The contact's phone starts ringing
3. The contact picks up the call
4. After talking for sometime, the call is hung up
I want to detect steps 2 and 3. I believe an outgoing call is detected by listening to the intent android.intent.action.NEW_OUTGOING_CALL. I also see the phone states - IDLE, OFFHOOK, RINGING. I understand OFFHOOK means a call is in progress (and RINGING is only for incoming calls).
But OFFHOOK can mean either step 2 or 3. How can I detect steps 2 and 3 separately?