summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author noshinmir <noshinmir@google.com> 2025-03-07 07:43:12 +0000
committer Mir Noshin Jahan <noshinmir@google.com> 2025-03-07 00:33:20 -0800
commit97e6d306e246298967f8d3c5a5805b273118c5df (patch)
tree333f66bae5ff18038dbac6cddf2f58031521e6b1
parentec6a033432d99fe43965e1d27aeda490300b97ed (diff)
Add a SettingsProvider key for Adaptive wifi scorer and 5G PM switch
Bug: 393645580 Test: compile Flag: com.android.settings.flags.enable_nested_toggle_switches Change-Id: I5d53d909dd800e7412094507f962e6c2416ad475
-rw-r--r--core/java/android/provider/Settings.java16
-rw-r--r--core/proto/android/providers/settings/secure.proto6
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java2
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java2
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java6
5 files changed, 31 insertions, 1 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index da4709b4b8b1..e12412b40110 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -12822,6 +12822,22 @@ public final class Settings {
public static final String ADAPTIVE_CONNECTIVITY_ENABLED = "adaptive_connectivity_enabled";
/**
+ * Whether the Adaptive wifi scorer switch is enabled.
+ *
+ * @hide
+ */
+ public static final String ADAPTIVE_CONNECTIVITY_WIFI_ENABLED =
+ "adaptive_connectivity_wifi_enabled";
+
+ /**
+ * Whether the Adaptive 5G PM switch is enabled.
+ *
+ * @hide
+ */
+ public static final String ADAPTIVE_CONNECTIVITY_MOBILE_NETWORK_ENABLED =
+ "adaptive_connectivity_mobile_network_enabled";
+
+ /**
* Controls the 'Sunlight boost' toggle in wearable devices (high brightness mode).
*
* Valid values for this key are: '0' (disabled) or '1' (enabled).
diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto
index 1caa9e7af348..5831a0bfc39e 100644
--- a/core/proto/android/providers/settings/secure.proto
+++ b/core/proto/android/providers/settings/secure.proto
@@ -239,6 +239,10 @@ message SecureSettingsProto {
repeated SettingProto completed_categories = 15;
optional SettingProto connectivity_release_pending_intent_delay_ms = 16 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto adaptive_connectivity_enabled = 84 [ (android.privacy).dest = DEST_AUTOMATIC ];
+ optional SettingProto adaptive_connectivity_wifi_enabled = 105 [ (android.privacy).dest =
+ DEST_AUTOMATIC ];
+ optional SettingProto adaptive_connectivity_mobile_network_enabled = 106 [ (android.privacy)
+ .dest = DEST_AUTOMATIC ];
message Controls {
option (android.msg_privacy).dest = DEST_EXPLICIT;
@@ -741,5 +745,5 @@ message SecureSettingsProto {
// Please insert fields in alphabetical order and group them into messages
// if possible (to avoid reaching the method limit).
- // Next tag = 105;
+ // Next tag = 107;
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
index a2291123e192..0121d31b9f35 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
@@ -221,6 +221,8 @@ public class SecureSettings {
Settings.Secure.EMERGENCY_GESTURE_ENABLED,
Settings.Secure.EMERGENCY_GESTURE_SOUND_ENABLED,
Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED,
+ Settings.Secure.ADAPTIVE_CONNECTIVITY_WIFI_ENABLED,
+ Settings.Secure.ADAPTIVE_CONNECTIVITY_MOBILE_NETWORK_ENABLED,
Settings.Secure.ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS,
Settings.Secure.ASSIST_HANDLES_LEARNING_EVENT_COUNT,
Settings.Secure.ACCESSIBILITY_BUTTON_MODE,
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
index a4325344709a..5eb6af62d2c3 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
@@ -358,6 +358,8 @@ public class SecureSettingsValidators {
VALIDATORS.put(
Secure.EMERGENCY_GESTURE_UI_LAST_STARTED_MILLIS, NONE_NEGATIVE_LONG_VALIDATOR);
VALIDATORS.put(Secure.ADAPTIVE_CONNECTIVITY_ENABLED, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(Secure.ADAPTIVE_CONNECTIVITY_WIFI_ENABLED, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(Secure.ADAPTIVE_CONNECTIVITY_MOBILE_NETWORK_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(
Secure.ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS, NONE_NEGATIVE_LONG_VALIDATOR);
VALIDATORS.put(Secure.ASSIST_HANDLES_LEARNING_EVENT_COUNT, NON_NEGATIVE_INTEGER_VALIDATOR);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index 57facdaa388c..e7527dcde95c 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -2111,6 +2111,12 @@ class SettingsProtoDumpUtil {
dumpSetting(s, p,
Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED,
SecureSettingsProto.ADAPTIVE_CONNECTIVITY_ENABLED);
+ dumpSetting(s, p,
+ Settings.Secure.ADAPTIVE_CONNECTIVITY_WIFI_ENABLED,
+ SecureSettingsProto.ADAPTIVE_CONNECTIVITY_WIFI_ENABLED);
+ dumpSetting(s, p,
+ Settings.Secure.ADAPTIVE_CONNECTIVITY_MOBILE_NETWORK_ENABLED,
+ SecureSettingsProto.ADAPTIVE_CONNECTIVITY_MOBILE_NETWORK_ENABLED);
final long controlsToken = p.start(SecureSettingsProto.CONTROLS);
dumpSetting(s, p,