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

Commit dfa685c6 authored by Neil Fuller's avatar Neil Fuller
Browse files

Update settings for Date / Time / Zone

Update SettingsProtoDumpUtil / secure.proto to reference the new (user
scoped) location_time_zone_detection_enabled setting that has been added
for S.  This has been added in a "DateTime" message to reflect the
SettingsUI structure.

For consistency with secure.proto and the settings strings, global.proto
and the associated SettingsProtoDumpUtil code has updated to rename the
"Auto.time" and "Auto.time_zone" proto fields to "DateTime.auto_time"
and "DateTime.auto_time_zone". This is a binary compatible change as
the field IDs have not been changed.

Note: The "time_12_24" and "date_format" settings, which are user-scoped
settings from "Settings.System" have been left for a future release
besides some minor docs improvements. See bug 185884644.

This change also improve the docs for settings that are associated with
date and time.

Bug: 151304765
Bug: 185884644
Test: build / treehugger
Change-Id: If2daf3f530bd1add7a0a5cc3260221ea3ad8952d
parent 650a27bf
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -4658,9 +4658,12 @@ public final class Settings {
        public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
        /**
         * Display times as 12 or 24 hours
         *   12
         *   24
         * Display the user's times, e.g. in the status bar, as 12 or 24 hours.
         * <ul>
         *    <li>24 = 24 hour</li>
         *    <li>12 = 12 hour</li>
         *    <li>[unset] = use the device locale's default</li>
         * </ul>
         */
        @Readable
        public static final String TIME_12_24 = "time_12_24";
@@ -10227,15 +10230,16 @@ public final class Settings {
        public static final int WIFI_SLEEP_POLICY_NEVER = 2;
        /**
         * Value to specify if the user prefers the date, time and time zone
         * to be automatically fetched from the network (NITZ). 1=yes, 0=no
         * Value to specify if the device's UTC system clock should be set automatically, e.g. using
         * telephony signals like NITZ, or other sources like GNSS or NTP. 1=yes, 0=no (manual)
         */
        @Readable
        public static final String AUTO_TIME = "auto_time";
        /**
         * Value to specify if the user prefers the time zone
         * to be automatically fetched from the network (NITZ). 1=yes, 0=no
         * Value to specify if the device's time zone system property should be set automatically,
         * e.g. using telephony signals like MCC and NITZ, or other mechanisms like the location.
         * 1=yes, 0=no (manual).
         */
        @Readable
        public static final String AUTO_TIME_ZONE = "auto_time_zone";
+8 −8
Original line number Diff line number Diff line
@@ -89,14 +89,6 @@ message GlobalSettingsProto {
    optional SettingProto assisted_gps_enabled = 14 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto audio_safe_volume_state = 15 [ (android.privacy).dest = DEST_AUTOMATIC ];

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

        optional SettingProto time = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto time_zone = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional Auto auto = 16;

    reserved 17; // Used to be autofill_compat_mode_allowed_packages

    message Autofill {
@@ -253,6 +245,14 @@ message GlobalSettingsProto {
    }
    optional Database database = 36;

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

        optional SettingProto auto_time = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto auto_time_zone = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional DateTime date_time = 16;

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

+8 −1
Original line number Diff line number Diff line
@@ -217,6 +217,13 @@ message SecureSettingsProto {
    optional SettingProto display_density_forced = 19 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto double_tap_to_wake = 20 [ (android.privacy).dest = DEST_AUTOMATIC ];

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

        optional SettingProto location_time_zone_detection_enabled = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional DateTime date_time = 90;

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

@@ -656,5 +663,5 @@ message SecureSettingsProto {

    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // Next tag = 90;
    // Next tag = 91;
}
+15 −9
Original line number Diff line number Diff line
@@ -242,15 +242,6 @@ class SettingsProtoDumpUtil {
                Settings.Global.AUDIO_SAFE_VOLUME_STATE,
                GlobalSettingsProto.AUDIO_SAFE_VOLUME_STATE);

        final long autoToken = p.start(GlobalSettingsProto.AUTO);
        dumpSetting(s, p,
                Settings.Global.AUTO_TIME,
                GlobalSettingsProto.Auto.TIME);
        dumpSetting(s, p,
                Settings.Global.AUTO_TIME_ZONE,
                GlobalSettingsProto.Auto.TIME_ZONE);
        p.end(autoToken);

        final long autofillToken = p.start(GlobalSettingsProto.AUTOFILL);
        dumpSetting(s, p,
                Settings.Global.AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES,
@@ -509,6 +500,15 @@ class SettingsProtoDumpUtil {
                GlobalSettingsProto.Database.CREATION_BUILDID);
        p.end(databaseToken);

        final long dateTimeToken = p.start(GlobalSettingsProto.DATE_TIME);
        dumpSetting(s, p,
                Settings.Global.AUTO_TIME,
                GlobalSettingsProto.DateTime.AUTO_TIME);
        dumpSetting(s, p,
                Settings.Global.AUTO_TIME_ZONE,
                GlobalSettingsProto.DateTime.AUTO_TIME_ZONE);
        p.end(dateTimeToken);

        final long debugToken = p.start(GlobalSettingsProto.DEBUG);
        dumpSetting(s, p,
                Settings.Global.DEBUG_APP,
@@ -2022,6 +2022,12 @@ class SettingsProtoDumpUtil {
                SecureSettingsProto.Controls.ENABLED);
        p.end(controlsToken);

        final long dateTimeToken = p.start(SecureSettingsProto.DATE_TIME);
        dumpSetting(s, p,
                Settings.Secure.LOCATION_TIME_ZONE_DETECTION_ENABLED,
                SecureSettingsProto.DateTime.LOCATION_TIME_ZONE_DETECTION_ENABLED);
        p.end(dateTimeToken);

        dumpSetting(s, p,
                Settings.Secure.DEVICE_PAIRED,
                SecureSettingsProto.DEVICE_PAIRED);