sr: Improve display support

 * As we start using this recovery code on new devices, various
   display quirks are showing up. Let's do it right.
 * Previously we used a single ION buffer and just altered the
   offset when pageflipping. Some older versions of MDSS (kernel)
   don't properly crop the destination rect (hammerhead), so
   let's allocate two buffers and flip between them with the offset
   always at zero.
 * Some display hardware and MDSS kernel versions don't like us
   just shoving buffers down it's throat without vsync running.
   Implemented a simple vsync loop which enables the interrupt
   on-demand and uses a simple signal mechanism to notify waiters.
   The display loop will wait for a vsync before committing
   the current buffer to MDP, and the interrupt will be disabled
   automatically when drawing is done.
 * This also smooths out some of the jank when selecting options
   using the touch UI.

Change-Id: If140b78acf6eaf6d3927cda9f83ac4aee3a64bad
sr: Fix the progress bar

 * The progress thread is running all the time, which causes the device
   to heat up while in recovery. Start this thread only when the
   progress mode is set to something other than EMPTY, and add a
   terminating condition so that it exits when finished.
 * Incorporate Tom's patch to keep it updated when visible, since
   both are needed to get working progress indications without
   killing batteries.

Change-Id: Ib70d2cb25f01d9920ffb698b5b5b47af827ef483
sr: Use pathmap for recovery

Change-Id: I6350618e1e04819d52f1049f9f2fb61c833a1b45
sr: Declare additional dependencies instead of relying on build hax

e want to include a suite of tools and symlinks with recovery.  This
was previously done with a hack in build/core/Makefile.  That is rather
unorthodox.  Instead, use LOCAL_ADDITIONAL_DEPENDENCIES to declare the
things we want to include.

See also http://review.cyanogenmod.org/74244

Change-Id: I2a00469b72bfabf989d17bafdea6cebbbc52c53e
sr: check if touch selections fall within menu area

Touches above the menu area cause unexpected behavior. Fix it.

Change-Id: I28500588e072944f5ea45676ba82f95c6d0c5a08
minui: Asynchronous rendering for overlay mode

 * Mostly "because I can", but will be useful if we implement
   more advanced graphics in recovery.

Change-Id: I227947f50e3db08d6393da0fc51307fbfcf7ab4d
sr: Header and font images for 480/720/1080 widths

Note these are just scaled versions of the existing images.

Change-Id: I69fe9a51170d006f35071b82281ca4c5d9f61e18
install: Properly mask the updater status before checking

Change Ifc59ccdc1cf2a71245428ab9ff6495dc6c51d8b3 had a broken check, fixit

Change-Id: I5d00ebf6d16df72e08e34c04cc6259c15da008e0
sr: Fix incosistent menu options capitalization

Change-Id: I304443ce2cce2c35ad1c55444af6e3e7b53d7ea1
sr: Update header image

Based on http://review.cyanogenmod.org/64091 , slightly modified position
Vectorized & scaled properly, much better than what we have now

Change-Id: I28bb7c06c8011e2dc2988f41b1ea7f93a3819fed
sr: Kill logspam

 * Eradicate debug prints left in async rendering patch.

Change-Id: If8f8a6e828e1038a3792cc6fe88d38c8976bcee2
sr: Remove extra image set

 * This is preventing the correctly scaled images from being selected.

Change-Id: Ide36a40f377538679bf23ae9270b6c9030a5c226
sr: Improve overlay again

 * Clean up code, use acquire/retire model
 * Add some logging macros too

Change-Id: Ic3a1191764e8282eddd841901d276ecc1e9e3a59
sr: Dejank the menus, fix colors

 * Remove extraneous menu update causing jank
 * Use official colors

Change-Id: I5ca3faf54a51853fde8270edeee0fba778906659
sr: Header and font images for 1440 width

Change-Id: I44624dbf14a5702b99c94be0bcb9e67817f35211
sr: Header and font images for 540 width

These are scaled versions of the existing 720 images.

Change-Id: I3e30c88d91cbdebfdf08c871a0d87f6299967780
sr: Fix vsync logic

 * Use CLOCK_MONOTONIC to insulate from system clock changes.
 * Normalize all timespec calculations to avoid overflow/underflow.
 * Don't signal vsync if poll() fails.

Change-Id: If284ebf581309953c51b2f8d33d7d5800c636be5
(cherry picked from commit b6fbab00cfea400915399b97a9644870edfb64b7)
sr: Fix screen flashing during wipe operations

 * Clear buffer in draw_progress_locked() and always call this in
   update_progress_locked().  This is necessary to ensure that all
   backing frames in the graphics implementation get updated because
   we aren't guaranteed to have any particular number of backing
   frames.

 * Remove dialogs on wipe operations since we are using the progress
   animation now.

 * Set progress indicator after showing "Formatting" text to avoid
   momentary flicker.

Change-Id: I240d3b8e5c741c9f3ea4e5e17c1b9593e053888a
(cherry picked from commit 88bd3a4ce7f1e57266a42fb9afdba7c7211dcfce)
sr: Only use 4 items on wipe confirmation screens

 * Large fonts in Touch UI prevent more than about 7 menu lines.

Change-Id: If523a85d67460c0ac4e012727d946eadb9c68436
(cherry picked from commit fda08117e69fde38c65aeacfb160eda035ca1725)
Revert "adbd: switch to su domain when running as root"

This reverts commit c52c5b8e3d690201b2ae009a2d396d1899033e3d.

 * This breaks the adb recovery banner, and root_seclabel is not
   a valid option on cm11.

Change-Id: I0dede5d38b53b00936ad901e61d65f6119e62ff5
(cherry picked from commit cc5cd4542182db032bda3ddbffcaf120182d7ece)