Remove foreground_service_usage_time_in_ms field which has been merged

into background_usage_time_in_ms in the BatteryUsageStats (b/257392992).

Test: make RunSettingsRoboTests + manual
Bug: 258124768
Bug: 253553141
Change-Id: I0967eec0cbe6d0cb7a0535d744a1046dec1d267b
This commit is contained in:
Kuan Wang
2022-12-05 15:43:00 +08:00
parent b2cce522f8
commit ec1c9d94f2
16 changed files with 63 additions and 188 deletions

View File

@@ -52,7 +52,6 @@ public class BatteryDiffEntry {
(a, b) -> Double.compare(b.getPercentOfTotal(), a.getPercentOfTotal());
public long mForegroundUsageTimeInMs;
public long mForegroundServiceUsageTimeInMs;
public long mBackgroundUsageTimeInMs;
public double mConsumePower;
public double mForegroundUsageConsumePower;
@@ -83,7 +82,6 @@ public class BatteryDiffEntry {
public BatteryDiffEntry(
Context context,
long foregroundUsageTimeInMs,
long foregroundServiceUsageTimeInMs,
long backgroundUsageTimeInMs,
double consumePower,
double foregroundUsageConsumePower,
@@ -98,7 +96,6 @@ public class BatteryDiffEntry {
mBackgroundUsageConsumePower = backgroundUsageConsumePower;
mCachedUsageConsumePower = cachedUsageConsumePower;
mForegroundUsageTimeInMs = foregroundUsageTimeInMs;
mForegroundServiceUsageTimeInMs = foregroundServiceUsageTimeInMs;
mBackgroundUsageTimeInMs = backgroundUsageTimeInMs;
mBatteryHistEntry = batteryHistEntry;
mUserManager = context.getSystemService(UserManager.class);
@@ -121,7 +118,6 @@ public class BatteryDiffEntry {
return new BatteryDiffEntry(
this.mContext,
this.mForegroundUsageTimeInMs,
this.mForegroundServiceUsageTimeInMs,
this.mBackgroundUsageTimeInMs,
this.mConsumePower,
this.mForegroundUsageConsumePower,
@@ -385,14 +381,9 @@ public class BatteryDiffEntry {
mForegroundUsageConsumePower, mForegroundServiceUsageConsumePower))
.append(String.format("\n\tconsume power= background:%f cached:%f",
mBackgroundUsageConsumePower, mCachedUsageConsumePower))
.append(String.format("\n\ttime= foreground:%s foregroundService:%s background:%s",
.append(String.format("\n\ttime= foreground:%s background:%s",
StringUtil.formatElapsedTime(mContext, (double) mForegroundUsageTimeInMs,
/*withSeconds=*/ true, /*collapseTimeUnit=*/ false),
StringUtil.formatElapsedTime(
mContext,
(double) mForegroundServiceUsageTimeInMs,
/*withSeconds=*/ true,
/*collapseTimeUnit=*/ false),
StringUtil.formatElapsedTime(mContext, (double) mBackgroundUsageTimeInMs,
/*withSeconds=*/ true, /*collapseTimeUnit=*/ false)))
.append(String.format("\n\tpackage:%s|%s uid:%d userId:%d",