Rework progressbar logic, implement scoped/split progressbar

Rework progressbar according to AOSP, this should fix various
issues with progressbar.

From AOSP:

   progress <frac> <secs>
       fill up the next <frac> part of of the progress bar over <secs> seconds. If <secs> is
       zero, use `set_progress` commands to manually control the progress of this segment of the
       bar.

   set_progress <frac>
       <frac> should be between 0.0 and 1.0; sets the progress bar within the segment defined by
       the most recent progress command.

Change-Id: I7f92359046288f3529cb2e98e6d54d410a248f1d
(cherry picked from commit ab16437de14fd9f1203b7e0ce82ea18eb56cae78)
This commit is contained in:
Chaosmaster
2020-05-19 14:45:22 +00:00
committed by bigbiff
parent 7b66bf503f
commit d5364a0b21
4 changed files with 53 additions and 8 deletions
+6
View File
@@ -370,6 +370,8 @@ int GUIAction::flash_zip(std::string filename, int* wipe_cache)
int ret_val = 0;
DataManager::SetValue("ui_progress", 0);
DataManager::SetValue("ui_portion_size", 0);
DataManager::SetValue("ui_portion_start", 0);
if (filename.empty())
{
@@ -409,6 +411,8 @@ int GUIAction::flash_zip(std::string filename, int* wipe_cache)
// Done
DataManager::SetValue("ui_progress", 100);
DataManager::SetValue("ui_progress", 0);
DataManager::SetValue("ui_portion_size", 0);
DataManager::SetValue("ui_portion_start", 0);
return ret_val;
}
@@ -491,6 +495,8 @@ void GUIAction::operation_start(const string operation_name)
time(&Start);
DataManager::SetValue(TW_ACTION_BUSY, 1);
DataManager::SetValue("ui_progress", 0);
DataManager::SetValue("ui_portion_size", 0);
DataManager::SetValue("ui_portion_start", 0);
DataManager::SetValue("tw_operation", operation_name);
DataManager::SetValue("tw_operation_state", 0);
DataManager::SetValue("tw_operation_status", 0);