From c87bab101893e8322b49d7c8600e3367b20ab50a Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Mon, 25 Nov 2013 13:53:25 -0800 Subject: add the functions for multi-stage packages to updater In order to support multi-stage recovery packages, we add the set_stage() and get_stage() functions, which store a short string somewhere it can be accessed across invocations of recovery. We also add reboot_now() which updater can invoke to immediately reboot the device, without doing normal recovery cleanup. (It can also choose whether to boot off the boot or recovery partition.) If the stage string is of the form "#/#", recovery's UI will be augmented with a simple indicator of what stage you're in, so it doesn't look like a reboot loop. Change-Id: I62f7ff0bc802b549c9bcf3cc154a6bad99f94603 --- screen_ui.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index fc35d95b6..5c4366d28 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -39,6 +39,8 @@ class ScreenRecoveryUI : public RecoveryUI { void ShowProgress(float portion, float seconds); void SetProgress(float fraction); + void SetStage(int current, int max); + // text log void ShowText(bool visible); bool IsTextVisible(); @@ -58,9 +60,6 @@ class ScreenRecoveryUI : public RecoveryUI { enum UIElement { HEADER, MENU, MENU_SEL_BG, MENU_SEL_FG, LOG, TEXT_FILL }; virtual void SetColor(UIElement e); - protected: - int install_overlay_offset_x, install_overlay_offset_y; - private: Icon currentIcon; int installingFrame; @@ -73,6 +72,8 @@ class ScreenRecoveryUI : public RecoveryUI { gr_surface *progressBarIndeterminate; gr_surface progressBarEmpty; gr_surface progressBarFill; + gr_surface stageMarkerEmpty; + gr_surface stageMarkerFill; ProgressType progressBarType; @@ -102,8 +103,13 @@ class ScreenRecoveryUI : public RecoveryUI { int animation_fps; int indeterminate_frames; int installing_frames; + protected: + int install_overlay_offset_x, install_overlay_offset_y; + private: int overlay_offset_x, overlay_offset_y; + int stage, max_stage; + void draw_install_overlay_locked(int frame); void draw_background_locked(Icon icon); void draw_progress_locked(); -- cgit v1.2.3 From eac881c952fc6be0beeb5f719e3a70e651f3610e Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Fri, 7 Mar 2014 09:21:25 -0800 Subject: change how recovery animation is implemented Instead of one 'base' installing image and a number of overlay images that are drawn on top of it, we represent the installing animation with one PNG that contains all the animation frames, interlaced by row. The PNG is expected to have a text chunk with the keyword 'Frames' and a value that's the number of frames (as an ascii string). This representation provides better compression, removes the need to subclass ScreenRecoveryUI just to change the position of the overlay or number of frames, and doesn't require gr_blit() to support an alpha channel. We also remove the 'indeterminate' progress bar used when wiping data and/or cache. The main animation serves the same purpose (showing that the device is still alive); the spinning progress bar has been redundant for a while. This changes the default recovery animation to include the antenna-wiggling and gear-turning that's used in the Nexus 5 recovery animation. Change-Id: I51930a76035ac09969a25472f4e572b289418729 --- screen_ui.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index 5c4366d28..0221ff253 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -68,8 +68,7 @@ class ScreenRecoveryUI : public RecoveryUI { pthread_mutex_t updateMutex; gr_surface backgroundIcon[5]; gr_surface backgroundText[5]; - gr_surface *installationOverlay; - gr_surface *progressBarIndeterminate; + gr_surface *installation; gr_surface progressBarEmpty; gr_surface progressBarFill; gr_surface stageMarkerEmpty; @@ -101,12 +100,11 @@ class ScreenRecoveryUI : public RecoveryUI { pthread_t progress_t; int animation_fps; - int indeterminate_frames; int installing_frames; protected: - int install_overlay_offset_x, install_overlay_offset_y; private: - int overlay_offset_x, overlay_offset_y; + + int iconX, iconY; int stage, max_stage; @@ -120,6 +118,7 @@ class ScreenRecoveryUI : public RecoveryUI { void progress_loop(); void LoadBitmap(const char* filename, gr_surface* surface); + void LoadBitmapArray(const char* filename, int* frames, gr_surface** surface); void LoadLocalizedBitmap(const char* filename, gr_surface* surface); }; -- cgit v1.2.3 From 469954fe3d7c3d729e500512ab911a037b90cc77 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Fri, 7 Mar 2014 09:21:25 -0800 Subject: change how recovery animation is implemented Instead of one 'base' installing image and a number of overlay images that are drawn on top of it, we represent the installing animation with one PNG that contains all the animation frames, interlaced by row. The PNG is expected to have a text chunk with the keyword 'Frames' and a value that's the number of frames (as an ascii string). This representation provides better compression, removes the need to subclass ScreenRecoveryUI just to change the position of the overlay or number of frames, and doesn't require gr_blit() to support an alpha channel. We also remove the 'indeterminate' progress bar used when wiping data and/or cache. The main animation serves the same purpose (showing that the device is still alive); the spinning progress bar has been redundant for a while. This changes the default recovery animation to include the antenna-wiggling and gear-turning that's used in the Nexus 5 recovery animation. Change-Id: I51930a76035ac09969a25472f4e572b289418729 Conflicts: screen_ui.cpp screen_ui.h --- screen_ui.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index fc35d95b6..ada006d1e 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -69,8 +69,7 @@ class ScreenRecoveryUI : public RecoveryUI { pthread_mutex_t updateMutex; gr_surface backgroundIcon[5]; gr_surface backgroundText[5]; - gr_surface *installationOverlay; - gr_surface *progressBarIndeterminate; + gr_surface *installation; gr_surface progressBarEmpty; gr_surface progressBarFill; @@ -100,9 +99,9 @@ class ScreenRecoveryUI : public RecoveryUI { pthread_t progress_t; int animation_fps; - int indeterminate_frames; int installing_frames; - int overlay_offset_x, overlay_offset_y; + + int iconX, iconY; void draw_install_overlay_locked(int frame); void draw_background_locked(Icon icon); @@ -114,6 +113,7 @@ class ScreenRecoveryUI : public RecoveryUI { void progress_loop(); void LoadBitmap(const char* filename, gr_surface* surface); + void LoadBitmapArray(const char* filename, int* frames, gr_surface** surface); void LoadLocalizedBitmap(const char* filename, gr_surface* surface); }; -- cgit v1.2.3 From a418aa7dd5e94cbf1ab2a6fa1c63f60e5e087d42 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Mon, 17 Mar 2014 12:10:02 -0700 Subject: refactor image resource loading code in minui Reduce the number of copies of libpng boilerplate. Rename res_create_* functions to be more clear. Make explicit the use of the framebuffer pixel format for images, and handle more combinations of input and output (eg, loading a grayscale image for display rather than use as a text alpha channel). Change-Id: I3d41c800a8f4c22b2f0167967ce6ee4d6b2b8846 --- screen_ui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index ada006d1e..14b91385d 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -64,6 +64,7 @@ class ScreenRecoveryUI : public RecoveryUI { private: Icon currentIcon; int installingFrame; + const char* locale; bool rtl_locale; pthread_mutex_t updateMutex; -- cgit v1.2.3 From 9551cf912180665a85f515c16d6412bb8ea2bf98 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Fri, 4 Apr 2014 13:48:33 -0700 Subject: make density-specific recovery assets Provide different recovery UI resources for different display densities. Right now only the text images and the progress bars are rescaled; the main icon will get scaled when it's updated for QP. Lightly quantum-ify the rest of the recovery interface. (Light background, progress bars, etc.) Change-Id: Ia639c4ce8534b01bc843524efbc4b040c1cf38b3 --- screen_ui.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index 92e4795b4..2e01acdae 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -87,6 +87,9 @@ class ScreenRecoveryUI : public RecoveryUI { static const int kMaxCols = 96; static const int kMaxRows = 96; + static const int kTextXOffset = 8; + static const int kTextYOffset = 4; + // Log text overlay, displayed when a magic key is pressed char text[kMaxRows][kMaxCols]; int text_cols, text_rows; -- cgit v1.2.3 From 5b5f6c2fd32839227d10ee3c97e662a415b80e2b Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 3 Jun 2014 10:50:13 -0700 Subject: restore holo UI in recovery Return to the recovery to the holo appearance. Bug: 15424396 Change-Id: Id4d3f23e0a6251a12aa42f3793cff347f38b4243 --- screen_ui.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index d5e589225..01a33bfe2 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -87,9 +87,6 @@ class ScreenRecoveryUI : public RecoveryUI { static const int kMaxCols = 96; static const int kMaxRows = 96; - static const int kTextXOffset = 8; - static const int kTextYOffset = 4; - // Log text overlay, displayed when a magic key is pressed char text[kMaxRows][kMaxCols]; int text_cols, text_rows; -- cgit v1.2.3