Commit graph

48 commits

Author SHA1 Message Date
Elliott Hughes
0a5cb0c7cd Don't use typedefs that hide *s.
gr_surface was causing confusion for no good reason.

Change-Id: If7120187f9a00dd16297877fc49352185a4d4ea6
2015-04-15 10:58:56 -07:00
Elliott Hughes
8fd86d77f1 Move the menu header out of the menu.
This makes it easier for us to deal with arbitrary information at the
top, and means that headers added by specific commands don't overwrite
the default ones.

Add the fingerprint back, but broken up so it fits even on sprout's
display.

Change-Id: Id71da79ab1aa455a611d72756a3100a97ceb4c1c
2015-04-13 15:46:15 -07:00
Elliott Hughes
eab12de70e Merge "Remove unnecessary globals." 2015-04-13 20:18:57 +00:00
Elliott Hughes
985022a623 Remove unnecessary globals.
Change-Id: I76a042432aede08ceaf250319cf5eeb25d601150
2015-04-13 13:04:32 -07:00
Elliott Hughes
300ed089b3 Treat KEY_ENTER the same as KEY_POWER in the pager.
Our long-press UI sends KEY_ENTER for long presses, which the long-press
UI treats as equivalent to KEY_POWER in the regular UI. So anywhere we accept
KEY_POWER we should accept KEY_ENTER too.

Change-Id: I99d376c961887043cf02037c26d000c8ba4d66f9
2015-04-13 10:47:59 -07:00
Elliott Hughes
95fc63e87b Rewritten file pager.
Most importantly, this one no longer skips lines because of wrapping.

Change-Id: Ic1c1944682ab8cbf3d542418ee86d29819173fc9
2015-04-10 19:12:01 -07:00
Elliott Hughes
642aaa7a3e Fix ScreenRecoveryUI to handle devices without power/up/down.
Currently fugu has a custom subclass to handle this. The default code
supports devices with trackballs but not all shipping Nexus devices?
That's just silly.

Change-Id: Id2779c91284899a26b4bb1af41e7033aa889df10
2015-04-10 12:47:46 -07:00
Elliott Hughes
8de52078a4 Move file paging into ScreenRecoveryUI.
This fixes the N9 performance problem.

Change-Id: I00c10d4162ff266a6243285e5a5e768217f6f799
2015-04-08 20:06:50 -07:00
Elliott Hughes
aa0d6afb61 Remove the fixed screen size assumptions.
Dynamically allocate the text and menu arrays instead.

Change-Id: Idbfc3fe4e4b50db4fee62ac2b6a7323cad369749
2015-04-08 16:16:52 -07:00
Elliott Hughes
01a4d08010 Fix recovery image text rendering.
Previously most devices would lose the character before a line wrap.
The log's text rendering was starting at offset 4 but none of the
arithmetic was taking this into account. It just happened to work
on the Nexus 9's 1536-pixel wide display (1536/18=85.3) but not on
a device such as the Nexus 5 (1080/18=60).

The only active part of this change is the change from 4 to 0 in the
gr_text call. The rest is just a few bits of trivial cleanup while I
was working out what was going on.

Change-Id: I9279ae323c77bc8b6ea87dc0fe009aaaec6bfa0e
2015-03-24 15:21:48 -07:00
Elliott Hughes
fc06f87ecc Make the recovery menus wrap.
The real problem is that the recovery UI is sluggish. But being able
to wrap off the top to the bottom halves the maximum distance you'll
have to go.

Change-Id: Ifebe5b818f9c9a1c4187d4ac609422da1f38537f
2015-03-23 13:45:31 -07:00
Doug Zongker
5b5f6c2fd3 restore holo UI in recovery
Return to the recovery to the holo appearance.

Bug: 15424396
Change-Id: Id4d3f23e0a6251a12aa42f3793cff347f38b4243
2014-06-06 09:01:57 -07:00
Doug Zongker
8c7457a2c5 am 48abd574: am 34ff5fe3: am 74b90b30: Merge "screen_ui: Initialize text buffer"
* commit '48abd574cb1b7b0adbe1de36224fb974182aaa2d':
  screen_ui: Initialize text buffer
