diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 2616a6676db11..03e6d389d95fa 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -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.
+ *
+ * - 24 = 24 hour
+ * - 12 = 12 hour
+ * - [unset] = use the device locale's default
+ *
*/
@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";
diff --git a/core/proto/android/providers/settings/global.proto b/core/proto/android/providers/settings/global.proto
index ad1d25208a9a6..8ee0e397191c2 100644
--- a/core/proto/android/providers/settings/global.proto
+++ b/core/proto/android/providers/settings/global.proto
@@ -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;
diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto
index 530cb44d3aae8..ae6dcfdc2817b 100644
--- a/core/proto/android/providers/settings/secure.proto
+++ b/core/proto/android/providers/settings/secure.proto
@@ -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;
}
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index 4119dc9f22063..de6969d38c685 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -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);