summaryrefslogtreecommitdiff
path: root/apexd/apex_shim.cpp
diff options
context:
space:
mode:
authorBernie Innocenti <codewiz@google.com>2020-02-06 22:01:51 +0900
committerBernie Innocenti <codewiz@google.com>2020-02-09 03:59:07 +0900
commitd04d5d0790feac25d86c1031036da3787c4f0307 (patch)
tree4228455ad51823fa7324a8fb33029708f77ad213 /apexd/apex_shim.cpp
parentf2989addaf762b252d80eb2bc479fa3e649f8278 (diff)
Convert system/apex to Result::ok()
No functionality changes, this is a mechanical cleanup. Test: cd system/apexd && m Change-Id: I479084b9d1101b86c2e8d7ed631feba3edcedd8e
Diffstat (limited to 'apexd/apex_shim.cpp')
-rw-r--r--apexd/apex_shim.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/apexd/apex_shim.cpp b/apexd/apex_shim.cpp
index f8b9756..ea58a32 100644
--- a/apexd/apex_shim.cpp
+++ b/apexd/apex_shim.cpp
@@ -95,7 +95,7 @@ Result<std::vector<std::string>> GetAllowedHashes(const std::string& path) {
std::vector<std::string> allowed_hashes = android::base::Split(hash, "\n");
auto system_shim_hash = CalculateSha512(
StringPrintf("%s/%s", kApexPackageSystemDir, shim::kSystemShimApexName));
- if (!system_shim_hash) {
+ if (!system_shim_hash.ok()) {
return system_shim_hash.error();
}
allowed_hashes.push_back(std::move(*system_shim_hash));
@@ -167,11 +167,11 @@ Result<void> ValidateUpdate(const std::string& system_apex_path,
LOG(DEBUG) << "Validating update of shim apex to " << new_apex_path
<< " using system shim apex " << system_apex_path;
auto allowed = GetAllowedHashes(system_apex_path);
- if (!allowed) {
+ if (!allowed.ok()) {
return allowed.error();
}
auto actual = CalculateSha512(new_apex_path);
- if (!actual) {
+ if (!actual.ok()) {
return actual.error();
}
auto it = std::find(allowed->begin(), allowed->end(), *actual);