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

Commit 807c8067 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: Don't add adb function when usb disconnected"

parents 6de284dd d60784cc
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ public class UsbDeviceManager {
            // with OEM specific mode.
            if (functions != null && makeDefault && !needsOemUsbOverride()) {

                if (!"charging".equals(functions)) {
                if (!UsbManager.USB_FUNCTION_CHARGING.equals(functions)) {
                    if (mAdbEnabled) {
                        functions = addFunction(functions, UsbManager.USB_FUNCTION_ADB);
                    } else {
@@ -495,11 +495,13 @@ public class UsbDeviceManager {
                // Override with bootmode specific usb mode if needed
                functions = processOemUsbOverride(functions);

                if (!UsbManager.USB_FUNCTION_CHARGING.equals(functions)) {
                    if (mAdbEnabled) {
                        functions = addFunction(functions, UsbManager.USB_FUNCTION_ADB);
                    } else {
                        functions = removeFunction(functions, UsbManager.USB_FUNCTION_ADB);
                    }
                }
                if (!mCurrentFunctions.equals(functions)) {
                    if (!setUsbConfig("none")) {
                        Slog.e(TAG, "Failed to disable USB");