2014-05-13 17:38:15 +00:00
Doug Zongker
34ff5fe3f5 am 74b90b30: Merge "screen_ui: Initialize text buffer"
* commit '74b90b309f67dc3b8bb74e47c4eddf7ce511bc35':
  screen_ui: Initialize text buffer
2014-05-13 17:28:54 +00:00
Doug Zongker
74b90b309f Merge "screen_ui: Initialize text buffer" 2014-05-13 17:25:52 +00:00
Doug Zongker
9551cf9121 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
2014-04-04 13:48:33 -07:00
Doug Zongker
a68c517c62 am 80c1a386: resolved conflicts for merge of d90da130 to klp-modular-dev-plus-aosp
* commit '80c1a386d3f614919708b37986919ecaf74ee738':
  refactor image resource loading code in minui
2014-03-17 23:33:14 +00:00
Doug Zongker
c4025e90f4 resolved conflicts for merge of d90da130 to klp-dev-plus-aosp
Change-Id: I19f9f460145fdcf5cdc58ee4fa25ff3c9ba398f0
2014-03-17 16:13:08 -07:00
Doug Zongker
80c1a386d3 resolved conflicts for merge of d90da130 to klp-modular-dev-plus-aosp
Change-Id: Ib95b5bcd8d24014e1f2a956d2f31c99a471d3e30
2014-03-17 16:11:02 -07:00
Doug Zongker
a418aa7dd5 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
2014-03-17 12:27:08 -07:00
Doug Zongker
4048200cd6 am c91612d4: Merge "remove pixelflinger from recovery"
* commit 'c91612d4668688c5d7bf76c258c11010697a03d2':
  remove pixelflinger from recovery
2014-03-13 15:46:53 +00:00
Doug Zongker
cfcec9e1d4 Merge commit 'ea868b38' into manualmerge
Conflicts:
	screen_ui.cpp
	screen_ui.h

Change-Id: Iefe7dde04cc76639f56730a19238436073f18ffb
2014-03-13 08:44:07 -07:00
Doug Zongker
cb1bdc9e42 am c91612d4: Merge "remove pixelflinger from recovery"
* commit 'c91612d4668688c5d7bf76c258c11010697a03d2':
  remove pixelflinger from recovery
2014-03-12 02:42:57 +00:00
Doug Zongker
c15b7865ba resolved conflicts for merge of ea868b38 to klp-modular-dev-plus-aosp
Change-Id: I8cc3b8101bccf7fd697f9a7b73732d1000dc27a1
2014-03-11 19:39:26 -07:00
Doug Zongker
16f97c3961 remove pixelflinger from recovery
Recovery now draws directly to the framebuffer by rolling its own
graphics code, rather than depending on libpixelflinger.

The recovery UI is modified slightly to eliminate operations that are
slow with the software implementation: when the text display / menu is
turned on, it now appears on a black background instead of a dimmed
version of the recovery icon.

There's probably substantial room for optimization of the graphics
operations.

Bug: 12131110
Change-Id: Iab6520e0a7aaec39e2ce39377c10aef82ae0c595

Conflicts:
	minui/resources.c
2014-03-11 14:40:04 -07:00
Doug Zongker
469954fe3d 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
2014-03-11 14:06:35 -07:00
Doug Zongker
39cf417e17 remove pixelflinger from recovery
Recovery now draws directly to the framebuffer by rolling its own
graphics code, rather than depending on libpixelflinger.

The recovery UI is modified slightly to eliminate operations that are
slow with the software implementation: when the text display / menu is
turned on, it now appears on a black background instead of a dimmed
version of the recovery icon.

There's probably substantial room for optimization of the graphics
operations.

