From 20605110c49791355f228a9097dc294c720bec7b Mon Sep 17 00:00:00 2001 From: Xiang Wang Date: Mon, 28 Nov 2022 12:01:45 -0800 Subject: [PATCH] Include public GameManager unit tests in presubmit Switch to use non system uid and grant necessary permission as otherwise it will crash the test mapping (b/260071873), this was explained in b/140028487 and a similar fix was done in ag/9523307. Bug: b/243448953 Test: atest --test-mapping \ services/core/java/com/android/server/app:presubmit Change-Id: I93bcc3c9d462fb4a2f90acc5c80ae1bcbc255927 --- core/java/android/app/TEST_MAPPING | 17 +++++++++++++++++ core/tests/GameManagerTests/AndroidManifest.xml | 4 +++- .../java/com/android/server/app/TEST_MAPPING | 17 +++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/core/java/android/app/TEST_MAPPING b/core/java/android/app/TEST_MAPPING index ef10c0b245d1b..f133c8aa58996 100644 --- a/core/java/android/app/TEST_MAPPING +++ b/core/java/android/app/TEST_MAPPING @@ -201,6 +201,23 @@ "file_patterns": [ "(/|^)PropertyInvalidatedCache.java" ] + }, + { + "name": "FrameworksCoreGameManagerTests", + "options": [ + { + "exclude-annotation": "androidx.test.filters.FlakyTest" + }, + { + "exclude-annotation": "org.junit.Ignore" + }, + { + "include-filter": "android.app" + } + ], + "file_patterns": [ + "(/|^)GameManager[^/]*", "(/|^)GameMode[^/]*" + ] } ], "presubmit-large": [ diff --git a/core/tests/GameManagerTests/AndroidManifest.xml b/core/tests/GameManagerTests/AndroidManifest.xml index 6a01abee3e1cc..f1ab6969e99f6 100644 --- a/core/tests/GameManagerTests/AndroidManifest.xml +++ b/core/tests/GameManagerTests/AndroidManifest.xml @@ -17,7 +17,9 @@ + android:sharedUserId="com.android.uid.test" > + + diff --git a/services/core/java/com/android/server/app/TEST_MAPPING b/services/core/java/com/android/server/app/TEST_MAPPING index 0ba4d8c355231..feb2b4fc68506 100644 --- a/services/core/java/com/android/server/app/TEST_MAPPING +++ b/services/core/java/com/android/server/app/TEST_MAPPING @@ -18,6 +18,23 @@ "exclude-annotation": "androidx.test.filters.FlakyTest" } ] + }, + { + "name": "FrameworksCoreGameManagerTests", + "options": [ + { + "exclude-annotation": "androidx.test.filters.FlakyTest" + }, + { + "exclude-annotation": "org.junit.Ignore" + }, + { + "include-filter": "android.app" + } + ], + "file_patterns": [ + "(/|^)GameManagerService.java", "(/|^)GameManagerSettings.java" + ] } ] } \ No newline at end of file