summaryrefslogtreecommitdiff
path: root/gsi_service.cpp
diff options
context:
space:
mode:
authorYo Chiang <yochiang@google.com>2020-08-24 17:25:26 +0800
committerYo Chiang <yochiang@google.com>2020-08-24 10:04:59 +0000
commit99ab518ed6b7fae95ba29b132227f993e0a099d0 (patch)
tree397361d51990990440e2241eb51119069d16162e /gsi_service.cpp
parentf194dcec2e4508ecd7055b087e611e14e074885a (diff)
downloadgsid-99ab518ed6b7fae95ba29b132227f993e0a099d0.tar.gz
GsiService::enableGsi() checks return code of FinishInstall()
If enabling a freshly installed GSI, GsiService::enableGsi() should call FinishInstall() to check if the installation completes successfully. Bug: 165471299 Test: Observe logcat when DSU installation fails Test: DsuEndToEndTest Change-Id: I3e2832322b272506f748fdd9e1ff60c6317ef42b
Diffstat (limited to 'gsi_service.cpp')
-rw-r--r--gsi_service.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gsi_service.cpp b/gsi_service.cpp
index 1bcd3dc..490655c 100644
--- a/gsi_service.cpp
+++ b/gsi_service.cpp
@@ -272,7 +272,13 @@ binder::Status GsiService::enableGsi(bool one_shot, const std::string& dsuSlot,
}
if (installer_) {
ENFORCE_SYSTEM;
+ int status = installer_->FinishInstall();
installer_ = {};
+ if (status != IGsiService::INSTALL_OK) {
+ *_aidl_return = status;
+ LOG(ERROR) << "Installation failed, cannot enable DSU for slot: " << dsuSlot;
+ return binder::Status::ok();
+ }
// Note: create the install status file last, since this is the actual boot
// indicator.
if (!SetBootMode(one_shot) || !CreateInstallStatusFile()) {