Report negative proximity if we lose the prox sensor

Bug: 265612914
Test: Start a phone call, cover the prox sensor so the screen turns off, perform a state transition so that we no longer have a prox sensor, see that the screen turns back on.
Change-Id: I01e7c8ad2a5dc8fb9e01aa6e9622d2b4dbd812df
Merged-In: I01e7c8ad2a5dc8fb9e01aa6e9622d2b4dbd812df
This commit is contained in:
Piotr Wilczyński
2023-02-17 13:07:07 +00:00
parent 8432dbc437
commit 905a8d5f28

View File

@@ -1358,8 +1358,17 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
sendOnProximityNegativeWithWakelock();
}
} else {
setProximitySensorEnabled(false);
mWaitingForNegativeProximity = false;
mIgnoreProximityUntilChanged = false;
if (mScreenOffBecauseOfProximity) {
// The screen *was* off due to prox being near, but now there's no prox sensor, so
// let's turn the screen back on.
mScreenOffBecauseOfProximity = false;
skipRampBecauseOfProximityChangeToNegative = true;
sendOnProximityNegativeWithWakelock();
}
}
if (!mIsEnabled