Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a20eda5 authored by Jong Wook Kim's avatar Jong Wook Kim
Browse files

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
parent dbe2852e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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.
+2 −1
Original line number Diff line number Diff line
@@ -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 {
+1 −0
Original line number Diff line number Diff line
@@ -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,
+4 −0
Original line number Diff line number Diff line
@@ -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] -->
+3 −0
Original line number Diff line number Diff line
@@ -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 */