diff options
author | Badhri Jagan Sridharan <badhri@google.com> | 2021-07-14 16:09:59 -0700 |
---|---|---|
committer | Badhri Jagan Sridharan <badhri@google.com> | 2021-07-15 01:14:36 +0000 |
commit | bf5d1c699ba721732693f943fe2ca8fc9eddf695 (patch) | |
tree | 2e6a9a63532a20093c56018c733157934b7b65de /health | |
parent | 0102c84bd717592f7bcdf6d3aa8bff5acb2d6a24 (diff) | |
download | pixel-bf5d1c699ba721732693f943fe2ca8fc9eddf695.tar.gz |
libpixelhealth: Report non compliant BC1.2 chargers as AC type
Non-PD Non-BC1.2 compliant Type-C chargers are not reported online.
Reporting them as AC type.
Bug: 193713474
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: Ia6b2832ded3882f37cb32d23a09307ca5652cb6c
Diffstat (limited to 'health')
-rw-r--r-- | health/ChargerDetect.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/health/ChargerDetect.cpp b/health/ChargerDetect.cpp index 2ba0d15c..1de7e95c 100644 --- a/health/ChargerDetect.cpp +++ b/health/ChargerDetect.cpp @@ -116,7 +116,7 @@ void ChargerDetect::onlineUpdate(struct android::BatteryProperties *props) { if (tcpmPsyName.empty()) { populateTcpmPsyName(&tcpmPsyName); - KLOG_INFO(LOG_TAG, "TcpmPsyName:%s\n", tcpmPsyName.c_str()); + KLOG_INFO(LOG_TAG, "TcpmPsyName:%s\n", tcpmPsyName.c_str()); } if (!getIntField(kUsbOnlinePath)) { @@ -134,6 +134,9 @@ void ChargerDetect::onlineUpdate(struct android::BatteryProperties *props) { } } + /* Safe to assume AC charger here if BC1.2 non compliant */ + props->chargerAcOnline = true; + if (tcpmPsyName.empty()) { return; } @@ -145,9 +148,6 @@ void ChargerDetect::onlineUpdate(struct android::BatteryProperties *props) { } KLOG_INFO(LOG_TAG, "TcpmPsy Usbtype:%s\n", usbPsyType.c_str()); - if (usbPsyType == "PD" || usbPsyType == "PD_PPS") { - props->chargerAcOnline = true; - } return; } |