Merge "Clamp the scaling factor of battery usage in app battery tracker" into tm-dev

This commit is contained in:
Jing Ji
2022-04-13 22:58:29 +00:00
committed by Android (Google) Code Review

View File

@@ -654,7 +654,7 @@ final class AppBatteryTracker extends BaseAppStateTracker<AppBatteryPolicy>
final long start = stats.getStatsStartTimestamp();
final long end = stats.getStatsEndTimestamp();
final double scale = expectedDuration > 0
? (expectedDuration * 1.0d) / (end - start) : 1.0d;
? Math.min((expectedDuration * 1.0d) / (end - start), 1.0d) : 1.0d;
final AppBatteryPolicy bgPolicy = mInjector.getPolicy();
for (UidBatteryConsumer uidConsumer : uidConsumers) {
// TODO: b/200326767 - as we are not supporting per proc state attribution yet,