Merge changes from topic "screentime" into main
* changes: Fix summary for system components which 30 sec <= usage time < 1 min. Fix purge condition for system component in BatteryDiffData.
This commit is contained in:
@@ -670,7 +670,7 @@ public class BatteryUtils {
|
||||
long timeInMs,
|
||||
final int lessThanOneMinuteResId,
|
||||
final int normalResId) {
|
||||
if (timeInMs < DateUtils.MINUTE_IN_MILLIS) {
|
||||
if (timeInMs <= DateUtils.MINUTE_IN_MILLIS / 2) {
|
||||
return context.getString(lessThanOneMinuteResId);
|
||||
}
|
||||
final CharSequence timeSequence =
|
||||
|
||||
@@ -150,7 +150,10 @@ public class BatteryDiffData {
|
||||
final Iterator<BatteryDiffEntry> iterator = entries.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
final BatteryDiffEntry entry = iterator.next();
|
||||
final long screenOnTimeInMs = entry.mScreenOnTimeInMs;
|
||||
final long screenOnTimeInMs =
|
||||
entry.isSystemEntry()
|
||||
? entry.mForegroundUsageTimeInMs
|
||||
: entry.mScreenOnTimeInMs;
|
||||
final double comsumePower = entry.mConsumePower;
|
||||
final String packageName = entry.getPackageName();
|
||||
final Integer componentId = entry.mComponentId;
|
||||
|
||||
Reference in New Issue
Block a user