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

Commit e4159f4b authored by Karthik Ravi Shankar's avatar Karthik Ravi Shankar Committed by android-build-merger
Browse files

Merge "Fix race condition when entering low persistence mode" into oc-mr1-dev

am: d947ff60

Change-Id: I821158f29b35e960e8c73c4ca3d14ab3b9c1db66
parents cc14e2bf d947ff60
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -473,17 +473,18 @@ final class LocalDisplayAdapter extends DisplayAdapter {
                        }

                        // If the state change was from or to VR, then we need to tell the light
                        // so that it can apply appropriate VR brightness settings. This should
                        // happen prior to changing the brightness but also if there is no
                        // brightness change at all.
                        // so that it can apply appropriate VR brightness settings. Also, update the
                        // brightness so the state is propogated to light.
                        boolean vrModeChange = false;
                        if ((state == Display.STATE_VR || currentState == Display.STATE_VR) &&
                                currentState != state) {
                            setVrMode(state == Display.STATE_VR);
                            vrModeChange = true;
                        }


                        // Apply brightness changes given that we are in a non-suspended state.
                        if (brightnessChanged) {
                        if (brightnessChanged || vrModeChange) {
                            setDisplayBrightness(brightness);
                        }