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

Bug: 36113457
Bug: 34451451
Test: Turn on tethering
Change-Id: I3a7ab6fdcd157740b8e55ded67b3d5dddf15b0e0
Signed-off-by: puma_hsu <puma_hsu@htc.com>
(cherry picked from commit 4b3e46c787)
This commit is contained in:
puma_hsu
2017-03-24 10:41:56 +08:00
committed by Jerry Zhang
parent cfeb32287a
commit 6040887f78

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);