Fix incorrect proximity sensor behaviour
* screen must be ON when audioroute != EARPICE
Signed-off-by: DennySPB <dennyspb@gmail.com>
Change-Id: I8d9a159400d81df37edb560ac8585881598cafb2
diff --git a/java/com/android/incallui/ProximitySensor.java b/java/com/android/incallui/ProximitySensor.java
index c5948c2..e8e782c 100644
--- a/java/com/android/incallui/ProximitySensor.java
+++ b/java/com/android/incallui/ProximitySensor.java
@@ -198,6 +198,7 @@
}
if (hasOngoingCall && InCallState.OUTGOING == oldState) {
setProxSpeaker(isProxSensorFar);
+ updateProximitySensorMode();
}
if (hasIncomingCall) {
updateProxRing();
@@ -353,7 +354,7 @@
uiShowing,
CallAudioState.audioRouteToString(audioRoute));
- if (isPhoneOffhook || hasIncomingCall && !screenOnImmediately) {
+ if ((isPhoneOffhook || hasIncomingCall) && !screenOnImmediately) {
LogUtil.v("ProximitySensor.updateProximitySensorMode", "turning on proximity sensor");
// Phone is in use! Arrange for the screen to turn off
// automatically when the sensor detects a close object.