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
diff --git a/core/tests/coretests/src/android/os/BuildTest.java b/core/tests/coretests/src/android/os/BuildTest.java
index 3162e6d..2d3e123 100644
--- a/core/tests/coretests/src/android/os/BuildTest.java
+++ b/core/tests/coretests/src/android/os/BuildTest.java
@@ -45,7 +45,8 @@
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 fc2e5b0..0703db2 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 @@
@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;