From 5f5a0bf00df7d2c6e5ef3ae47293195195b6c84a Mon Sep 17 00:00:00 2001 From: Michael Kwan Date: Fri, 16 Mar 2018 12:25:50 -0700 Subject: [PATCH] Modify time only mode flag into set of values instead of just one. The time only mode flag has not been used yet, so the change should be low impact. Bug: 38259902 Test: m -j32 Change-Id: Ie01870633dbaaf51989a148f105a995f58f0da4e --- core/java/android/provider/Settings.java | 18 +++++++++++++----- core/proto/android/providers/settings.proto | 2 +- .../android/provider/SettingsBackupTest.java | 2 +- .../settings/SettingsProtoDumpUtil.java | 4 ++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index e46a5f05c48d7..70615c8c19159 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -10670,13 +10670,21 @@ public final class Settings { = "wifi_on_when_proxy_disconnected"; /** - * Whether or not to enable Time Only Mode for watch type devices. - * Type: int (0 for false, 1 for true) - * Default: 0 + * Time Only Mode specific settings. + * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" + * + * The following keys are supported: + * + *
+         * enabled                  (boolean)
+         * disable_tilt_to_wake     (boolean)
+         * disable_touch_to_wake    (boolean)
+         * 
+ * Type: string * @hide */ - public static final String TIME_ONLY_MODE_ENABLED - = "time_only_mode_enabled"; + public static final String TIME_ONLY_MODE_CONSTANTS + = "time_only_mode_constants"; /** * Whether or not Network Watchlist feature is enabled. diff --git a/core/proto/android/providers/settings.proto b/core/proto/android/providers/settings.proto index a818e2095ca31..53e6532419a63 100644 --- a/core/proto/android/providers/settings.proto +++ b/core/proto/android/providers/settings.proto @@ -368,7 +368,7 @@ message GlobalSettingsProto { optional SettingProto off_body_radios_off_for_small_battery_enabled = 271 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto off_body_radios_off_delay_ms = 272 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto wifi_on_when_proxy_disconnected = 273 [ (android.privacy).dest = DEST_AUTOMATIC ]; - optional SettingProto time_only_mode_enabled = 274 [ (android.privacy).dest = DEST_AUTOMATIC ]; + optional SettingProto time_only_mode_constants = 274 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto network_watchlist_enabled = 275 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto keep_profile_in_background = 276 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto window_animation_scale = 277 [ (android.privacy).dest = DEST_AUTOMATIC ]; diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java index a08eae94b3f66..04cdb0be2563b 100644 --- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java +++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java @@ -392,7 +392,7 @@ public class SettingsBackupTest { Settings.Global.TETHER_SUPPORTED, Settings.Global.TEXT_CLASSIFIER_CONSTANTS, Settings.Global.THEATER_MODE_ON, - Settings.Global.TIME_ONLY_MODE_ENABLED, + Settings.Global.TIME_ONLY_MODE_CONSTANTS, Settings.Global.TRANSITION_ANIMATION_SCALE, Settings.Global.TRUSTED_SOUND, Settings.Global.TZINFO_UPDATE_CONTENT_URL, diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index 9a438398127d6..c286881d7e897 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -914,8 +914,8 @@ class SettingsProtoDumpUtil { Settings.Global.WIFI_ON_WHEN_PROXY_DISCONNECTED, GlobalSettingsProto.WIFI_ON_WHEN_PROXY_DISCONNECTED); dumpSetting(s, p, - Settings.Global.TIME_ONLY_MODE_ENABLED, - GlobalSettingsProto.TIME_ONLY_MODE_ENABLED); + Settings.Global.TIME_ONLY_MODE_CONSTANTS, + GlobalSettingsProto.TIME_ONLY_MODE_CONSTANTS); dumpSetting(s, p, Settings.Global.NETWORK_WATCHLIST_ENABLED, GlobalSettingsProto.NETWORK_WATCHLIST_ENABLED);