Merge "Do not use --exclude-libs linker flag for Windows"
diff --git a/cppreopts/cppreopts.rc b/cppreopts/cppreopts.rc
index 4ce04c5..812b4ce 100644
--- a/cppreopts/cppreopts.rc
+++ b/cppreopts/cppreopts.rc
@@ -18,8 +18,17 @@
user root
capabilities
-on property:sys.cppreopt=requested
+# Post install is above Treble VINTF, because it runs some utilities from
+# /system. Therefore, the fstab can only be in either /system or /product.
+on property:sys.cppreopt=requested && property:ro.postinstall.fstab.prefix=/system
mount_all /system/etc/fstab.postinstall
+ setprop sys.cppreopt mounted
+
+on property:sys.cppreopt=requested && property:ro.postinstall.fstab.prefix=/product
+ mount_all /product/etc/fstab.postinstall
+ setprop sys.cppreopt mounted
+
+on property:sys.cppreopt=mounted
exec_start cppreopts
# Optional script to copy additional preloaded content to data directory
exec - system system -- /system/bin/preloads_copy.sh /postinstall
diff --git a/libfscrypt/fscrypt_init_extensions.cpp b/libfscrypt/fscrypt_init_extensions.cpp
index 2291c14..9781267 100644
--- a/libfscrypt/fscrypt_init_extensions.cpp
+++ b/libfscrypt/fscrypt_init_extensions.cpp
@@ -87,7 +87,7 @@
"vendor_ce", "vendor_de",
"media",
"data", "user", "user_de",
- "apex", "preloads", "pkg_staging",
+ "apex", "preloads", "app-staging",
"gsi",
};
std::string prefix = "/data/";
diff --git a/libjsonpb/verify/include/jsonpb/json_schema_test.h b/libjsonpb/verify/include/jsonpb/json_schema_test.h
index 9a62ea9..3db1931 100644
--- a/libjsonpb/verify/include/jsonpb/json_schema_test.h
+++ b/libjsonpb/verify/include/jsonpb/json_schema_test.h
@@ -17,6 +17,8 @@
#pragma once
+#include <unistd.h>
+
#include <memory>
#include <string>
@@ -41,12 +43,11 @@
virtual ~JsonSchemaTestConfig() = default;
virtual std::unique_ptr<google::protobuf::Message> CreateMessage() const = 0;
virtual std::string file_path() const = 0;
- virtual std::string GetFileContent() const {
- std::string content;
- if (!android::base::ReadFileToString(file_path(), &content)) {
- return "";
- }
- return content;
+ /**
+ * If it returns true, tests are skipped when the file is not found.
+ */
+ virtual bool optional() const {
+ return false;
}
};
using JsonSchemaTestConfigFactory =
@@ -79,11 +80,19 @@
auto&& config =
::testing::TestWithParam<JsonSchemaTestConfigFactory>::GetParam()();
file_path_ = config->file_path();
- json_ = config->GetFileContent();
- ASSERT_FALSE(json_.empty()) << "Cannot read " << config->file_path();
+
+ if (access(file_path_.c_str(), F_OK) == -1) {
+ ASSERT_EQ(ENOENT, errno) << "File '" << file_path_ << "' is not accessible: "
+ << strerror(errno);
+ ASSERT_TRUE(config->optional()) << "Missing mandatory file " << file_path_;
+ GTEST_SKIP();
+ }
+ ASSERT_TRUE(android::base::ReadFileToString(file_path_, &json_));
+ ASSERT_FALSE(json_.empty()) << "File '" << file_path_ << "' exists but is empty";
+
object_ = config->CreateMessage();
auto res = internal::JsonStringToMessage(json_, object_.get());
- ASSERT_TRUE(res.ok()) << "Invalid format of file " << config->file_path()
+ ASSERT_TRUE(res.ok()) << "Invalid format of file " << file_path_
<< ": " << res.error();
}
google::protobuf::Message* message() const {