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

Commit f98a7ac5 authored by Zhao Wei Liew's avatar Zhao Wei Liew Committed by Steve Kondik
Browse files

Revert "UsbManager: Add the support of USB charging only function"

This change is bogus and breaks the USB connection mode UX.
There is no reason to change the current USB connection
behaviour, hence revert to AOSP behaviour for this.

This commit also depends on the Settings commit with
the change-id Iad7d0811b7dcffe78c734c073dceb6c054fcea11.

This reverts commit a694b103.

Change-Id: Ia61b341d5cd403f165d24257bab4148b1d9f4193
parent a3815bac
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -244,14 +244,6 @@ public class UsbManager {
     */
    public static final String USB_FUNCTION_ACCESSORY = "accessory";

    /**
     * Name of the charging USB function.
     * Used in extras for the {@link #ACTION_USB_STATE} broadcast
     *
     * {@hide}
     */
    public static final String USB_FUNCTION_CHARGING = "charging";

    /**
     * Name of extra for {@link #ACTION_USB_PORT_CHANGED}
     * containing the {@link UsbPort} object for the port.
+1 −3
Original line number Diff line number Diff line
@@ -543,9 +543,7 @@ public class UsbDeviceManager {
        }

        private String applyAdbFunction(String functions) {
            //Not enable adb when it s charging mode
            if (mAdbEnabled &&
                !UsbManager.containsFunction(functions, UsbManager.USB_FUNCTION_CHARGING)) {
            if (mAdbEnabled) {
                functions = UsbManager.addFunction(functions, UsbManager.USB_FUNCTION_ADB);
            } else {
                functions = UsbManager.removeFunction(functions, UsbManager.USB_FUNCTION_ADB);
+0 −1
Original line number Diff line number Diff line
@@ -313,7 +313,6 @@ public class UsbService extends IUsbManager.Stub {
            case UsbManager.USB_FUNCTION_MTP:
            case UsbManager.USB_FUNCTION_PTP:
            case UsbManager.USB_FUNCTION_RNDIS:
            case UsbManager.USB_FUNCTION_CHARGING:
                return true;
        }