End current call and accept a new incoming call established a silent call

Viewed 551

I have a rooted phone and i want to implement a scenario that if phone is already busy in regular phone call and new incoming call arrive, my program hangup current call and accept this new call programmatically. I find out adb commands which working fine to accept and reject call but when i execute these commands simultaneously to implement above scenario(drop current call and accept new incoming call), i get into a situation where new incoming call established but have no sound both in callee and receiver side. Here are these adb commands:

Drop Call: input keyevent KEYCODE_ENDCALL
Accept Call: input keyevent KEYCODE_CALL

I also tried to add some delay b/w these calls by Thread.sleep(3000) but it seems to be not working. In phone log i have seen a error when new call accept, here is an error:

06-20 12:42:27.728 1105-2856/system_process E/JavaBinder: *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
                                                      java.util.NoSuchElementException: Death link does not exist
                                                          at android.os.BinderProxy.unlinkToDeath(Native Method)
                                                          at com.android.server.audio.AudioService.setModeInt(AudioService.java:2547)
                                                          at com.android.server.audio.AudioService.setMode(AudioService.java:2518)
                                                          at android.media.IAudioService$Stub.onTransact(IAudioService.java:279)
                                                          at android.os.Binder.execTransact(Binder.java:697)

Can anyone explain this reason and any feedback to solve this issue.

0 Answers
Related