Let UsbDeviceManager choose the appropriate function default

Rather than hardcoding MTP as the appropriate default when the user
selects "Charger Only", call UsbDeviceManager.setCurrentFunction(null).
Null is intended to restore the default function, which is appropriate
for charging only.

Bug: 21429947
Change-Id: I9ee633bcf2f95f9937861c234ab044873202d41b
This commit is contained in:
Nick Kralevich
2015-06-12 17:16:32 -07:00
parent da6e4c47aa
commit 2d0f6a9d36

View File

@@ -95,7 +95,7 @@ public class UsbModeChooserActivity extends Activity {
private void setCurrentFunction(int which) {
switch (which) {
case 0:
mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_MTP);
mUsbManager.setCurrentFunction(null);
mUsbManager.setUsbDataUnlocked(false);
break;
case 1: