Fix ambient display time unit error
Treated return value from mStats.getScreenDozeTime as ms, but indeed it
is us.
Fixes: 77655868
Test: manual
Change-Id: Ic9838a2fca3f49a6f5a669bd1970dcc7560fb5e2
diff --git a/core/java/com/android/internal/os/BatteryStatsHelper.java b/core/java/com/android/internal/os/BatteryStatsHelper.java
index 1e5bd18..b49aace 100644
--- a/core/java/com/android/internal/os/BatteryStatsHelper.java
+++ b/core/java/com/android/internal/os/BatteryStatsHelper.java
@@ -657,7 +657,7 @@
* {@link #removeHiddenBatterySippers(List)}.
*/
private void addAmbientDisplayUsage() {
- long ambientDisplayMs = mStats.getScreenDozeTime(mRawRealtimeUs, mStatsType);
+ long ambientDisplayMs = mStats.getScreenDozeTime(mRawRealtimeUs, mStatsType) / 1000;
double power = mPowerProfile.getAveragePower(PowerProfile.POWER_AMBIENT_DISPLAY)
* ambientDisplayMs / (60 * 60 * 1000);
if (power > 0) {