Override the 'online' status for AC/USB for battery defender

Bug: 175614345
Test: 'atest HealthTestCases'
Merged-In: If7b7b54b2fb05694720933de4b49c81a65772bbb
Change-Id: If7b7b54b2fb05694720933de4b49c81a65772bbb
(cherry picked from commit 3637629ebee4bd761ee89cf3a9e0c8ee98527ad8)
diff --git a/health/Health.cpp b/health/Health.cpp
index 664dd7b..12cf599 100644
--- a/health/Health.cpp
+++ b/health/Health.cpp
@@ -118,7 +118,6 @@
 void private_healthd_board_init(struct healthd_config *hc) {
   hc->ignorePowerSupplyNames.push_back(android::String8(kTCPMPSYName));
   needs_wlc_updates = FileExists(kWlcCapacity);
-  battDefender.update();
 }
 
 int private_healthd_board_battery_update(struct android::BatteryProperties *props) {
@@ -126,7 +125,7 @@
   battThermalControl.updateThermalState(props);
   battMetricsLogger.logBatteryProperties(props);
   shutdownMetrics.logShutdownVoltage(props);
-  battDefender.update();
+  battDefender.update(props);
 
   if (needs_wlc_updates &&
       !android::base::WriteStringToFile(std::to_string(props->batteryLevel), kWlcCapacity))