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

Commit dc0c14f1 authored by Jerry Zhang's avatar Jerry Zhang
Browse files

Broadcast only if boot complete

Accessory connects / disconnects can occur before
boot complete, so don't broadcast intents if that
is the case.

Bug: 63114621
Test: connect/disconnect an accessory
Change-Id: Ib8f9eb97ce1630004511fcc1fb84594ccc812c06
parent 37ddbfaa
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -693,8 +693,9 @@ public class UsbDeviceManager {
                // Set the new USB configuration.
                setUsbConfig(oemFunctions);

                if (UsbManager.containsFunction(functions, UsbManager.USB_FUNCTION_MTP)
                        || UsbManager.containsFunction(functions, UsbManager.USB_FUNCTION_PTP)) {
                if (mBootCompleted
                        && (UsbManager.containsFunction(functions, UsbManager.USB_FUNCTION_MTP)
                        || UsbManager.containsFunction(functions, UsbManager.USB_FUNCTION_PTP))) {
                    // Start up dependent services.
                    updateUsbStateBroadcastIfNeeded(true);
                }