sr: Return to main menu after selection

Change-Id: Ib6fd1904b6516a651ffaad20f66b2eaf42c31619
fix vulnerability in bspatch

Patches with control data tuples with negative numbers in the first
and/or second can cause bspatch to write to arbitrary locations in the
heap.

Change-Id: I8c5d81948be773e6483241131d3d166b6da27cb8
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
ref-id: https://github.com/CyanogenMod/android_bootable_recovery-cm/commit/865ed4b0548c1570aebb276364334f2844f8cee5
Revert "sr: re-add in_touch"

This reverts commit 3a4db425f100e8f9e820389e37f0890b7b47b401.
Revert "sr: Touch UI"

This reverts commit 24eb48ebccac1e467db9337724c41e4bc3f234ea.

Conflicts:
	screen_ui.cpp
sr: Touch UI

Change-Id: I1c9b78c8fba3c23f2ecddb7659746af0bd12ee55
Basic assets for header and font

Looks a little cleaner, reads font image correctly now.

Change-Id: If0c4d9cee514a326a35d7ae4f04379ae2c1c6c7c
screen_ui: fix headers
screen_ui: add menu item separators
COT: humble beginnings
recovery: Testing menus and dialogs
DO NOT MERGE!
Revert "DO NOT MERGE!"

This reverts commit d7d6054632a2d7854942559660415383d6bf2b9a.
restore minui support for paletted images with < 8 bits

The PNG image loaders should support images that use palettes
requiring fewer than 8 bits.

Change-Id: Ibcb0ff6f04aea8de54b03c0efa7a79e9b3635146
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
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.

cherry-pick AOSP commit c87bab101893e8322b49d7c8600e3367b20ab50a

Conflicts:
	recovery.cpp
	screen_ui.cpp
	screen_ui.h
	updater/install.c

Change-Id: I3fd355adacd4ed00c23713d6a4fdafd91d7a28a4

Conflicts:
	screen_ui.cpp
recovery: Add support for split display

Configure LEFT and RIGHT mixer separately
to drive high resolution display.

Conflicts:
	minui/graphics.c
	minui/graphics_overlay.c

Change-Id: I3a3e6bffe6373caa991d9847dae6f2f4d8d20c48
Fix build for !QCOM_BSP

Change-Id: I879cde15006f9f03769cb88233a2f92a9c84bfc8
sr: Always format data on non-datamedia devices

We only want to treat /data/media as special on datamedia devices.  This
provides consistency for backup/restore.

Change-Id: I5ba0fd49d863d845dc80dcd3b85546da8b498050
Do not wipe block misc on bootloader msg update

When set_bootloader_message_block() is called, it fopens /misc in write
binary mode, wiping all contents other than what is being written. The
bootloader msg structure is only 1024+32+32 bytes, so some manufacturers
store more than just a bootloader msg on /misc. fopen in read+append
mode so that only the bootloader msg is written and the rest of the
partition is left untouched.

Change-Id: I2d2fbdf067282744864a19d404ca7dc12f688a98