diff options
author | Yi-Yo Chiang <yochiang@google.com> | 2021-02-12 02:17:03 +0800 |
---|---|---|
committer | Yo Chiang <yochiang@google.com> | 2021-02-18 04:37:36 +0000 |
commit | c4d64008ac77f150e7d5191a6da1f59699f0f7dc (patch) | |
tree | 6678c8767dffcae8671f2a62f86b618f43e56b5a /gsi_service.cpp | |
parent | 23a996fde114247e6f2f67df37d955a640e9775b (diff) | |
download | gsid-c4d64008ac77f150e7d5191a6da1f59699f0f7dc.tar.gz |
gsid: Make createPartition() don't preempttively clear installer_android-s-preview-1
As enableGsi() uses the nullness of installer_ to decide if an on-going
installation is happening, we shouldn't clear installer_ in
createPartition() no matter what.
Even when the installation failed to start, we should still leave
installer_ pointing to an useless installation session, so that the
caller can have a chance to handle the error state.
I think we probably need a dedicated variable to indicate the
installation state, so we can tell these subtle differences easier.
Bug: 165925766
Bug: 179980369
Test: Verify that DSU installation completes successfully even when
scratch failed to be installed.
Change-Id: I7b465ac8a83859db45fc9c1a64eabfb76d780aee
Diffstat (limited to 'gsi_service.cpp')
-rw-r--r-- | gsi_service.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/gsi_service.cpp b/gsi_service.cpp index 66e01ee..e4052b2 100644 --- a/gsi_service.cpp +++ b/gsi_service.cpp @@ -173,9 +173,6 @@ binder::Status GsiService::createPartition(const ::std::string& name, int64_t si return binder::Status::ok(); } - // Make sure a pending interrupted installations are cleaned up. - installer_ = nullptr; - // Do some precursor validation on the arguments before diving into the // install process. if (size % LP_SECTOR_SIZE) { @@ -202,11 +199,7 @@ binder::Status GsiService::createPartition(const ::std::string& name, int64_t si installer_ = std::make_unique<PartitionInstaller>(this, install_dir_, name, GetDsuSlot(install_dir_), size, readOnly); progress_ = {}; - int status = installer_->StartInstall(); - if (status != INSTALL_OK) { - installer_ = nullptr; - } - *_aidl_return = status; + *_aidl_return = installer_->StartInstall(); return binder::Status::ok(); } |