From 9f40baffe3ab23dddb00ab3eb18a2c72093789df Mon Sep 17 00:00:00 2001 From: Howard Chen Date: Mon, 16 Dec 2019 13:31:12 +0800 Subject: Fix the gsi_tool cmd line progress Clean the progress_ otherwise the the gsi_tool would show progress bar like below when installing the 2nd partition. write system 100% [============================================================== create product 100% [============================================================= write product 100% [============================================================= The correct one should be like below create product 100% [============================================================= write product 100% [============================================================= Bug: 146181853 Test: \ adb shell gsi_tool install -n --gsi-size $(du -b system.raw|cut -f1) -w < system.raw adb shell gsi_tool install -n --gsi-size $(du -b product.raw|cut -f1) -p product < product.raw Change-Id: I368a6ba61ca07a7298792aa4714ffc23eef64bb5 --- gsi_service.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gsi_service.cpp b/gsi_service.cpp index 8a77f4f..2214090 100644 --- a/gsi_service.cpp +++ b/gsi_service.cpp @@ -195,6 +195,7 @@ binder::Status GsiService::createPartition(const ::std::string& name, int64_t si } installer_ = std::make_unique(this, install_dir_, name, GetDsuSlot(install_dir_), size, readOnly); + progress_ = {}; int status = installer_->StartInstall(); if (status != INSTALL_OK) { installer_ = nullptr; @@ -241,6 +242,9 @@ binder::Status GsiService::getInstallProgress(::android::gsi::GsiProgress* _aidl ENFORCE_SYSTEM; std::lock_guard guard(progress_lock_); + if (installer_ == nullptr) { + progress_ = {}; + } *_aidl_return = progress_; return binder::Status::ok(); } -- cgit v1.2.3