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

Commit a3dab235 authored by Michael Wright's avatar Michael Wright
Browse files

Add DisplayModeDirector to determine set of allowed modes.

SurfaceFlinger now knows how to automatically schedule between various
display modes, so we need to tell it what modes are available to switch
between based on overall system state as well as display specific
properties. To capture all of this system state we've introduced
DisplayModeDirector which monitors all of the various inputs for
deciding display mode and notifies the rest of the display
infrastructure when they change.

Bug: 123727652
Test: manual
Change-Id: I83184664bf63c99ebd31889764720bb55c2e15a8
parent 47c4d9d6
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3313,6 +3313,17 @@ public final class Settings {
                        ColorDisplayManager.COLOR_MODE_NATURAL,
                        ColorDisplayManager.COLOR_MODE_AUTOMATIC);
        /**
         * The user selected peak refresh rate in frames per second.
         *
         * If this isn't set, the system falls back to a device specific default.
         * @hide
         */
        public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
        private static final Validator PEAK_REFRESH_RATE_VALIDATOR =
                new SettingsValidators.InclusiveFloatRangeValidator(24f, Float.MAX_VALUE);
        /**
         * The amount of time in milliseconds before the device goes to sleep or begins
         * to dream after a period of inactivity.  This value is also known as the
+3 −0
Original line number Diff line number Diff line
@@ -3951,4 +3951,7 @@
     and a second time clipped to the fill level to indicate charge -->
    <bool name="config_batterymeterDualTone">false</bool>

    <!-- The default peak refresh rate for a given device. Change this value if you want to allow
         for higher refresh rates to be automatically used out of the box -->
    <integer name="config_defaultPeakRefreshRate">60</integer>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -3688,4 +3688,6 @@
  <java-symbol type="string" name="mime_type_spreadsheet_ext" />
  <java-symbol type="string" name="mime_type_presentation" />
  <java-symbol type="string" name="mime_type_presentation_ext" />

  <java-symbol type="integer" name="config_defaultPeakRefreshRate" />
</resources>
+2 −1
Original line number Diff line number Diff line
@@ -92,7 +92,8 @@ public class SettingsBackupTest {
                    Settings.System.VOLUME_SYSTEM, // deprecated since API 2?
                    Settings.System.VOLUME_VOICE, // deprecated since API 2?
                    Settings.System.WHEN_TO_MAKE_WIFI_CALLS, // bug?
                    Settings.System.WINDOW_ORIENTATION_LISTENER_LOG // used for debugging only
                    Settings.System.WINDOW_ORIENTATION_LISTENER_LOG, // used for debugging only
                    Settings.System.PEAK_REFRESH_RATE // depends on hardware capabilities
                    );

    private static final Set<String> BACKUP_BLACKLISTED_GLOBAL_SETTINGS =
+12 −2
Original line number Diff line number Diff line
@@ -138,9 +138,19 @@ abstract class DisplayDevice {
    }

    /**
     * Sets the mode, if supported.
     * Sets the display modes the system is allowed to switch between, roughly ordered by
     * preference.
     *
     * Not all display devices will automatically switch between modes, so it's important that the
     * most-desired modes are at the beginning of the allowed array.
     */
    public void setAllowedDisplayModesLocked(int[] modes) {
    }

    /**
     * Sets the requested color mode.
     */
    public void requestDisplayModesLocked(int colorMode, int modeId) {
    public void setRequestedColorModeLocked(int colorMode) {
    }

    public void onOverlayChangedLocked() {
Loading