I have an application that puts a phone call, and then switches back to my activity during a phone call. The problem is that if the user puts his hand near the proximity sensor, the screen turns off. Is there a way to disconnect the proximity sensor from turning off the phone when making a phone call?
I tried using PROXIMITY_SCREEN_OFF_WAKE_LOCKand FULL_WAKE_LOCK; I tried using Window flags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); and I tried to use myView.setKeepScreenOn(true). All have not yet succeeded.
In addition, I have a listener for ACTION_SCREEN_OFFand ACTION_SCREEN_ON, therefore, if the user for some reason presses the power button, he ends the call.
Chris source
share