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

Commit 57292a0c authored by Santos Cordon's avatar Santos Cordon
Browse files

Add Setting to backup display resolution mode

Setting is set by DM when resolution changes.
Upon restoring the setting via backup, DisplayManager
will attempt to switch to the appropriate resolution.

Bug: 321821289
Test: atest DisplayManagerServiceTest
Change-Id: I245c9e92b52532a229199842bb21d1071d2486af
parent 96808aa1
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -11184,6 +11184,32 @@ public final class Settings {
        @Readable
        public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
        /**
         * Used by DisplayManager to backup/restore the user-selected resolution mode.
         * @hide
         */
        @Readable
        public static final String SCREEN_RESOLUTION_MODE = "screen_resolution_mode";
        /**
         * Resolution Mode Constants for SCREEN_RESOLUTION_MODE setting.
         *
         * @hide
         */
        @IntDef(prefix = { "RESOLUTION_MODE_" }, value = {
                RESOLUTION_MODE_UNKNOWN,
                RESOLUTION_MODE_HIGH,
                RESOLUTION_MODE_FULL
        })
        @Retention(RetentionPolicy.SOURCE)
        public @interface ResolutionMode {}
        /** @hide */
        public static final int RESOLUTION_MODE_UNKNOWN = 0;
        /** @hide */
        public static final int RESOLUTION_MODE_HIGH = 1;
        /** @hide */
        public static final int RESOLUTION_MODE_FULL = 2;
        /**
         * Names of the service components that the current user has explicitly allowed to
         * be a VR mode listener, separated by ':'.
+6 −1
Original line number Diff line number Diff line
@@ -249,6 +249,11 @@ message SecureSettingsProto {
    }
    optional DateTime date_time = 90;

    message Display {
        optional SettingProto screen_resolution_mode = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional Display display = 100;

    message Doze {
        option (android.msg_privacy).dest = DEST_EXPLICIT;

@@ -727,5 +732,5 @@ message SecureSettingsProto {

    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // Next tag = 100;
    // Next tag = 101;
}
+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ public class SecureSettings {
        Settings.Secure.VISUAL_QUERY_ACCESSIBILITY_DETECTION_ENABLED,
        Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS,
        Settings.Secure.AUDIO_DEVICE_INVENTORY,
        Settings.Secure.SCREEN_RESOLUTION_MODE,
        Settings.Secure.ACCESSIBILITY_FLOATING_MENU_TARGETS
    };
}
+2 −0
Original line number Diff line number Diff line
@@ -427,5 +427,7 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.CAMERA_EXTENSIONS_FALLBACK, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.IMMERSIVE_MODE_CONFIRMATIONS, ANY_STRING_VALIDATOR);
        VALIDATORS.put(Secure.AUDIO_DEVICE_INVENTORY, ANY_STRING_VALIDATOR);
        VALIDATORS.put(Secure.SCREEN_RESOLUTION_MODE, new InclusiveIntegerRangeValidator(
                Secure.RESOLUTION_MODE_UNKNOWN, Secure.RESOLUTION_MODE_FULL));
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ public class SettingsHelper {
        sBroadcastOnRestore.add(Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED);
        sBroadcastOnRestore.add(Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS);
        sBroadcastOnRestore.add(Settings.Secure.ACCESSIBILITY_QS_TARGETS);
        sBroadcastOnRestore.add(Settings.Secure.SCREEN_RESOLUTION_MODE);
        sBroadcastOnRestoreSystemUI = new ArraySet<String>(2);
        sBroadcastOnRestoreSystemUI.add(Settings.Secure.QS_TILES);
        sBroadcastOnRestoreSystemUI.add(Settings.Secure.QS_AUTO_ADDED_TILES);
Loading