Merge "Just broadcast intent to bring up MTP/PTP as soon as switching function"

am: a0360e38ab

Change-Id: I862f38f52cef8b2b90125953593774263b862306
This commit is contained in:
Jerry Zhang
2017-03-28 18:57:16 +00:00
committed by android-build-merger

View File

@@ -570,8 +570,11 @@ public class UsbDeviceManager {
// Set the new USB configuration.
setUsbConfig(functions);
// Start up dependent services.
updateUsbStateBroadcastIfNeeded(true);
if (UsbManager.containsFunction(functions, UsbManager.USB_FUNCTION_MTP)
|| UsbManager.containsFunction(functions, UsbManager.USB_FUNCTION_PTP)) {
// Start up dependent services.
updateUsbStateBroadcastIfNeeded(true);
}
if (!waitForState(functions)) {
Slog.e(TAG, "Failed to switch USB config to " + functions);