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

Commit 8fc9341b authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Add a developer settings checkbox to use the legacy DHCP client.

Change-Id: I18471bdf137fbb128d7e4ae6b9b1a4675f5e7fbc
parent 736d29b8
Loading
Loading
Loading
Loading
+21 −11
Original line number Diff line number Diff line
@@ -3452,6 +3452,21 @@
    <string name="confirm_enable_oem_unlock_text">WARNING: Device protection features will not work on this device while this setting is turned on.</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] -->
    <string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
    <!-- Setting Checkbox title whether to allow mock locations -->
    <string name="allow_mock_location">Allow mock locations</string>
    <!-- setting Checkbox summary whether to allow mock locations  -->
    <string name="allow_mock_location_summary">Allow mock locations</string>
    <!-- Setting Checkbox title whether to enable view attribute inspection -->
    <string name="debug_view_attributes">Enable view attribute inspection</string>
    <!-- Title of warning dialog about the implications of enabling USB debugging -->

    <!-- Preference category for networking debugging development settings. [CHAR LIMIT=50] -->
    <string name="debug_networking_category">Networking</string>

    <!-- Setting Checkbox title whether to show options for wireless display certification -->
    <string name="wifi_display_certification">Wireless display certification</string>
    <!-- Setting Checkbox title whether to enable WiFi Verbose Logging. [CHAR LIMIT=40] -->
@@ -3460,6 +3475,9 @@
    <string name="wifi_aggressive_handover">Aggressive Wi\u2011Fi to Cellular handover</string>
    <!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
    <string name="wifi_allow_scan_with_traffic">Always allow Wi\u2011Fi Roam Scans</string>
    <!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
    <string name="legacy_dhcp_client">Use legacy DHCP client</string>

    <!-- setting Checkbox summary whether to show options for wireless display certification  -->
    <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] -->
@@ -3468,17 +3486,9 @@
    <string name="wifi_aggressive_handover_summary">When enabled, Wi\u2011Fi will be more aggressive in handing over the data connection to Cellular, when Wi\u2011Fi signal is low</string>
    <!-- Setting Checkbox summary whether to always allow WiFi Roam Scans [CHAR LIMIT=130] -->
    <string name="wifi_allow_scan_with_traffic_summary">Allow/Disallow Wi\u2011Fi Roam Scans based on the amount of data traffic present at the interface</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] -->
    <string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
    <!-- Setting Checkbox title whether to allow mock locations -->
    <string name="allow_mock_location">Allow mock locations</string>
    <!-- setting Checkbox summary whether to allow mock locations  -->
    <string name="allow_mock_location_summary">Allow mock locations</string>
    <!-- Setting Checkbox title whether to enable view attribute inspection -->
    <string name="debug_view_attributes">Enable view attribute inspection</string>
    <!-- Title of warning dialog about the implications of enabling USB debugging -->
    <!-- Setting Checkbox summary whether to use DHCP client from Lollipop (Android 5.0) [CHAR LIMIT=130] -->
    <string name="legacy_dhcp_client_summary">Use the DHCP client from Lollipop instead of the new Android DHCP client.</string>

    <string name="adb_warning_title">Allow USB debugging?</string>
    <!-- Warning text to user about the implications of enabling USB debugging -->
    <string name="adb_warning_message">USB debugging is intended for development purposes only. Use it to copy data between your computer and your device, install apps on your device without notification, and read log data.</string>
+16 −6
Original line number Diff line number Diff line
@@ -103,6 +103,18 @@
            android:title="@string/verify_apps_over_usb_title"
            android:summary="@string/verify_apps_over_usb_summary"/>

        <ListPreference
            android:key="select_logd_size"
            android:title="@string/select_logd_size_title"
            android:dialogTitle="@string/select_logd_size_dialog_title"
            android:entries="@array/select_logd_size_titles"
            android:entryValues="@array/select_logd_size_values" />

    </PreferenceCategory>

    <PreferenceCategory android:key="debug_networking_category"
            android:title="@string/debug_networking_category">

        <SwitchPreference
            android:key="wifi_display_certification"
            android:title="@string/wifi_display_certification"
@@ -123,12 +135,10 @@
            android:title="@string/wifi_allow_scan_with_traffic" />
            android:summary="@string/wifi_allow_scan_with_traffic_summary"/>

        <ListPreference
            android:key="select_logd_size"
            android:title="@string/select_logd_size_title"
            android:dialogTitle="@string/select_logd_size_dialog_title"
            android:entries="@array/select_logd_size_titles"
            android:entryValues="@array/select_logd_size_values" />
       <SwitchPreference
            android:key="legacy_dhcp_client"
            android:title="@string/legacy_dhcp_client" />
            android:summary="@string/legacy_dhcp_client_summary"/>

    </PreferenceCategory>

