Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b3e46c7 authored by puma_hsu's avatar puma_hsu Committed by Thierry Strudel
Browse files

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



Bug:36113457
Change-Id: I3a7ab6fdcd157740b8e55ded67b3d5dddf15b0e0
Signed-off-by: default avatarpuma_hsu <puma_hsu@htc.com>
parent 60865e4a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -570,8 +570,11 @@ public class UsbDeviceManager {
                // Set the new USB configuration.
                setUsbConfig(functions);

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