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

Commit bad7413b authored by Kweku Adams's avatar Kweku Adams
Browse files

Add extra info to BATTERY_LEVEL_CHANGED broadcast.

The BATTERY_LEVEL_CHANGED broadcast was missing charge counter and
temperature values. It's not clear why they were excluded, so I assume
it was an oversight.

Bug: 115625851
Test: Android builds
Change-Id: I3dbca0b7ccfa3c748b1cf1a15a6417c322588a6b
parent 44466345
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -720,6 +720,8 @@ public final class BatteryService extends SystemService {
        event.putInt(BatteryManager.EXTRA_SCALE, BATTERY_SCALE);
        event.putInt(BatteryManager.EXTRA_PLUGGED, mPlugType);
        event.putInt(BatteryManager.EXTRA_VOLTAGE, mHealthInfo.batteryVoltage);
        event.putInt(BatteryManager.EXTRA_TEMPERATURE, mHealthInfo.batteryTemperature);
        event.putInt(BatteryManager.EXTRA_CHARGE_COUNTER, mHealthInfo.batteryChargeCounter);
        event.putLong(BatteryManager.EXTRA_EVENT_TIMESTAMP, now);

        boolean queueWasEmpty = mBatteryLevelsEventQueue.isEmpty();