Bug: 12131110
Change-Id: Iab6520e0a7aaec39e2ce39377c10aef82ae0c595
2014-03-11 11:10:00 -07:00
Doug Zongker
eac881c952 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
2014-03-07 09:45:44 -08:00
Doug Zongker
a766c34f86 am d327c63a: am c87bab10: add the functions for multi-stage packages to updater
* commit 'd327c63af691a36fbf53866a3ae7ad27a43ebe3b':
  add the functions for multi-stage packages to updater
2013-12-02 23:30:51 +00:00
Doug Zongker
c87bab1018 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
2013-11-26 15:46:57 -08:00
Alistair Strachan
9b8ae8038b Fix rare crash seen when dereferencing backgroundIcon[NONE].
Because backgroundIcon[] is not initialized by the ScreenRecoveryUI
constructor, it should be initialized explicitly to NULL in Init().

If it is not initialized, ScreenRecoveryUI::SetBackground() can fail
for the NONE icon because the NULL test can fail and junk will be
dereferenced.

Change-Id: I4e3738d2e241ed90df43c984fb41e0072933f50a
2013-11-18 09:51:32 -08:00
Bjorn Andersson
80a7a4642b screen_ui: Initialize text buffer
Zero initialize the text buffer to make recovery not
render garbage when showing the menu or messages.

Change-Id: I0dd0d357757f6b0fd52ad3b3617d42bb1b835245
2013-09-30 13:57:49 -07:00
Doug Zongker
239ac6abac recovery: install packages in a known mount environment
When installing a package, we should have /tmp and /cache mounted and
nothing else.  Ensure this is true by explicitly mounting them and
unmounting everything else as the first step of every install.

Also fix an error in the progress bar that crops up when you do
multiple package installs in one instance of recovery.

Change-Id: I4837ed707cb419ddd3d9f6188b6355ba1bcfe2b2
2013-08-21 13:44:35 -07:00
Doug Zongker
c0441d1719 notify about pending long press
Recovery changes:

- add a method to the UI class that is called when a key is held down
  long enough to be a "long press" (but before it is released).
  Device-specific subclasses can override this to indicate a long
  press.

- do color selection for ScreenRecoveryUI's menu-and-log drawing
  function.  Subclasses can override this to customize the colors they
  use for various elements.

- Include the value of ro.build.display.id in the menu headers, so you
  can see on the screen what version of recovery you are running.

Change-Id: I426a6daf892b9011638e2035aebfa2831d4f596d
2013-07-31 11:35:12 -07:00
yetta_wu
5b468fc930 recovery: init backgroundIcon properly to avoid recovery mode crash
We met factory issue that some devices would crash in recovery mode
because the backgroundIcon array did not reset to NULL when initializing.

Bug: 9568624
Change-Id: I13c7a7cc1053a7ffdbadd71740c1a2b4a2af6bba
Signed-off-by: yetta_wu <yetta_wu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-07-02 12:35:58 -07:00
yetta_wu
2f6877a022 recovery: init backgroundIcon properly to avoid recovery mode crash
We met factory issue that some devices would crash in recovery mode
because the backgroundIcon array did not reset to NULL when initializing.

Bug: 9568624
Change-Id: I13c7a7cc1053a7ffdbadd71740c1a2b4a2af6bba
Signed-off-by: yetta_wu <yetta_wu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-06-25 12:50:20 -07:00
Doug Zongker
6fd59ac07d more font improvements and cleanup
Get rid of the notion of a font's "ascent"; the reference point for
drawing is the top-left corner of the character box rather than the
baseline.  Add some more space between the menu entries and make the
highlight bar around the text.

Replace the default font.png with two images; the build system will
include one or the other based on the resolutions of the device.

Restore the original compiled-in bitmap font, to fall back on when
font.png can't be found (eg, in the charger binary).

Add support for bold text (when a font.png image is used).

Change-Id: I6d211a486a3636f20208502b1cd2aeae8b9f5b02
2013-03-07 13:34:24 -08:00
Doug Zongker
55a36ac1e0 recovery: change font for menus to be an image
Instead of representing the font used for menus and log messages in
the recovery binary, load it from a resource PNG image.  This allows
different devices to substitute their own font images.

