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

Commit a2e45b35 authored by Neil Fuller's avatar Neil Fuller Committed by Automerger Merge Worker
Browse files

Merge "Add a setting to support for NITZ retention" am: bff4c1b4 am: 696e4a71

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1876199

Change-Id: I4267e69090b0018aa8076768da3801605ceb3b35
parents 41680d52 696e4a71
Loading
Loading
Loading
Loading
+25 −9
Original line number Diff line number Diff line
@@ -11233,22 +11233,38 @@ public final class Settings {
                "night_display_forced_auto_mode_available";
        /**
        * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
        * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
        * exceeded.
         * If UTC time between two NITZ signals is greater than this value then the second signal
         * cannot be ignored.
         *
         * <p>This value is in milliseconds. It is used for telephony-based time and time zone
         * detection.
         * @hide
         */
        @Readable
        public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
        /**
        * The length of time in milli-seconds that automatic small adjustments to
        * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
         * If the elapsed realtime between two NITZ signals is greater than this value then the
         * second signal cannot be ignored.
         *
         * <p>This value is in milliseconds. It is used for telephony-based time and time zone
         * detection.
         * @hide
         */
        @Readable
        public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
        /**
         * If the device connects to a telephony network and was disconnected from a telephony
         * network for less than this time, a previously received NITZ signal can be restored.
         *
         * <p>This value is in milliseconds. It is used for telephony-based time and time zone
         * detection.
         * @hide
         */
        public static final String NITZ_NETWORK_DISCONNECT_RETENTION =
                "nitz_network_disconnect_retention";
        /** Preferred NTP server. {@hide} */
        @Readable
        public static final String NTP_SERVER = "ntp_server";
+25 −12
Original line number Diff line number Diff line
@@ -672,18 +672,31 @@ message GlobalSettingsProto {
    optional SettingProto new_contact_aggregator = 79 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto night_display_forced_auto_mode_available = 80 [ (android.privacy).dest = DEST_AUTOMATIC ];

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

        // If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment to
        // SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
        // exceeded.
        optional SettingProto diff = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
        // The length of time in milli-seconds that automatic small adjustments to
        // SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
        optional SettingProto spacing = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional NitzUpdate nitz_update = 81;
    message Nitz {
        option (android.msg_privacy).dest = DEST_EXPLICIT;

        // If UTC time between two NITZ signals is greater than this value then the second signal
        // cannot be ignored.
        //
        // This value is in milliseconds. It is used for telephony-based time and time zone
        // detection.
        optional SettingProto update_diff = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];

        // If the elapsed realtime between two NITZ signals is greater than this value then the
        // second signal cannot be ignored.
        //
        // This value is in milliseconds. It is used for telephony-based time and time zone
        // detection.
        optional SettingProto update_spacing = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];

        // If the device connects to a telephony network and was disconnected from a telephony
        // network for less than this time, a previously received NITZ signal can be restored.
        //
        // This value is in milliseconds. It is used for telephony-based time and time zone
        // detection.
        optional SettingProto network_disconnect_retention = 3 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional Nitz nitz = 81;

    message Notification {
        option (android.msg_privacy).dest = DEST_EXPLICIT;
+7 −4
Original line number Diff line number Diff line
@@ -1082,14 +1082,17 @@ class SettingsProtoDumpUtil {
                Settings.Global.NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE,
                GlobalSettingsProto.NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE);

        final long nitzUpdateToken = p.start(GlobalSettingsProto.NITZ_UPDATE);
        final long nitzToken = p.start(GlobalSettingsProto.NITZ);
        dumpSetting(s, p,
                Settings.Global.NITZ_UPDATE_DIFF,
                GlobalSettingsProto.NitzUpdate.DIFF);
                GlobalSettingsProto.Nitz.UPDATE_DIFF);
        dumpSetting(s, p,
                Settings.Global.NITZ_UPDATE_SPACING,
                GlobalSettingsProto.NitzUpdate.SPACING);
        p.end(nitzUpdateToken);
                GlobalSettingsProto.Nitz.UPDATE_SPACING);
        dumpSetting(s, p,
                Settings.Global.NITZ_NETWORK_DISCONNECT_RETENTION,
                GlobalSettingsProto.Nitz.NETWORK_DISCONNECT_RETENTION);
        p.end(nitzToken);

        final long notificationToken = p.start(GlobalSettingsProto.NOTIFICATION);
        dumpSetting(s, p,
+1 −0
Original line number Diff line number Diff line
@@ -388,6 +388,7 @@ public class SettingsBackupTest {
                    Settings.Global.NETWORK_WATCHLIST_ENABLED,
                    Settings.Global.NEW_CONTACT_AGGREGATOR,
                    Settings.Global.NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE,
                    Settings.Global.NITZ_NETWORK_DISCONNECT_RETENTION,
                    Settings.Global.NITZ_UPDATE_DIFF,
                    Settings.Global.NITZ_UPDATE_SPACING,
                    Settings.Global.NOTIFICATION_SNOOZE_OPTIONS,