Create shared memory region for framework APIs
System server owns a read-write mapping to this region.
App processes are initialized with a read-only mapping.
Shared memory can be used to quickly read information that's
maintained by system server from any app process, without the
overhead of Binder, where the additional features offered by
Binder IPC are not required.
Demonstrate the use of shared memory to implement network clock.
go/ApplicationSharedMemory-bluedoc
Bug: 361329788
Bug: 365575551
Change-Id: Ic7e8231355392880b34a659e8531b3bba0614b27
Flag: com.android.internal.os.application_shared_memory_enabled
Flag: android.os.network_time_uses_shared_memory
Tested: ApplicationSharedMemoryTest
Tested: SystemClockNetworkTimeTest
NO_IFTTT=adding IFTTT
diff --git a/tests/Internal/Android.bp b/tests/Internal/Android.bp
index 3e58517..9f35c7b 100644
--- a/tests/Internal/Android.bp
+++ b/tests/Internal/Android.bp
@@ -32,6 +32,27 @@
test_suites: ["device-tests"],
}
+// Run just ApplicationSharedMemoryTest with ABI override for 32 bits.
+// This is to test that on systems that support multi-ABI,
+// ApplicationSharedMemory works in app processes launched with a different ABI
+// than that of the system processes.
+android_test {
+ name: "ApplicationSharedMemoryTest32",
+ team: "trendy_team_system_performance",
+ srcs: ["src/com/android/internal/os/ApplicationSharedMemoryTest.java"],
+ libs: ["android.test.runner.stubs.system"],
+ static_libs: [
+ "junit",
+ "androidx.test.rules",
+ "platform-test-annotations",
+ ],
+ manifest: "ApplicationSharedMemoryTest32/AndroidManifest.xml",
+ test_config: "ApplicationSharedMemoryTest32/AndroidTest.xml",
+ certificate: "platform",
+ platform_apis: true,
+ test_suites: ["device-tests"],
+}
+
android_ravenwood_test {
name: "InternalTestsRavenwood",
static_libs: [
@@ -45,3 +66,9 @@
],
auto_gen_config: true,
}
+
+java_test_helper_library {
+ name: "ApplicationSharedMemoryTestRule",
+ srcs: ["src/com/android/internal/os/ApplicationSharedMemoryTestRule.java"],
+ static_libs: ["junit"],
+}