I dropped my phone and looks like my proximity sensor no longer works reliably. It returns Near all the time. The problem is, the display turns off during call and I wont be able to use the number pad to enter pin or conference another call, or even disconnect the call. I found the Power button disconnect option in Accessibility settings and uses that now.
I tried to create an app that tries to obtain a full wakelock when a call is received hoping that it will keep the display on.
Created a broadcast receiver that invokes a service when the phone state changes to OFFHOOK
The service acquires a full wakelock and releases it only when phone state is IDLE.
But still, proximity sensor turns the display off. I used the isHeld() method to make sure that the lock is acquired. I used PowerManager's isScreenOn() method and it returned true even when the screen was off during the call. I tried to obtain the wakelocks every two second in a loop for testing, still the display won't come up.
I'm using a Nexus 5 Android version 4.4.4
Can anyone suggest an idea to override the proximity sensor behaviour? A root-required option is also fine.
Thanks!
ACQUIRE_CAUSES_WAKEUP
flag set in your wakelock? It may be so that the screen goes dark before the wakeup is acquired. As per documentation, it says that acquiring the wakelock after screen off does not turn the screen on (it merely keeps it on if it was already on) unless that flag is set. – Lacework