aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrashant Malani2016-03-08 17:23:51 -0600
committerPrashant Malani2016-03-08 17:56:54 -0600
commit1c7b2230d8aac9f064f68c48b6aa26aca000cc9d (patch)
tree9f7e07128f339f3a8fbed3cb4c49ce499be60c99 /wear_ui.cpp
parent7d9fd96dc99a6008979811e36bb06f3afad18508 (diff)
downloadplatform-bootable-recovery-1c7b2230d8aac9f064f68c48b6aa26aca000cc9d.tar.gz
platform-bootable-recovery-1c7b2230d8aac9f064f68c48b6aa26aca000cc9d.tar.xz
platform-bootable-recovery-1c7b2230d8aac9f064f68c48b6aa26aca000cc9d.zip
recovery: More refactoring of WearUI
This patch performs the following modifications: - Remove setBackground function, and currentIcon member variable. - Remove common Progress*, Redraw and EndMenu functions. Bug: 27407422 Change-Id: Ic3c0e16b67941484c3bc1d04c9b61288e8896808 Signed-off-by: Prashant Malani <pmalani@google.com>
Diffstat (limited to 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp69
1 files changed, 0 insertions, 69 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 65bcd849..ef48b788 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -59,7 +59,6 @@ WearRecoveryUI::WearRecoveryUI() :
59 intro_frames(22), 59 intro_frames(22),
60 loop_frames(60), 60 loop_frames(60),
61 animation_fps(30), 61 animation_fps(30),
62 currentIcon(NONE),
63 intro_done(false), 62 intro_done(false),
64 current_frame(0), 63 current_frame(0),
65 rtl_locale(false), 64 rtl_locale(false),
@@ -366,57 +365,6 @@ void WearRecoveryUI::Init()
366 RecoveryUI::Init(); 365 RecoveryUI::Init();
367} 366}
368 367
369void WearRecoveryUI::SetBackground(Icon icon)
370{
371 pthread_mutex_lock(&updateMutex);
372 currentIcon = icon;
373 update_screen_locked();
374 pthread_mutex_unlock(&updateMutex);
375}
376
377void WearRecoveryUI::SetProgressType(ProgressType type)
378{
379 pthread_mutex_lock(&updateMutex);
380 if (progressBarType != type) {
381 progressBarType = type;
382 }
383 progressScopeStart = 0;
384 progressScopeSize = 0;
385 progress = 0;
386 update_screen_locked();
387 pthread_mutex_unlock(&updateMutex);
388}
389
390void WearRecoveryUI::ShowProgress(float portion, float seconds)
391{
392 pthread_mutex_lock(&updateMutex);
393 progressBarType = DETERMINATE;
394 progressScopeStart += progressScopeSize;
395 progressScopeSize = portion;
396 progressScopeTime = now();
397 progressScopeDuration = seconds;
398 progress = 0;
399 update_screen_locked();
400 pthread_mutex_unlock(&updateMutex);
401}
402
403void WearRecoveryUI::SetProgress(float fraction)
404{
405 pthread_mutex_lock(&updateMutex);
406 if (fraction < 0.0) fraction = 0.0;
407 if (fraction > 1.0) fraction = 1.0;
408 if (progressBarType == DETERMINATE && fraction > progress) {
409 // Skip updates that aren't visibly different.
410 int width = progress_bar_width;
411 float scale = width * progressScopeSize;
412 if ((int) (progress * scale) != (int) (fraction * scale)) {
413 progress = fraction;
414 update_screen_locked();
415 }
416 }
417 pthread_mutex_unlock(&updateMutex);
418}
419
420void WearRecoveryUI::SetStage(int current, int max) 368void WearRecoveryUI::SetStage(int current, int max)
421{ 369{
422} 370}
@@ -499,16 +447,6 @@ int WearRecoveryUI::SelectMenu(int sel) {
499 return sel; 447 return sel;
500} 448}
501 449
502void WearRecoveryUI::EndMenu() {
503 int i;
504 pthread_mutex_lock(&updateMutex);
505 if (show_menu > 0 && text_rows > 0 && text_cols > 0) {
506 show_menu = 0;
507 update_screen_locked();
508 }
509 pthread_mutex_unlock(&updateMutex);
510}
511
512bool WearRecoveryUI::IsTextVisible() 450bool WearRecoveryUI::IsTextVisible()
513{ 451{
514 pthread_mutex_lock(&updateMutex); 452 pthread_mutex_lock(&updateMutex);
@@ -539,13 +477,6 @@ void WearRecoveryUI::ShowText(bool visible)
539 pthread_mutex_unlock(&updateMutex); 477 pthread_mutex_unlock(&updateMutex);
540} 478}
541 479
542void WearRecoveryUI::Redraw()
543{
544 pthread_mutex_lock(&updateMutex);
545 update_screen_locked();
546 pthread_mutex_unlock(&updateMutex);
547}
548
549void WearRecoveryUI::ShowFile(FILE* fp) { 480void WearRecoveryUI::ShowFile(FILE* fp) {
550 std::vector<long> offsets; 481 std::vector<long> offsets;
551 offsets.push_back(ftell(fp)); 482 offsets.push_back(ftell(fp));