Set powerBrickStatus to not connected when sourcing power am: 7d34263bf9 am: 215804825b

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs201/+/19374029

Change-Id: Id715b1cdb3930e8bd515f82b19d7979ee179f2fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
badhri 2022-07-22 03:15:10 +00:00 committed by Automerger Merge Worker
commit 0b15693cec

View file

@ -732,7 +732,9 @@ Status getPortStatusHelper(android::hardware::usb::Usb *usb,
// When connected return powerBrickStatus // When connected return powerBrickStatus
if (port.second) { if (port.second) {
string usbType; string usbType;
if (ReadFileToString(string(kPowerSupplyUsbType), &usbType)) { if ((*currentPortStatus)[i].currentPowerRole == PortPowerRole::SOURCE) {
(*currentPortStatus)[i].powerBrickStatus = PowerBrickStatus::NOT_CONNECTED;
} else if (ReadFileToString(string(kPowerSupplyUsbType), &usbType)) {
if (strstr(usbType.c_str(), "[D")) { if (strstr(usbType.c_str(), "[D")) {
(*currentPortStatus)[i].powerBrickStatus = PowerBrickStatus::CONNECTED; (*currentPortStatus)[i].powerBrickStatus = PowerBrickStatus::CONNECTED;
} else if (strstr(usbType.c_str(), "[U")) { } else if (strstr(usbType.c_str(), "[U")) {