I've tried a bunch of alternatives for auto answer incoming call.
1) Tried using Private API's (End call is working answer call doesn't)
2) Using SendOrderedBroadcast and various other methods that are mentioned in this post How can incoming calls be answered programmatically in Android 5.0 (Lollipop)?
If i use private api it is throwing SecurityException (Asking for the MODIFY_DEVICE_STATE permission) and if i use methods in the above post it is showing the below warnings
"Cancelling event due to no window focus: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_HEADSETHOOK, scanCode=0, metaState=0, flags=0x20, repeatCount=0, eventTime=7550277, downTime=7550277, deviceId=-1, source=0x101 }"
Please help me if there is any workaround for this issue, im using Android Version 23.
Thanks in advance..