summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Zhi Dou <zhidou@google.com> 2024-01-09 19:51:11 +0000
committer Zhi Dou <zhidou@google.com> 2024-01-09 21:22:21 +0000
commit9e1a2d7e7956b84b04246d4d69a5c3d0045100b7 (patch)
treed2cb796aae7b075f5441572dfe4972dc1b22005f
parent9fded33b7eb76a3d0328b5788defeed508de34f5 (diff)
Explicitly set SetFlagsRule with NULL_DEFAULT
The default behavior of SetFlagsRule has been changed to DEVICE_DEFAULT which will load the default value from the device. These two tests requires to use the previous default behavior. Explicitly set the default behavior as NULL_DEFAULT. Test: atest FrameworksMockingServicesTests:com.android.server.app.GameManagerServiceTests FrameworksCoreTestsRavenwood Bug: 319266584 Bug: 319262520 Change-Id: I871f9572da556f6c4feb84b6ce85f8c533e2bdd0
-rw-r--r--core/tests/coretests/src/android/os/BuildTest.java3
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java3
2 files changed, 4 insertions, 2 deletions
diff --git a/core/tests/coretests/src/android/os/BuildTest.java b/core/tests/coretests/src/android/os/BuildTest.java
index 3162e6da15c5..2d3e12331e23 100644
--- a/core/tests/coretests/src/android/os/BuildTest.java
+++ b/core/tests/coretests/src/android/os/BuildTest.java
@@ -45,7 +45,8 @@ public class BuildTest {
public final RavenwoodRule mRavenwood = new RavenwoodRule();
@Rule
- public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+ public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(
+ SetFlagsRule.DefaultInitValueType.NULL_DEFAULT);
/**
* Asserts that a String is non-null and non-empty. If it is not,
diff --git a/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java b/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java
index fc2e5b0981e4..0703db2ab648 100644
--- a/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java
+++ b/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java
@@ -118,7 +118,8 @@ import java.util.function.Supplier;
@Presubmit
public class GameManagerServiceTests {
@Mock MockContext mMockContext;
- @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+ @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(
+ SetFlagsRule.DefaultInitValueType.NULL_DEFAULT);
private static final String TAG = "GameManagerServiceTests";
private static final String PACKAGE_NAME_INVALID = "com.android.app";
private static final int USER_ID_1 = 1001;