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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18496890

Change-Id: Ia1fa9e4428e85171e1f13d8bb3284d0334c203b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sudheer Shanka
2022-05-20 19:09:14 +00:00
committed by Automerger Merge Worker

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;
}