From b77f36b021b37da2336ef84875128b896aea7512 Mon Sep 17 00:00:00 2001 From: Jing Ji Date: Sat, 19 Mar 2022 01:22:19 -0700 Subject: [PATCH] Add missing parameters in BackgroundRestrictionTest Bug: 203105544 Test: FrameworksMockingServicesTests:BackgroundRestrictionTest Change-Id: Icdc74b8bb4b3f2e0c03e8e78ae55f1aaf18acb63 --- .../android/server/am/BackgroundRestrictionTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java b/services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java index e0ab25bad12a6..d44fb3bc2448b 100644 --- a/services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java +++ b/services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java @@ -1899,7 +1899,7 @@ public final class BackgroundRestrictionTest { bgBatteryExemptionTypes.set(STATE_TYPE_FGS_WITH_NOTIFICATION); // Start over. resetBgRestrictionController(); - setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros); + setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros, zeros); mAppBatteryPolicy.reset(); // Run with a FGS with notification posted/removed immediately, we should @@ -1908,16 +1908,16 @@ public final class BackgroundRestrictionTest { FOREGROUND_SERVICE_TYPE_NONE, 0, true, true, null, null, null, listener, stats, uids, new double[]{restrictBucketThresholdMah + 1, 0}, - new double[]{0, restrictBucketThresholdMah - 1}, zeros, + new double[]{0, restrictBucketThresholdMah - 1}, zeros, zeros, false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true, - null, windowMs, null, null, null); + null, windowMs, null, null, null, null); // Run with a service with notification for extended time. We should be back to normal. runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1, FOREGROUND_SERVICE_TYPE_NONE, bgMediaPlaybackMinDuration * 2, false, true, null, null, null, listener, stats, uids, new double[]{restrictBucketThresholdMah + 1, 0}, - new double[]{0, restrictBucketThresholdMah - 1}, zeros, + new double[]{0, restrictBucketThresholdMah - 1}, zeros, zeros, true, RESTRICTION_LEVEL_ADAPTIVE_BUCKET, timeout, false, () -> { // A user interaction will bring it back to normal. @@ -1934,7 +1934,7 @@ public final class BackgroundRestrictionTest { eq(REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE), eq(REASON_MAIN_USAGE), eq(REASON_SUB_USAGE_USER_INTERACTION)); - }, windowMs, null, null, null); + }, windowMs, null, null, null, null); // Set the policy to exempt all. bgBatteryExemptionTypes.set(STATE_TYPE_MEDIA_SESSION | STATE_TYPE_FGS_MEDIA_PLAYBACK