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

Commit d947ff60 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents eb7aba16 66855315
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);
                        }