Set powerBrickStatus to not connected when sourcing power am: 7d34263bf9
Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs201/+/19374029 Change-Id: If571bb90ae31c88b6e47afb1c48aa629da35bca4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
215804825b
1 changed files with 3 additions and 1 deletions
|
@ -732,7 +732,9 @@ Status getPortStatusHelper(android::hardware::usb::Usb *usb,
|
|||
// When connected return powerBrickStatus
|
||||
if (port.second) {
|
||||
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")) {
|
||||
(*currentPortStatus)[i].powerBrickStatus = PowerBrickStatus::CONNECTED;
|
||||
} else if (strstr(usbType.c_str(), "[U")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue