From 9e1a2d7e7956b84b04246d4d69a5c3d0045100b7 Mon Sep 17 00:00:00 2001 From: Zhi Dou Date: Tue, 9 Jan 2024 19:51:11 +0000 Subject: 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 --- core/tests/coretests/src/android/os/BuildTest.java | 3 ++- .../src/com/android/server/app/GameManagerServiceTests.java | 3 ++- 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; -- cgit v1.2.3-59-g8ed1b