Only note restrictions attempts for RESTRICTED bucket.
We don't want to put an app in the RESTRICTED bucket too soon after a user has used the app. If the system attempts to restrict the app (probably through the restrictApp() API), and the user has recently used the app, then we'll note the restriction attempt and delay putting the app into the bucket until our min delay time has passed. Now, we make sure to only note the restriction attempt when the bucket is the RESTRICTED bucket. Bug: 223863858 Test: atest FrameworksMockingServicesTests:AppStandbyControllerTests Change-Id: Iaf6647bfd8a72206f2b80df8b21d2446f4eeb291
This commit is contained in:
@@ -1573,8 +1573,10 @@ public class AppStandbyController
|
||||
(reason & REASON_MAIN_MASK) == REASON_MAIN_FORCED_BY_SYSTEM;
|
||||
|
||||
if (app.currentBucket == newBucket && wasForcedBySystem && isForcedBySystem) {
|
||||
mAppIdleHistory
|
||||
.noteRestrictionAttempt(packageName, userId, elapsedRealtime, reason);
|
||||
if (newBucket == STANDBY_BUCKET_RESTRICTED) {
|
||||
mAppIdleHistory
|
||||
.noteRestrictionAttempt(packageName, userId, elapsedRealtime, reason);
|
||||
}
|
||||
// Keep track of all restricting reasons
|
||||
reason = REASON_MAIN_FORCED_BY_SYSTEM
|
||||
| (app.bucketingReason & REASON_SUB_MASK)
|
||||
|
||||
Reference in New Issue
Block a user