Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afbf2ae6 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

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
parent 1549d661
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);