Refactor setCurrentFunction and setUsbDataUnlocked into one method

am: a1b60e629f

Change-Id: I0ed28df5f24e7fe545f968c4d65cfc0494b57ebd
This commit is contained in:
Jerry Zhang
2016-11-17 00:09:38 +00:00
committed by android-build-merger
2 changed files with 6 additions and 11 deletions

View File

@@ -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);
}
}