Merge "Changed ravenwood-junit to use module_current" into aosp-main-future am: 88bf750b1c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/28471674
Change-Id: If8d0e10440f0a4c86d7316f3faa80a5fb71362a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp
index e2eb09f..8d89cc1 100644
--- a/ravenwood/Android.bp
+++ b/ravenwood/Android.bp
@@ -182,6 +182,9 @@
// want to verify they're unbundled. The "impl" library above is what
// ships inside the Ravenwood environment to actually drive any API
// access to implementation details.
+// This library needs to be statically linked to mainline tests as well,
+// which need to be able to run on multiple API levels, so we can't use
+// test APIs in this module.
java_library {
name: "ravenwood-junit",
srcs: [
@@ -189,7 +192,7 @@
"junit-stub-src/**/*.java",
"junit-flag-src/**/*.java",
],
- sdk_version: "test_current",
+ sdk_version: "module_current",
static_libs: [
"ravenwood-runtime-common",
"ravenwood-runtime-common-device",
diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java
index 68b5aeb..825c91a 100644
--- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java
+++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java
@@ -18,7 +18,7 @@
import static android.os.Process.FIRST_APPLICATION_UID;
import static android.os.Process.SYSTEM_UID;
-import static android.os.UserHandle.USER_SYSTEM;
+import static android.os.UserHandle.SYSTEM;
import static org.junit.Assert.fail;
@@ -115,7 +115,7 @@
private static final AtomicInteger sNextPid = new AtomicInteger(100);
- int mCurrentUser = USER_SYSTEM;
+ int mCurrentUser = SYSTEM.getIdentifier();
/**
* Unless the test author requests differently, run as "nobody", and give each collection of