Merge "Fix battery usage chart error when daylight saving."
This commit is contained in:
committed by
Android (Google) Code Review
commit
1b73b6c63b
@@ -99,10 +99,10 @@ public final class DataProcessor {
|
||||
static boolean sDebug = false;
|
||||
|
||||
@VisibleForTesting
|
||||
static long sFakeCurrentTimeMillis = 0;
|
||||
static long sTestCurrentTimeMillis = 0;
|
||||
|
||||
@VisibleForTesting
|
||||
static Set<String> sFakeSystemAppsSet;
|
||||
static Set<String> sTestSystemAppsSet;
|
||||
|
||||
@VisibleForTesting
|
||||
static IUsageStatsManager sUsageStatsManager =
|
||||
@@ -539,7 +539,7 @@ public final class DataProcessor {
|
||||
}
|
||||
while (nextDay < endTime) {
|
||||
dailyTimestampList.add(nextDay);
|
||||
nextDay += DateUtils.DAY_IN_MILLIS;
|
||||
nextDay = getTimestampOfNextDay(nextDay);
|
||||
}
|
||||
final long lastDailyTimestamp = dailyTimestampList.get(dailyTimestampList.size() - 1);
|
||||
// Only if the timestamp diff in the last day is bigger than MIN_TIME_SLOT, add the
|
||||
@@ -1900,12 +1900,12 @@ public final class DataProcessor {
|
||||
}
|
||||
|
||||
private static Set<String> getSystemAppsSet(Context context) {
|
||||
return sFakeSystemAppsSet != null ? sFakeSystemAppsSet
|
||||
return sTestSystemAppsSet != null ? sTestSystemAppsSet
|
||||
: AppListRepositoryUtil.getSystemPackageNames(context, context.getUserId(), false);
|
||||
}
|
||||
|
||||
private static long getCurrentTimeMillis() {
|
||||
return sFakeCurrentTimeMillis > 0 ? sFakeCurrentTimeMillis : System.currentTimeMillis();
|
||||
return sTestCurrentTimeMillis > 0 ? sTestCurrentTimeMillis : System.currentTimeMillis();
|
||||
}
|
||||
|
||||
private static void log(Context context, final String content, final long timestamp,
|
||||
|
Reference in New Issue
Block a user