5

My Query is, I want to get notified if the receiver at the other side picks my call when I am making an outgoing call. Is it possible with the Android SDK.

The onCallStateChanged Function is called only when the Person dial a number(OFFHOOK), from his phone and When the call reciever person disconnects the call(IDLE), but there is no State parameter to knowthat, does the other end person has recieved the call?

public class MyPhoneStateListener extends PhoneStateListener{

    public void onCallStateChanged(int state,String incomingNumber){
        Log.d("Checking---->",TelephonyManager.ACTION_PHONE_STATE_CHANGED);
    }
}

Logcat give only the following information when call recieved at the other side:

01-19 19:33:30.633: DEBUG/CallNotifier(638): stopRing()... (OFFHOOK state)
01-19 19:33:30.662: DEBUG/Ringer(638): stopRing()...
01-19 19:33:30.694: DEBUG/Ringer(638): - stopRing: null mRingHandler!
01-19 19:33:31.256: DEBUG/PhoneApp(638): updateWakeState: callscreen true, dialer false, speaker false...
01-19 19:33:31.287: DEBUG/PhoneApp(638): updateWakeState: keepScreenOn = false (isRinging false, showingDisc false)
B770
  • 1,272
  • 3
  • 17
  • 34
Vinayak Bevinakatti
  • 40,205
  • 25
  • 108
  • 139

1 Answers1

1

I'm having the same problem. I use PhoneStateListener for incoming calls, it works well. But for outgoing calls I was only able to register a BroadcastReceiver to the intent android.intent.action.NEW_OUTGOING_CALL.

In my knowledge there is no way to determine weather the other side has picked up, or not. However you can use CallLog to retrieve call information offline. Detailed call state events are only available through the internal class com.android.internal.telephony.Phone which you won't have access to unless you compile your own Andoid.

Andras Balázs Lajtha
  • 2,576
  • 25
  • 32
  • 2
    This doesn't make sense. The manufacturer knows when the call is connected. If it is available to them, it is available to you. – o_O Aug 21 '12 at 19:14
  • 2
    @RKS Yes this makes sense. Outgoing call state goes from `CALL_STATE_IDLE` to `CALL_STATE_OFFHOOK` immediately after the dialer made the call, even though the partner does not pick up their phone yet. –  Nov 13 '12 at 10:37