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
This commit is contained in:
Marco Nelissen
2015-06-30 14:52:04 -07:00
parent 21e00f9819
commit e6ffe31754

View File

@@ -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() {