summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jerry Zhang <zhangjerry@google.com> 2017-05-08 15:13:50 -0700
committer Jerry Zhang <zhangjerry@google.com> 2017-05-08 15:17:17 -0700
commitf706fe2f6000d0d7c132c17e622cb96e8eaabc4c (patch)
tree27860a12e537ed8eb806db98cf65a917ef34aa4b
parent5f0e436548ea3bd10cef480c194da7da6080ac1e (diff)
Always force set functions on disconnect
Functionfs no_disconnect mode will close the function on disconnect so the current handling won't suffice for cases where the mtp process is killed while MtpService is running. This can happen when anything in Media/DownloadProvider ANRs or similar. Solve this by always setting the config at disconnect time. Bug: 38010151 Test: Connect with MTP, am force-stop com.android.providers.media, reconnect Change-Id: Iaf012f6e2f11151f34d834efe08777dd02c0aec5
-rw-r--r--services/usb/java/com/android/server/usb/UsbDeviceManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 7cb176de41c1..eddcbda95051 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -855,7 +855,7 @@ public class UsbDeviceManager {
if (!mConnected) {
// restore defaults when USB is disconnected
Slog.i(TAG, "Disconnect, setting usb functions to null");
- setEnabledFunctions(null, false, false);
+ setEnabledFunctions(null, true, false);
}
updateUsbFunctions();
} else {