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

Commit e6ffe317 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Fix USB mode development setting

USB mode consists of the function (mtp, ptp, midi, etc) and the data
locked/unlocked state. Developer settings was only setting the
function, leaving data locked when it should be unlocked.

Bug: 22165902
Change-Id: Ia1ae8dfaf3d2abc62034aa6aea1234bad04aaa2e
parent 21e00f98
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1326,7 +1326,13 @@ public class DevelopmentSettings extends SettingsPreferenceFragment

    private void writeUsbConfigurationOption(Object newValue) {
        UsbManager manager = (UsbManager)getActivity().getSystemService(Context.USB_SERVICE);
        manager.setCurrentFunction(newValue.toString());
        String function = newValue.toString();
        manager.setCurrentFunction(function);
        if (function.equals("none")) {
            manager.setUsbDataUnlocked(false);
        } else {
            manager.setUsbDataUnlocked(true);
        }
    }

    private void updateCpuUsageOptions() {