Merge "Don't change bucketing reason if app is already in better bucket." into tm-dev

This commit is contained in:
Sudheer Shanka
2022-05-20 17:54:38 +00:00
committed by Android (Google) Code Review

View File

@@ -328,11 +328,13 @@ public class AppIdleHistory {
appUsageHistory.lastUsedScreenTime = getScreenOnTime(nowElapsedRealtimeMs);
}
if (appUsageHistory.currentBucket > newBucket) {
appUsageHistory.currentBucket = newBucket;
logAppStandbyBucketChanged(packageName, userId, newBucket, bucketingReason);
if (appUsageHistory.currentBucket >= newBucket) {
if (appUsageHistory.currentBucket > newBucket) {
appUsageHistory.currentBucket = newBucket;
logAppStandbyBucketChanged(packageName, userId, newBucket, bucketingReason);
}
appUsageHistory.bucketingReason = bucketingReason;
}
appUsageHistory.bucketingReason = bucketingReason;
return appUsageHistory;
}