summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Suprabh Shukla <suprabh@google.com> 2023-04-14 14:49:11 -0700
committer Suprabh Shukla <suprabh@google.com> 2023-04-14 14:55:29 -0700
commitafbf2ae6ac3f050e3e420bf517dfbe58d8eabfa7 (patch)
tree54a9bf96ee49d696dcbb642ebb0614ba9bcf2c13
parent1549d6619f80840c2c65f860f4d3e9296a67a972 (diff)
Initialize uninitialized member in BatteryService
A field was left uninitialized, which could lead to undefined behavior. Test: Builds, boots, sensor events show up in BatteryStats as expected. Bug: 275436924 Change-Id: I42e42356980d75d563be763d60f56bedb863bc33
-rw-r--r--services/sensorservice/BatteryService.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/sensorservice/BatteryService.cpp b/services/sensorservice/BatteryService.cpp
index b0fbe5dc4e..0ea548c958 100644
--- a/services/sensorservice/BatteryService.cpp
+++ b/services/sensorservice/BatteryService.cpp
@@ -30,8 +30,8 @@
namespace android {
// ---------------------------------------------------------------------------
-BatteryService::BatteryService() : mBatteryStatService(nullptr) {
-}
+BatteryService::BatteryService()
+ : mBatteryStatService(nullptr), mLastWakeupSensorEventReportedMs(0) {}
bool BatteryService::addSensor(uid_t uid, int handle) {
Mutex::Autolock _l(mActivationsLock);