Usb: Populate connected status of non compliant port partners only when not populated

Set mode, power role and data role on non compliant port partners
only if the portStatus is not already populated. Compliance warnings
such as missing rp do not populate these fields during
getPortStatusHelper

Test: manual test on device
Bug: 279251052
Bug: 301380358
Change-Id: Ibe71bdd5c521ba90c124d89bd56af90087c0df18
This commit is contained in:
Badhri Jagan Sridharan 2023-05-16 03:52:41 +00:00 committed by RD Babiera
parent 0991cd02ca
commit 3c94c8bb80

View file

@ -355,7 +355,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;