From 99ab518ed6b7fae95ba29b132227f993e0a099d0 Mon Sep 17 00:00:00 2001 From: Yo Chiang Date: Mon, 24 Aug 2020 17:25:26 +0800 Subject: 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 --- gsi_service.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gsi_service.cpp') 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()) { -- cgit v1.2.3