summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <badhri@google.com>2023-05-16 03:52:41 +0000
committerBadhri Jagan Sridharan <badhri@google.com>2023-05-17 23:45:55 +0000
commitcac33c008f80e309ceaeef399e2ca4b46e2c0e2f (patch)
treee07d34301bc7ad2f0eacb72ea046c7cc3f96a813
parent4c74d00f9811436024c6c0d452d3e487a227e086 (diff)
Usb: Populate UsbDataStatus only when not populated
Do not override UsbDataStatus when already populated. Compliance warnings such as missing Rp do not populate UsbDataStatus and the port partner is detected. Populate UsbDataStatus only when not populated. Bug: 279251052 Change-Id: Ibe71bdd5c521ba90c124d89bd56af90087c0df18 (cherry picked from commit 47e1400c8fef8af1aea985795d7adfe3ff16871b)
-rw-r--r--usb/usb/Usb.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/usb/usb/Usb.cpp b/usb/usb/Usb.cpp
index 74f6868c..6993275a 100644
--- a/usb/usb/Usb.cpp
+++ b/usb/usb/Usb.cpp
@@ -312,7 +312,8 @@ Status queryNonCompliantChargerStatus(std::vector<PortStatus> *currentPortStatus
continue;
}
}
- if ((*currentPortStatus)[i].complianceWarnings.size() > 0) {
+ if ((*currentPortStatus)[i].complianceWarnings.size() > 0 &&
+ (*currentPortStatus)[i].currentPowerRole == PortPowerRole::NONE) {
(*currentPortStatus)[i].currentMode = PortMode::UFP;
(*currentPortStatus)[i].currentPowerRole = PortPowerRole::SINK;
(*currentPortStatus)[i].currentDataRole = PortDataRole::NONE;