Fix very long app_name crash.

http://ibrahimbalic.com/2014/android-os-memory-corruption-bug/ found an stack overflow bug.
The very long app_name make libandroid_runtime allocate a very large array on stack, the stack may overflow to other data areas in this situation.
This patch allocate large array on heap instead of on stack to avoid segment fault when doing memcpy.

Change-Id: I99999569b852d43a9c7a6eb1fa80e9f1a1f4e2b2

Conflicts:
	core/jni/android/graphics/Paint.cpp
Parallel shutdown

Decrease shutdown time by doing some shutdown tasks in parallel.

There are two threads executing during the shut down: the ShutdownThread
and a separate thread for the radio shutdown. However, the execution is
done in serial, as the ShutdownThread immediately joins on the radio
thread.

This commit will move the shutdown of the radio to the beginning of
shutdown and execute it in parallel to the shutdown of the rest of the
system.

The flow of the two threads during shutdown is now:

Radio Thread
  * Start shutdown of the radio
  * Wait for radio off or time out
  * Notify that the radio is done
ShutdownThread
  * Broadcast ACTION_SHUTDOWN as a parallel broadcast. (The receivers
    will get as much time to handle onReceive as it takes execute the
    rest of the tasks in the shut down flow. If they are not done in
    that time, we don't care.)
  * Shutdown ActivityManager
  * Shutdown MountService
  * Wait for MountService and radio to notify done
  * Vibrate
  * Low level shutdown

Change-Id: Ifdd8a9c75337fd9d00148a0d2b9917e10fa60634

Conflicts:
	services/java/com/android/server/power/ShutdownThread.java
Fix segfault removing theme assets

Change-Id: I4827eb6e2b186547f1df6f9bbd048fb1e3a29890

Conflicts:
	libs/androidfw/ResourceTypes.cpp
Style previews [1/3]

Change-Id: Ifed0ef7829eb61492a39395e8140b99f01c5e6a3

Conflicts:
	core/java/android/provider/ThemesContract.java
Keyguard: give the Keyguard a non-empty app label

A blank app label under "Apps" looks suspicious to
the untrained eye.

Change-Id: Ic679e5d6d825a83a8f666bb7e6429bebf1280f6d
Signed-off-by: Roman Birg <roman@cyngn.com>
(cherry picked from commit 9757a1db0c4e60ce85fe93573c2da62bf3880231)

Conflicts:
	packages/Keyguard/res/values/cm_extra.xml
Download: add to support pause/resume download by manual

We add pause and resume API here so that application can
pause and resume downloads manually by DownloadManager.
This contains two points:
1. add pause and resume download APIs.
2. add another paused reason for this download status.

Change-Id: I606b48ca20f43bcc6c119683818c2ab6ff03bfe5

Conflicts:
	core/java/android/provider/Downloads.java
CM11 Themes: Put overlays in their own group.

Overlays will now be added to their own group and the
target group will contain a pointer to the overlay
package to be used in getResource and getBagLocked.

Change-Id: Icc6c6eb791f04966e68dbc099eae8e7129546414

Conflicts:
	libs/androidfw/ResourceTypes.cpp
CM11 Themes: Remove type matching restriction

Change-Id: I5a8ac8ff1794350ff9dc03b378c704bfb97d0a9e
CM11 Themes: Allow forcing idmap (re)creation.

Change-Id: I9f5938e9b1052da83b7f2cd7b1ff6f1ed270db6b
CM11 Themes: Use theme name for audible name.

Change-Id: Ib841cb80925b0f3f5ac770e00df04515849e9360