My problem is when i have multiple received calls (say 3 of 2 hold and 1 active), i don't get CALL_STATE_IDLE
when the caller disconnect for any of the 2 calls. But get CALL_STATE_IDLE
when last call is disconnected. CALL_STATE_RINGING
& CALL_STATE_OFFHOOK
works fine.
public void onCallStateChanged(int state, String incomingNumber) {
super.onCallStateChanged(state, incomingNumber);
Log.e("MyService", "Switch " + state);
switch (state) {
case TelephonyManager.CALL_STATE_OFFHOOK:
Log.e("MyService", "CALL_STATE_OFFHOOK");
break;
case TelephonyManager.CALL_STATE_RINGING:
Log.e("MyService", "CALL_STATE_RINGING");
break;
case TelephonyManager.CALL_STATE_IDLE:
Log.e("MyService", "CALL_STATE_IDLE");
break;
default:
Log.e("MyService", "default");
break;
}
}
This is not an answer to solve your problem. But, it definitely adds value to the solution
What is CALL_STATE_IDLE ?
Device call state: No activity.
So, we shouldn't expect it to send CALL_STATE_IDLE state when there is an active line. That's why the event CALL_STATE_IDLE is broadcasted only when all the calls are disconnected