+23 −3
Original line number Diff line number Diff line
@@ -135,13 +135,16 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
    private static final String OVERLAY_DISPLAY_DEVICES_KEY = "overlay_display_devices";
    private static final String DEBUG_DEBUGGING_CATEGORY_KEY = "debug_debugging_category";
    private static final String DEBUG_APPLICATIONS_CATEGORY_KEY = "debug_applications_category";
    private static final String SELECT_LOGD_SIZE_KEY = "select_logd_size";
    private static final String SELECT_LOGD_SIZE_PROPERTY = "persist.logd.size";
    private static final String SELECT_LOGD_DEFAULT_SIZE_PROPERTY = "ro.logd.size";

    private static final String DEBUG_NETWORKING_CATEGORY_KEY = "debug_networking_category";
    private static final String WIFI_DISPLAY_CERTIFICATION_KEY = "wifi_display_certification";
    private static final String WIFI_VERBOSE_LOGGING_KEY = "wifi_verbose_logging";
    private static final String WIFI_AGGRESSIVE_HANDOVER_KEY = "wifi_aggressive_handover";
    private static final String WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY = "wifi_allow_scan_with_traffic";
    private static final String SELECT_LOGD_SIZE_KEY = "select_logd_size";
    private static final String SELECT_LOGD_SIZE_PROPERTY = "persist.logd.size";
    private static final String SELECT_LOGD_DEFAULT_SIZE_PROPERTY = "ro.logd.size";
    private static final String WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client";

    private static final String OPENGL_TRACES_KEY = "enable_opengl_traces";

@@ -197,6 +200,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
    private SwitchPreference mWifiDisplayCertification;
    private SwitchPreference mWifiVerboseLogging;
    private SwitchPreference mWifiAggressiveHandover;
    private SwitchPreference mLegacyDhcpClient;

    private SwitchPreference mWifiAllowScansWithTraffic;
    private SwitchPreference mStrictMode;
@@ -336,6 +340,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
        mWifiVerboseLogging = findAndInitSwitchPref(WIFI_VERBOSE_LOGGING_KEY);
        mWifiAggressiveHandover = findAndInitSwitchPref(WIFI_AGGRESSIVE_HANDOVER_KEY);
        mWifiAllowScansWithTraffic = findAndInitSwitchPref(WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY);
        mLegacyDhcpClient = findAndInitSwitchPref(WIFI_LEGACY_DHCP_CLIENT_KEY);
        mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY);

        mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY);
@@ -543,6 +548,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
        updateWifiVerboseLoggingOptions();
        updateWifiAggressiveHandoverOptions();
        updateWifiAllowScansWithTrafficOptions();
        updateLegacyDhcpClientOptions();
        updateSimulateColorSpace();
        updateUseNuplayerOptions();
        updateUSBAudioOptions();
@@ -1073,6 +1079,18 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
        mWifiManager.setAllowScansWithTraffic(mWifiAllowScansWithTraffic.isChecked() ? 1 : 0);
    }

    private void updateLegacyDhcpClientOptions() {
        updateSwitchPreference(mLegacyDhcpClient, Settings.Global.getInt(
                getActivity().getContentResolver(),
                Settings.Global.LEGACY_DHCP_CLIENT, 0) != 0);
    }

    private void writeLegacyDhcpClientOptions() {
        Settings.Global.putInt(getActivity().getContentResolver(),
                Settings.Global.LEGACY_DHCP_CLIENT,
                mLegacyDhcpClient.isChecked() ? 1 : 0);
    }

    private void updateLogdSizeValues() {
        if (mLogdSize != null) {
            String currentValue = SystemProperties.get(SELECT_LOGD_SIZE_PROPERTY);
@@ -1450,6 +1468,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
            writeWifiAggressiveHandoverOptions();
        } else if (preference == mWifiAllowScansWithTraffic) {
            writeWifiAllowScansWithTrafficOptions();
        } else if (preference == mLegacyDhcpClient) {
            writeLegacyDhcpClientOptions();
        } else if (preference == mUseAwesomePlayer) {
            writeUseAwesomePlayerOptions();
        } else if (preference == mUSBAudio) {