mirror of
https://github.com/Evolution-X-Devices/device_google_gs201
synced 2026-02-01 11:27:36 +00:00
Set powerBrickStatus to not connected when sourcing power
Bug: 239755044 Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Change-Id: I7720bfaa5876c058643c52525b488ba22b3e5121
This commit is contained in:
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user