Refactor setCurrentFunction and setUsbDataUnlocked into one method
am: a1b60e629f
Change-Id: I0ed28df5f24e7fe545f968c4d65cfc0494b57ebd
This commit is contained in:
@@ -1707,11 +1707,10 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
||||
private void writeUsbConfigurationOption(Object newValue) {
|
||||
UsbManager manager = (UsbManager)getActivity().getSystemService(Context.USB_SERVICE);
|
||||
String function = newValue.toString();
|
||||
manager.setCurrentFunction(function);
|
||||
if (function.equals("none")) {
|
||||
manager.setUsbDataUnlocked(false);
|
||||
manager.setCurrentFunction(function, false);
|
||||
} else {
|
||||
manager.setUsbDataUnlocked(true);
|
||||
manager.setCurrentFunction(function, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user