summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Orion Hodson <oth@google.com> 2021-05-07 14:14:42 +0100
committer Orion Hodson <oth@google.com> 2021-05-10 08:39:02 +0000
commit816cab342a8db032b660018d4c933032a326b5c8 (patch)
treedff85eeb5a05c1cca9cc281751489d138175ded0
parent263c39eaef07d56a34f853320dae76ab5693c377 (diff)
odrefresh: log an error if updatable_bcp_packages file is missing
Compilation of system_server JARs will fail if updatable_bcp_packages file is missing. Bug: 187494247 Test: manual ART APEX update Change-Id: I9e8ead0d42ff889bdcb99042c5c83fd581be4f75
-rw-r--r--odrefresh/odrefresh.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/odrefresh/odrefresh.cc b/odrefresh/odrefresh.cc
index a1d4e54b38..218e07e18a 100644
--- a/odrefresh/odrefresh.cc
+++ b/odrefresh/odrefresh.cc
@@ -1157,7 +1157,14 @@ class OnDeviceRefresh final {
args.emplace_back("--oat-location=" + artifacts.OatPath());
if (!config_.GetUpdatableBcpPackagesFile().empty()) {
- args.emplace_back("--updatable-bcp-packages-file=" + config_.GetUpdatableBcpPackagesFile());
+ const std::string& bcp_packages = config_.GetUpdatableBcpPackagesFile();
+ if (!OS::FileExists(bcp_packages.c_str())) {
+ *error_msg = "Cannot compile system_server JARs: missing " + QuotePath(bcp_packages);
+ metrics.SetStatus(OdrMetrics::Status::kIoError);
+ EraseFiles(staging_files);
+ return false;
+ }
+ args.emplace_back("--updatable-bcp-packages-file=" + bcp_packages);
}
args.emplace_back("--runtime-arg");