Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 905a8d5f authored by Piotr Wilczyński's avatar Piotr Wilczyński
Browse files

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
parent 8432dbc4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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