From one year, I have been working over IOT product and the application attached was working fine. Now I am not able to accept call programmatically in higher versions of android. Feature is very important to product. Any help is highly appreciated.
Before security patch update November 2016, Runtime.getRunTime.exec("Command") was working fine to accept call programmatically.
Runtime.getRuntime().exec("input keyevent " +Integer.toString(KeyEvent.KEYCODE_HEADSETHOOK));
How to make it possible in Nougat version of android.
Looking for any sort of hack.
I have opened a thread for the enhancements.
Note* If any one of you is facing same issue, then please request to Android Dev Team to get in it and provide provision to get run-time permission by user. Follow above mention URL to request.
It is sort of hack, you can use accessibility service to receive call. To enable accessibility service, you must enable your service on Setting - Accessibility - Your service.
First, add typeWindowContentChanged to accessibilityEventTypes.
And do something with event or "displayed text" or "contents description".
Yes, I know this is not a graceful way to solve your problem. It is a kind of hack.