Commit graph

14 commits

Author SHA1 Message Date
Doug Zongker
ad07492046 am 54a61179: am cfd4b286: Merge "recovery: initialize keys press tracking status"
* commit '54a6117935fe7470d23f7a538aeec9d6b139791b':
  recovery: initialize keys press tracking status
2014-06-06 16:00:20 +00:00
Mihai Serban
187d626e61 recovery: initialize keys press tracking status
Checks for keys pressed return random results because of an uninitialized data
structure.

Change-Id: Ic8b3d453d62347921aa893403079b374c16a092e
Signed-off-by: Mihai Serban <mihai.serban@intel.com>
2014-06-06 15:23:20 +03:00
Doug Zongker
c704e06ce5 disable async reboot during package installation
The default recovery UI will reboot the device when the power key is
pressed 7 times in a row, regardless of what recovery is doing.
Disable this feature during package installation, to minimize the
chance of corrupting the device due to a mid-install reboot.  (Debug
packages can explicitly request that the feature be reenabled.)

Change-Id: I20f3ec240ecd344615d452005ff26d8dd7775acf
2014-05-23 08:52:31 -07:00
Doug Zongker
02abde5085 remove DefaultDevice's UI subclass
RecoveryUI (which is the superclass of ScreenRecoveryUI), provides a
basic CheckKey method that is useful for devices that have KEY_POWER,
KEY_VOLUMEUP, and KEY_VOLUMEDOWN.  Stop overriding it with a less
featureful method; with this no recovery UI customization is needed
for most handheld devices (phones, tablets, etc.).

Change-Id: I7d57cfaaef79afea8af4fc3dbc570afc61aeb5bc
2014-04-01 09:47:36 -07:00
Doug Zongker
4db31d20c9 allow CheckKey to request mounting /system
Also provide a default implementation of CheckKey that's reasonable
for many devices (those that have power and volume keys).

Change-Id: Icf6c7746ebd866152d402059dbd27fd16bd51ff8
2014-03-11 14:19:48 -07:00
Todd Poynor
a5ef19fabd recovery: fix epoll events type to uint32_t
Change-Id: I5db9987102201c18821acb45d1f824e9865a1451
2013-09-17 21:58:52 +00:00
Todd Poynor
e7265df352 recovery: ui changes for ev_*() switch to epoll
Convert callback events parameter to unsigned int.

Change-Id: Ife0e983f307c07bf4aca807d70574aeb20c460cd
2013-09-12 12:42:33 -07:00
Doug Zongker
9e805d6ca0 allow CheckKey to request mounting /system
Also provide a default implementation of CheckKey that's reasonable
for many devices (those that have power and volume keys).

Change-Id: Icf6c7746ebd866152d402059dbd27fd16bd51ff8
2013-09-04 15:02:29 -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
Doug Zongker
bb01d0c12b add NextCheckKeyIsLong() and EnqueueKey() methods
NextCheckKeyIsLong() is called right before each call to CheckKey() to
tell the implementation if the key is a long-press or not.  (To be
used on devices with few buttons.)  It's done as a separate method
(rather than a parameter to CheckKey) to not break existing recovery
UI implementations.

EnqueueKey() can be called from CheckKey() to put arbitrary code codes
in the synchronous queue (to be processed by HandleMenuKey).

Change-Id: If8a83d66efe0bbc9e2dc178e5ebe12acd216324b
2012-12-17 10:52:58 -08:00
Doug Zongker
48b5b0737c allow recovery UI to ignore certain keypresses
Change-Id: Id182bb95ffcc475c5acabb29b413e422302ae7f2
2012-01-18 15:15:39 -08: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
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
Doug Zongker
28ce47cfa6 turn recovery into a C++ binary
Change-Id: I423a23581048d451d53eef46e5f5eac485b77555
2011-10-31 10:24:09 -07:00
Renamed from ui.c (Browse further)