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

Commit 11c2ea3a authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by android-build-merger
Browse files

Merge "Add a developer offload for tethering hardware acceleration." into oc-dr1-dev

am: dcc15eab

Change-Id: I3e5eb9cbcd7cdee2f0ee28579fc8f9d707b8e471
parents 89efcf0c dcc15eab
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -193,6 +193,11 @@
            android:title="@string/mobile_data_always_on"
            android:summary="@string/mobile_data_always_on_summary"/>

        <SwitchPreference
            android:key="tethering_hardware_offload"
            android:title="@string/tethering_hardware_offload"
            android:summary="@string/tethering_hardware_offload_summary"/>

        <ListPreference
            android:key="select_usb_configuration"
            android:title="@string/select_usb_configuration_title"
+18 −0
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
    private static final String WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY = "wifi_allow_scan_with_traffic";
    private static final String USB_CONFIGURATION_KEY = "select_usb_configuration";
    private static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
    private static final String TETHERING_HARDWARE_OFFLOAD = "tethering_hardware_offload";
    private static final String KEY_COLOR_MODE = "picture_color_mode";
    private static final String FORCE_RESIZABLE_KEY = "force_resizable_activities";
    private static final String COLOR_TEMPERATURE_KEY = "color_temperature";
@@ -279,6 +280,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
    private SwitchPreference mWifiVerboseLogging;
    private SwitchPreference mWifiAggressiveHandover;
    private SwitchPreference mMobileDataAlwaysOn;
    private SwitchPreference mTetheringHardwareOffload;
    private SwitchPreference mBluetoothDisableAbsVolume;
    private SwitchPreference mBluetoothEnableInbandRinging;

@@ -475,6 +477,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
        mWifiAggressiveHandover = findAndInitSwitchPref(WIFI_AGGRESSIVE_HANDOVER_KEY);
        mWifiAllowScansWithTraffic = findAndInitSwitchPref(WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY);
        mMobileDataAlwaysOn = findAndInitSwitchPref(MOBILE_DATA_ALWAYS_ON);
        mTetheringHardwareOffload = findAndInitSwitchPref(TETHERING_HARDWARE_OFFLOAD);
        mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY);
        if ("1".equals(SystemProperties.get("ro.debuggable", "0"))) {
            mLogpersist = addListPreference(SELECT_LOGPERSIST_KEY);
@@ -807,6 +810,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
        updateWifiAggressiveHandoverOptions();
        updateWifiAllowScansWithTrafficOptions();
        updateMobileDataAlwaysOnOptions();
        updateTetheringHardwareOffloadOptions();
        updateSimulateColorSpace();
        updateUSBAudioOptions();
        updateForceResizableOptions();
@@ -1481,6 +1485,18 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
                mMobileDataAlwaysOn.isChecked() ? 1 : 0);
    }

    private void updateTetheringHardwareOffloadOptions() {
        updateSwitchPreference(mTetheringHardwareOffload, Settings.Global.getInt(
                getActivity().getContentResolver(),
                Settings.Global.TETHER_OFFLOAD_DISABLED, 0) != 1);
    }

    private void writeTetheringHardwareOffloadOptions() {
        Settings.Global.putInt(getActivity().getContentResolver(),
                Settings.Global.TETHER_OFFLOAD_DISABLED,
                mTetheringHardwareOffload.isChecked() ? 0 : 1);
    }

    private String defaultLogdSizeValue() {
        String defaultValue = SystemProperties.get(SELECT_LOGD_DEFAULT_SIZE_PROPERTY);
        if ((defaultValue == null) || (defaultValue.length() == 0)) {
@@ -2498,6 +2514,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
            writeWifiAllowScansWithTrafficOptions();
        } else if (preference == mMobileDataAlwaysOn) {
            writeMobileDataAlwaysOnOptions();
        } else if (preference == mTetheringHardwareOffload) {
            writeTetheringHardwareOffloadOptions();
        } else if (preference == mColorTemperaturePreference) {
            writeColorTemperature();
        } else if (preference == mUSBAudio) {