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

Commit 10559fb9 authored by YUKAI HUNG's avatar YUKAI HUNG Committed by Android (Google) Code Review
Browse files

Merge "Fix legacy failed unit test for BatteryInfoLoader" into sc-dev

parents c6e056b7 f49eaf54
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -73,6 +73,11 @@ public class BatteryDiffEntry {
        mBackgroundUsageTimeInMs = backgroundUsageTimeInMs;
        mBatteryHistEntry = batteryHistEntry;
        mUserManager = context.getSystemService(UserManager.class);
        if (foregroundUsageTimeInMs == 0
                && backgroundUsageTimeInMs == 0
                && consumePower != 0) {
            Log.w(TAG, "abnornal BatteryDiffEntry:\n" + this);
        }
    }

    /** Sets the total consumed power in a specific time slot. */
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ public final class ConvertUtils {
                if (selectedBatteryEntry == null) {
                    continue;
                }
                // Force refine the cumulative value since it may introduce deviation
                // Forces refine the cumulative value since it may introduce deviation
                // error since we will apply the interpolation arithmetic.
                final float totalUsageTimeInMs =
                    foregroundUsageTimeInMs + backgroundUsageTimeInMs;
+1 −1
Original line number Diff line number Diff line
@@ -78,6 +78,6 @@ public class BatteryInfoLoaderTest {
        BatteryInfo info = loader.loadInBackground();

        assertThat(info.remainingLabel).isNotNull();
        assertThat(info.remainingTimeUs).isEqualTo(TEST_TIME_REMAINING);
        assertThat(info.remainingTimeUs).isEqualTo(TEST_TIME_REMAINING * 1000);
    }
}