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
Allow custom bootloader msg offset in block misc

Use board define BOARD_RECOVERY_BLDRMSG_OFFSET with a decimal integer
to define a custom offset where the bootloader message should be
read/written.

Change-Id: Id13a23dd41bb7d907b96d657b8e21eb839dfeaa9
sr: Support BGRA framebuffer

Change-Id: I29c27f6b52e12c55050551287ed55d28193e8d4c
sr: Always use 32-bit framebuffer

Some devices start in 16-bit framebuffer mode but we only support
32-bit framebuffers.  Switch to 32-bit framebuffer mode at start to
make these devices work properly.

Change-Id: I0cbc7098b3254ce9cd7aae72b9b8163681549290