diff options
author | Yo Chiang <yochiang@google.com> | 2020-08-24 17:25:26 +0800 |
---|---|---|
committer | Yo Chiang <yochiang@google.com> | 2020-08-24 10:04:59 +0000 |
commit | 99ab518ed6b7fae95ba29b132227f993e0a099d0 (patch) | |
tree | 397361d51990990440e2241eb51119069d16162e /gsi_service.cpp | |
parent | f194dcec2e4508ecd7055b087e611e14e074885a (diff) | |
download | gsid-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.cpp | 6 |
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()) { |