Merge "Just broadcast intent to bring up MTP/PTP as soon as switching function" into oc-dev

This commit is contained in:
Jerry Zhang
2017-04-10 18:51:53 +00:00
committed by Android (Google) Code Review

View File

@ -640,8 +640,11 @@ public class UsbDeviceManager {
// Set the new USB configuration.
setUsbConfig(oemFunctions);
// 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(oemFunctions)) {
Slog.e(TAG, "Failed to switch USB config to " + functions);