summaryrefslogtreecommitdiffstats
path: root/screen_ui.cpp
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2012-04-26 23:37:53 +0200
committerDoug Zongker <dougz@android.com>2012-04-26 23:37:53 +0200
commit69f4b6732ce13f248b0da0c7eeda56207fdeaba2 (patch)
tree0814e90f6d8f47ddad58fe75684384c864ba652c /screen_ui.cpp
parentam e5d5ac76: minor recovery changes (diff)
downloadandroid_bootable_recovery-69f4b6732ce13f248b0da0c7eeda56207fdeaba2.tar
android_bootable_recovery-69f4b6732ce13f248b0da0c7eeda56207fdeaba2.tar.gz
android_bootable_recovery-69f4b6732ce13f248b0da0c7eeda56207fdeaba2.tar.bz2
android_bootable_recovery-69f4b6732ce13f248b0da0c7eeda56207fdeaba2.tar.lz
android_bootable_recovery-69f4b6732ce13f248b0da0c7eeda56207fdeaba2.tar.xz
android_bootable_recovery-69f4b6732ce13f248b0da0c7eeda56207fdeaba2.tar.zst
android_bootable_recovery-69f4b6732ce13f248b0da0c7eeda56207fdeaba2.zip
Diffstat (limited to 'screen_ui.cpp')
-rw-r--r--screen_ui.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 2a8652ecf..3c6c3ae25 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -122,6 +122,8 @@ void ScreenRecoveryUI::draw_background_locked(Icon icon)
// Should only be called with updateMutex locked.
void ScreenRecoveryUI::draw_progress_locked()
{
+ if (currentIcon == ERROR) return;
+
if (currentIcon == INSTALLING) {
draw_install_overlay_locked(installingFrame);
}
@@ -255,10 +257,10 @@ void ScreenRecoveryUI::progress_loop() {
int duration = progressScopeDuration;
if (progressBarType == DETERMINATE && duration > 0) {
double elapsed = now() - progressScopeTime;
- float progress = 1.0 * elapsed / duration;
- if (progress > 1.0) progress = 1.0;
- if (progress > progress) {
- progress = progress;
+ float p = 1.0 * elapsed / duration;
+ if (p > 1.0) p = 1.0;
+ if (p > progress) {
+ progress = p;
redraw = 1;
}
}
@@ -351,6 +353,8 @@ void ScreenRecoveryUI::SetProgressType(ProgressType type)
progressBarType = type;
update_progress_locked();
}
+ progressScopeStart = 0;
+ progress = 0;
pthread_mutex_unlock(&updateMutex);
}