USE_RELAXED_MICRODROID_ROLLBACK_PROTECTION: also add i18 apex
This is a hack for this release. It will be removed once we've added a
@SystemApi to load additional apexes to Microdroid pVMs.
This patch also adds a simple test to assert that com.android.i18n APEX
is correctly mounted. However, this test is not enough as we should also
assert that payload can actually use libraries provided by the APEX.
This will be done in a follow up patch.
Bug: 378681279
Bug: 390557313
Test: atest MicrodroidTests
Test: presubmit
Change-Id: I6f7013f9e5c693e72d7a9151d78d06401e4159f6
diff --git a/tests/testapk/src/native/testbinary.cpp b/tests/testapk/src/native/testbinary.cpp
index 2ab73a4..c3904b7 100644
--- a/tests/testapk/src/native/testbinary.cpp
+++ b/tests/testapk/src/native/testbinary.cpp
@@ -384,6 +384,20 @@
}
}
+ ScopedAStatus checkLibIcuIsAccessible() override {
+ static constexpr const char* kLibIcuPath = "/apex/com.android.i18n/lib64/libicu.so";
+ if (access(kLibIcuPath, R_OK) == 0) {
+ // TODO(ioffe): call an API provided by libicu.so and check that it returns expected
+ // value.
+ return ScopedAStatus::ok();
+ } else {
+ std::string msg = "failed to access " + std::string(kLibIcuPath) + "(" +
+ std::to_string(errno) + ")";
+ return ScopedAStatus::fromExceptionCodeWithMessage(EX_SERVICE_SPECIFIC,
+ msg.c_str());
+ }
+ }
+
ScopedAStatus quit() override { exit(0); }
};
auto testService = ndk::SharedRefBase::make<TestService>();