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

Commit 639c8bec authored by Michael Wright's avatar Michael Wright
Browse files

Extract automatic brightness strategy

Pull the strategy for determining the automatic brightness levels
into its own class. This cleans up DisplayPowerController a bit and
lets us experiment with different automatic brightness strategies
more easily.

Change-Id: I8f4249da511e38f63260dbef81f97f5507aac948
parent 41a5cdf9
Loading
Loading
Loading
Loading
+687 −0

File added.

Preview size limit exceeded, changes collapsed.

+70 −683

File changed.

Preview size limit exceeded, changes collapsed.

+9 −0
Original line number Diff line number Diff line
@@ -114,4 +114,13 @@ final class DisplayPowerRequest {
                + ", useAutoBrightness=" + useAutoBrightness
                + ", blockScreenOn=" + blockScreenOn;
    }

    public static boolean wantScreenOn(int state) {
        switch(state) {
            case SCREEN_STATE_DIM:
            case SCREEN_STATE_BRIGHT:
                return true;
        }
        return false;
    }
}