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
(cherry picked from commit 5d36a177d9
)
This commit is contained in:
@@ -1704,11 +1704,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