Refactor setCurrentFunction and setUsbDataUnlocked into one method
This allows us to get rid of an extraneous config switch and simplify some code. Test: Manually change usb configuration Change-Id: Id78da530ff485ecd7a915056832eec1dd8c91954
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