OSDN Git Service

Revert "UsbManager: Add the support of USB charging only function"
authorZhao Wei Liew <zhaoweiliew@gmail.com>
Sat, 10 Sep 2016 10:07:27 +0000 (18:07 +0800)
committerSteve Kondik <steve@cyngn.com>
Tue, 13 Sep 2016 07:12:40 +0000 (00:12 -0700)
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 a694b103f43a3570fb18a92614d6d6585ac3c493.

Change-Id: Ia61b341d5cd403f165d24257bab4148b1d9f4193

core/java/android/hardware/usb/UsbManager.java [changed mode: 0755->0644]
services/usb/java/com/android/server/usb/UsbDeviceManager.java [changed mode: 0755->0644]
services/usb/java/com/android/server/usb/UsbService.java [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 9afae31..f9a7d19
@@ -245,14 +245,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.
      *
old mode 100755 (executable)
new mode 100644 (file)
index f5db37d..3b0ebfa
@@ -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);
old mode 100755 (executable)
new mode 100644 (file)
index d6f6b82..d6dbe90
@@ -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;
         }