Change-Id: Ib36b86db3d01298aa7ae2b62a26ca29e6ef18014
2013-03-04 16:37:44 -08:00
Doug Zongker
8347cb2d81 revert to tacky 3D recovery animation
Bug: 7204420
Change-Id: I16d3346ce54b1aa5a0e6a02839ae9fbd4718fffa
2012-10-08 08:38:16 -07:00
Doug Zongker
b66cb69e39 tweak recovery text images
Center and fix the extents for those locales that have multiple lines
of text.  Add Urdu as an RTL language.

Bug: 7064142
Change-Id: I4c1aa1198be29cab01129dabf2c4a026b93719a6
2012-09-18 14:52:18 -07:00
Doug Zongker
5fa8c23911 localization for recovery messages
Add images of text for all locales we support.  Make the progress bar
fill the correct way for RTL languages.  (Flip the direction the
spinner turns, too, just for good measure.)

Bug: 7064142
Change-Id: I5dddb26e02ee5275c57c4dc4a03c6d68432ac7ba
2012-09-18 12:37:02 -07:00
Doug Zongker
52eeea4fa5 minor recovery fixes
- protect against missing/malformed bitmaps: fail to display them but
  don't crash.

- don't draw animation overlays until the overlay offset is computed.

- logging cleanup

Change-Id: Ieb1c155cfbb11e643000bdb5d1a57900c8757739
2012-09-04 14:28:25 -07:00
Doug Zongker
4f33e55d1c change recovery images to android with spinner
Also make writing the locale a bit more robust.

Change-Id: I803dd0aa0b9d6661fad74ea13fb085682402323c
2012-08-23 13:19:02 -07:00
Doug Zongker
02ec6b88ed add simple text to recovery UI
- recovery takes a --locale argument, which will be passed by the main
  system

- the locale is saved in cache, in case the --locale argument is
  missing (eg, when recovery is started from fastboot)

- we include images that have prerendered text for many locales

- we split the background states into four (installing update,
  erasing, no command, error) so that appropriate text can be shown.

Change-Id: I731b8108e83d5ccc09a4aacfc1dbf7e86b397aaf
2012-08-22 17:26:40 -07:00
Doug Zongker
69f4b6732c fix timed progress bars in recovery
They're completely broken and have been for months because this code
makes no sense.

Change-Id: Ibabcd3dbe5a004a45b341e4a5215aa3df77e1861
2012-04-26 14:37:53 -07:00
Doug Zongker
32a0a47a59 move key processing to RecoveryUI
Move the key for handling keys from ScreenRecoveryUI to RecoveryUI, so
it can be used by devices without screens.  Remove the UIParameters
struct and replace it with some new member variables in
ScreenRecoveryUI.

Change-Id: I70094ecbc4acbf76ce44d5b5ec2036c36bdc3414
2011-11-04 14:09:48 -07:00
Doug Zongker
daefc1d442 C++ class for device-specific code
Replace the device-specific functions with a class.  Move some of the
key handling (for log visibility toggling and rebooting) into the UI
class.  Fix up the key handling so there is less crosstalk between the
immediate keys and the queued keys (an increasing annoyance on
button-limited devices).

Change-Id: I698f6fd21c67a1e55429312a0484b6c393cad46f
2011-10-31 15:51:07 -07:00
Doug Zongker
211aebc4e0 refactor ui functions into a class
Move all the functions in ui.c to be members of a ScreenRecoveryUI
class, which is a subclass of an abstract RecoveryUI class.  Recovery
then creates a global singleton instance of this class and then invoke
the methods to drive the UI.  We use this to allow substitution of a
different RecoveryUI implementation for devices with radically
different form factors (eg, that don't have a screen).

Change-Id: I76bdd34eca506149f4cc07685df6a4890473f3d9
2011-10-31 14:15:02 -07:00
Renamed from ui.cpp (Browse further)