[Ravenwood] Internal clean up, more PFD APIs, OsConstants, etc
- Support a few more ParcelFileDescriptor APIs.
- Support OsConstants and a couple of Os APIs.
- Also clean up f/b/ravenwood. Now we have "runtime-common" library
that can be used from different components of Ravenwood infra,
with native code support.
Bug: 292141694
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
Test: CtsOsTestCases (on tree hugger)
Flag: EXEMPT hostside test change only
Change-Id: I259a04201e05e615e17da0529cb500a102887ec9
diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp
index 95cbb6b..48bc803 100644
--- a/ravenwood/Android.bp
+++ b/ravenwood/Android.bp
@@ -56,11 +56,52 @@
visibility: ["//visibility:public"],
}
+// This and the next module contain the same classes with different implementations.
+// "ravenwood-runtime-common-device" will be statically linked in device side tests.
+// "ravenwood-runtime-common-ravenwood" will only exist in ravenwood-runtime, which will take
+// precedence even if the test jar (accidentally) contains "ravenwood-runtime-common-device".
+// "ravenwood-runtime-common" uses it to detect if the rutime is Ravenwood or not.
+java_library {
+ name: "ravenwood-runtime-common-ravenwood",
+ host_supported: true,
+ sdk_version: "core_current",
+ srcs: [
+ "runtime-common-ravenwood-src/**/*.java",
+ ],
+ visibility: ["//frameworks/base"],
+}
+
+java_library {
+ name: "ravenwood-runtime-common-device",
+ host_supported: true,
+ sdk_version: "core_current",
+ srcs: [
+ "runtime-common-device-src/**/*.java",
+ ],
+ visibility: ["//visibility:private"],
+}
+
+java_library {
+ name: "ravenwood-runtime-common",
+ host_supported: true,
+ sdk_version: "core_current",
+ srcs: [
+ "runtime-common-src/**/*.java",
+ ],
+ libs: [
+ "ravenwood-runtime-common-ravenwood",
+ ],
+ visibility: ["//visibility:private"],
+}
+
java_library_host {
name: "ravenwood-helper-libcore-runtime.host",
srcs: [
"runtime-helper-src/libcore-fake/**/*.java",
],
+ static_libs: [
+ "ravenwood-runtime-common",
+ ],
visibility: ["//visibility:private"],
}
@@ -77,6 +118,9 @@
srcs: [
"runtime-helper-src/framework/**/*.java",
],
+ static_libs: [
+ "ravenwood-runtime-common",
+ ],
libs: [
"framework-minus-apex.ravenwood",
"ravenwood-junit",
@@ -105,6 +149,7 @@
],
static_libs: [
"androidx.test.monitor-for-device",
+ "ravenwood-runtime-common",
],
libs: [
"android.test.mock",
@@ -145,6 +190,10 @@
"junit-flag-src/**/*.java",
],
sdk_version: "test_current",
+ static_libs: [
+ "ravenwood-runtime-common",
+ "ravenwood-runtime-common-device",
+ ],
libs: [
"junit",
"flag-junit",
@@ -199,7 +248,7 @@
],
srcs: [
- "runtime-helper-src/jni/*.cpp",
+ "runtime-jni/*.cpp",
],
shared_libs: [