summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2018-07-24 14:47:09 -0700
committerRoshan Pius <rpius@google.com>2018-08-01 07:55:46 -0700
commitadb939483217a0970c14f85bdb2bcdd79ca40ecc (patch)
tree33b923a629436106edc2417e146fee02b631c04f /core/java/android
parent97ac6996645ce63ac4f0c06df81407ed98860bcb (diff)
Settings: Add a setting to toggle wifi scan throttling
Scan throttling affects apps which are used by testers for survey-like application. Add a hidden setting which can be toggled via adb commands to turn off all scan throttling. Bug: 111763749 Test: Unit tests Test: `adb shell settings put global wifi_scan_throttle_enabled 0` on user build. Change-Id: I6c9a468c573239914b88de0afcdd7e477429cb16
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/provider/Settings.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index ebd90bdc2414..20c8ab9e8110 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -9755,6 +9755,18 @@ public final class Settings {
"recommended_network_evaluator_cache_expiry_ms";
/**
+ * Whether wifi scan throttle is enabled or not.
+ * This is intended to be used via adb commands or a menu in developer option to turn off
+ * the default wifi scan throttling mechanism for apps.
+ *
+ * Type: int (0 for false, 1 for true)
+ * @hide
+ */
+ public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled";
+
+ private static final Validator WIFI_SCAN_THROTTLE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
+
+ /**
* Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
* connectivity.
* @hide
@@ -12237,6 +12249,7 @@ public final class Settings {
VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
+ VALIDATORS.put(WIFI_SCAN_THROTTLE_ENABLED, WIFI_SCAN_THROTTLE_ENABLED_VALIDATOR);
VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR);
VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR);