From 665eb216e53bdd5831584f22ec7a51a809cea0f5 Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Mon, 25 Mar 2019 11:02:44 -0700 Subject: [PATCH] Fix missing combination check SINK/DEVICE While checking for possible role combinations, the SINK/HOST combination seems to be mistakenly checked twice intead of SINK/DEVICE. This CL fixes this. The code now checks for: 1. source & host 2. sink & host 3. source & device 4. sink & device Cherrypicked from aosp: https://android-review.googlesource.com/c/platform/frameworks/base/+/933377 Bug: 119142682 Test: Build success Change-Id: I5e652fbf9313bd2c122fe728d58e577085632253 --- services/usb/java/com/android/server/usb/UsbDeviceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java index f1e22819f501c..79e6851039baa 100644 --- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java +++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java @@ -842,7 +842,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser && status.isRoleCombinationSupported(POWER_ROLE_SINK, DATA_ROLE_HOST) && status.isRoleCombinationSupported(POWER_ROLE_SOURCE, DATA_ROLE_DEVICE) - && status.isRoleCombinationSupported(POWER_ROLE_SINK, DATA_ROLE_HOST); + && status.isRoleCombinationSupported(POWER_ROLE_SINK, DATA_ROLE_DEVICE); args.recycle(); updateUsbNotification(false);