Wifi MAC Randomization: Developer option change global settings

Enabling/disabling the connected mac randomization toggle in developer options will change Settings.Global.WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLE, which the wifi framework can look at to decide whether or not to randomized mac addresses. Also added descriptions for the toggle in developer options.

Bug: 67908229
Bug: 71548421
Test: manual testing of checking that the option correctly displays and
logs to check that the toggle correctly changes values.
Change-Id: I48a2dc34d772b0e4ce7637df904b274c9fe1218f
This commit is contained in:
Jong Wook Kim
2018-01-05 18:40:25 -08:00
parent dbe2852e15
commit 0a20eda58d
5 changed files with 18 additions and 1 deletions

View File

@@ -9424,6 +9424,14 @@ public final class Settings {
public static final String WIFI_VERBOSE_LOGGING_ENABLED =
"wifi_verbose_logging_enabled";
/**
* Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
* setting to 1 will enable it. In the future, additional values may be supported.
* @hide
*/
public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
"wifi_connected_mac_randomization_enabled";
/**
* The maximum number of times we will retry a connection to an access
* point for which we have failed in acquiring an IP address from DHCP.

View File

@@ -391,8 +391,9 @@ message GlobalSettingsProto {
optional SettingProto zram_enabled = 347;
optional SettingProto enable_smart_replies_in_notifications = 348;
optional SettingProto show_first_crash_dialog = 349;
optional SettingProto wifi_connected_mac_randomization_enabled = 350;
// Next tag = 350;
// Next tag = 351;
}
message SecureSettingsProto {

View File

@@ -390,6 +390,7 @@ public class SettingsBackupTest {
Settings.Global.WFC_IMS_ROAMING_MODE,
Settings.Global.WIFI_BADGING_THRESHOLDS,
Settings.Global.WIFI_BOUNCE_DELAY_OVERRIDE_MS,
Settings.Global.WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED,
Settings.Global.WIFI_COUNTRY_CODE,
Settings.Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN,
Settings.Global.WIFI_DISPLAY_CERTIFICATION_ON,

View File

@@ -498,6 +498,8 @@
<string name="wifi_display_certification">Wireless display certification</string>
<!-- Setting Checkbox title whether to enable WiFi Verbose Logging. [CHAR LIMIT=40] -->
<string name="wifi_verbose_logging">Enable Wi\u2011Fi Verbose Logging</string>
<!-- Setting Checkbox title whether to enable connected MAC randomization -->
<string name="wifi_connected_mac_randomization">Connected MAC Randomization</string>
<!-- Setting Checkbox title whether to always keep mobile data active. [CHAR LIMIT=80] -->
<string name="mobile_data_always_on">Mobile data always active</string>
<!-- Setting Checkbox title whether to enable hardware acceleration for tethering. [CHAR LIMIT=80] -->
@@ -552,6 +554,8 @@
<string name="wifi_display_certification_summary">Show options for wireless display certification</string>
<!-- Setting Checkbox summary whether to enable Wifi verbose Logging [CHAR LIMIT=80] -->
<string name="wifi_verbose_logging_summary">Increase Wi\u2011Fi logging level, show per SSID RSSI in Wi\u2011Fi Picker</string>
<!-- Setting Checkbox title whether to enable connected MAC randomization -->
<string name="wifi_connected_mac_randomization_summary">Randomize MAC address when connecting to Wi\u2011Fi networks</string>
<!-- UI debug setting: limit size of Android logger buffers -->
<string name="select_logd_size_title">Logger buffer sizes</string>
<!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->

View File

@@ -1128,6 +1128,9 @@ class SettingsProtoDumpUtil {
dumpSetting(s, p,
Settings.Global.SHOW_FIRST_CRASH_DIALOG,
GlobalSettingsProto.SHOW_FIRST_CRASH_DIALOG);
dumpSetting(s, p,
Settings.Global.WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED,
GlobalSettingsProto.WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED);
}
/** Dump a single {@link SettingsState.Setting} to a proto buf */