diff options
author | Yo Chiang <yochiang@google.com> | 2020-08-24 16:50:20 +0800 |
---|---|---|
committer | Yo Chiang <yochiang@google.com> | 2020-08-24 16:50:20 +0800 |
commit | 281584b0709f64b5ee224f70944512753072bb3b (patch) | |
tree | 50d8888e401c733ae53d601daf5135cc0b739870 /partition_installer.cpp | |
parent | 60bbc030e129d8e160044bebfd2f8c04abe0ffd9 (diff) | |
download | gsid-281584b0709f64b5ee224f70944512753072bb3b.tar.gz |
Check install status in ~PartitionInstaller()
~PartitionInstaller() should check the error code returned by Finish()
and clean up the installed images if any error occured.
Bug: 165471299
Test: Observe logcat when DSU installation fails
Change-Id: If977b4da0f37a0706494259838c84bcd2752ed94
Diffstat (limited to 'partition_installer.cpp')
-rw-r--r-- | partition_installer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/partition_installer.cpp b/partition_installer.cpp index 357df50..4de181e 100644 --- a/partition_installer.cpp +++ b/partition_installer.cpp @@ -56,8 +56,9 @@ PartitionInstaller::PartitionInstaller(GsiService* service, const std::string& i } PartitionInstaller::~PartitionInstaller() { - Finish(); - if (!succeeded_) { + if (Finish() != IGsiService::INSTALL_OK || !succeeded_) { + LOG(ERROR) << "Installation failed: install_dir=" << install_dir_ + << ", dsu_slot=" << active_dsu_ << ", partition_name=" << name_; // Close open handles before we remove files. system_device_ = nullptr; PostInstallCleanup(images_.get()); |