summaryrefslogtreecommitdiffstats
path: root/services/usb
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2015-07-22 12:59:47 -0700
committerNick Kralevich <nnk@google.com>2015-07-22 12:59:47 -0700
commitb210026e3d5c955628ca8b8b9191ade08891e9ef (patch)
treeae68f8de3f219cea46a8c13d2f26cdff67e7ddd5 /services/usb
parentdb71828cb7bff983bd758e986b65731cb0a5b2f6 (diff)
downloadframeworks_base-b210026e3d5c955628ca8b8b9191ade08891e9ef.zip
frameworks_base-b210026e3d5c955628ca8b8b9191ade08891e9ef.tar.gz
frameworks_base-b210026e3d5c955628ca8b8b9191ade08891e9ef.tar.bz2
UsbDeviceManager: fix b/21429947 regression
As discussed in b/21429947 (commit 674019065bceb4150190bfb1aa63cda9de0a8560), MTP must always be enabled, even if access to the underlying MTP data is disabled. Otherwise, Android will not enumerate on the USB bus, and won't receive notifications from the kernel about USB state changes. This effectively prevents using MTP functionality on user builds, or on userdebug/eng builds with adb turned off. Always ensure that MTP is the default driver mode. Get rid of one use of the persistent property. The persistent property was already pulled from a number of devices, and as explained in commit fcf10f7c12cb3107bdfedce6f76a8c866d154f3c, the intent was that the persistent property would only hold the persistent adb state. Bug: 22447614 Bug: 21429947 Change-Id: I8b3690a1bafb7cea0d5a69d73c1065c7fc64c653
Diffstat (limited to 'services/usb')
-rw-r--r--services/usb/java/com/android/server/usb/UsbDeviceManager.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 1787b91..4cfa37a 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -49,10 +49,8 @@ import com.android.internal.util.IndentingPrintWriter;
import com.android.server.FgThread;
import java.io.File;
-import java.io.FileDescriptor;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.PrintWriter;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -807,8 +805,7 @@ public class UsbDeviceManager {
}
private String getDefaultFunctions() {
- return SystemProperties.get(USB_PERSISTENT_CONFIG_PROPERTY,
- UsbManager.USB_FUNCTION_ADB);
+ return mAdbEnabled ? UsbManager.USB_FUNCTION_ADB : UsbManager.USB_FUNCTION_MTP;
}
public void dump(IndentingPrintWriter pw) {