Replace StatusOr<T> with Result<T>
Bug: 133494354
Test: builds successfully
Test: atest apexservice_test
Change-Id: I49bd2797106fdc91205e76222120ce98ea021ecd
Merged-In: I49bd2797106fdc91205e76222120ce98ea021ecd
(cherry picked from commit 137fc81fb2346aa5f9cce9360cd78167b98f8487)
diff --git a/cmds/installd/otapreopt_chroot.cpp b/cmds/installd/otapreopt_chroot.cpp
index e8f513a..0c4badf 100644
--- a/cmds/installd/otapreopt_chroot.cpp
+++ b/cmds/installd/otapreopt_chroot.cpp
@@ -72,9 +72,10 @@
static void DeactivateApexPackages(const std::vector<apex::ApexFile>& active_packages) {
for (const apex::ApexFile& apex_file : active_packages) {
const std::string& package_path = apex_file.GetPath();
- apex::Status status = apex::deactivatePackage(package_path);
- if (!status.Ok()) {
- LOG(ERROR) << "Failed to deactivate " << package_path << ": " << status.ErrorMessage();
+ base::Result<void> status = apex::deactivatePackage(package_path);
+ if (!status) {
+ LOG(ERROR) << "Failed to deactivate " << package_path << ": "
+ << status.error();
}
}
}