aboutsummaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2014-09-12 18:52:28 -0700
committerTom Marshall <tdm@cyngn.com>2015-11-25 15:35:22 -0800
commitf868d833885bd6118b13eae5a7347f9dd9aeda75 (patch)
tree0acd839eb7e4008ff1ad137ae610afd0fdeb85bb /recovery.cpp
parent8e614b89838dda1adff952c0bfbb02721bb5db2b (diff)
downloadbootable_recovery-f868d833885bd6118b13eae5a7347f9dd9aeda75.zip
bootable_recovery-f868d833885bd6118b13eae5a7347f9dd9aeda75.tar.gz
bootable_recovery-f868d833885bd6118b13eae5a7347f9dd9aeda75.tar.bz2
sr: Fix the progress bar
* The progress thread is running all the time, which causes the device to heat up while in recovery. Start this thread only when the progress mode is set to something other than EMPTY, and add a terminating condition so that it exits when finished. * Incorporate Tom's patch to keep it updated when visible, since both are needed to get working progress indications without killing batteries. * Clear buffer in draw_progress_locked() and always call this in update_progress_locked(). This is necessary to ensure that all backing frames in the graphics implementation get updated because we aren't guaranteed to have any particular number of backing frames. * Remove dialogs on wipe operations since we are using the progress animation now. * Set progress indicator after showing "Formatting" text to avoid momentary flicker. Change-Id: Ib70d2cb25f01d9920ffb698b5b5b47af827ef483
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/recovery.cpp b/recovery.cpp
index f260854..f1c65ce 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -554,9 +554,6 @@ typedef struct _saved_log_file {
static bool erase_volume(const char* volume, bool force = false) {
bool is_cache = (strcmp(volume, CACHE_ROOT) == 0);
- ui->SetBackground(RecoveryUI::ERASING);
- ui->SetProgressType(RecoveryUI::INDETERMINATE);
-
saved_log_file* head = NULL;
if (!force && is_cache) {
@@ -606,6 +603,9 @@ static bool erase_volume(const char* volume, bool force = false) {
ui->Print("Formatting %s...\n", volume);
+ ui->SetBackground(RecoveryUI::ERASING);
+ ui->SetProgressType(RecoveryUI::INDETERMINATE);
+
if (volume[0] == '/') {
ensure_path_unmounted(volume);
}
@@ -870,15 +870,8 @@ static bool wipe_cache(bool should_confirm, Device* device) {
modified_flash = true;
ui->Print("\n-- Wiping cache...\n");
- ui->DialogShowInfo("Wiping cache ...");
bool success = erase_volume("/cache");
ui->Print("Cache wipe %s.\n", success ? "complete" : "failed");
- if (!should_confirm || success) {
- ui->DialogDismiss();
- }
- else {
- ui->DialogShowErrorLog("Cache wipe failed");
- }
return success;
}