Out of memory using wallpaperPicker switching wallpapers

Out of memory issues arise when switching wallpapers using
WallpaperPicker quickly, due to not releasing large Bitmaps
before allocating space for new ones.

Resolved by securing that wallpaper bitmaps are set to null
in order to be garbage collected when switching wallpaper.

Added stability correction making sure noone can retrieve
bitmap once it has been recycled by first calling
WallpaperManager.forgetLoadedWallpaper().

Change-Id: I318ee46d8613bec15dd52dd7b61ae950e760e6f6
Avoid duplicate call to onLoadFinished()

When a loader is initialized in Fragment#onActivityCreated(Bundle), then
LoadersCallback#onLoadFinished() was called twice on device orientation
change:
 - once during fragment start();
 - once during loader finishRetain().

Reported as bug 63179:
https://code.google.com/p/android/issues/detail?id=63179

This commit prevents to call onLoadFinished() when the data has already
been delivered.

Change-Id: I893013049f819dd5543a8079ce9d8025a5fdb2f1
frameworks/base: Fix various aliasing violations

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
frameworks/base: Fix aliasing violations

Fix violations of strict aliasing rules

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
frameworks/base: Fix build in ISO C++11 mode

Fix various incompatibilities with ISO C++11:
- Assumption that char16_t is defined to uint16_t
- constexpr usage
- macro constructs that could be interpreted as string literals
- enum typesafety

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

Conflicts:
	core/jni/android_os_FileUtils.cpp
base: Fix build after Parcel ABI fix in Binder

Adapt code to the fact that writeString16's first parameter
is now an uint16_t* to match the old ABI

Change-Id: I138af645c877f343f0490152b9702698b7d36582
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
frameworks/base: Fix compile errors

Fix ISO C++11 incompatibility in TextLayoutCache and
aliasing violation in FontRenderer

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
frameworks/base: Fix build in ISO C++11 mode

Change-Id: I5d3ba44cc9faa5826a5a0a6b37c8f0eb2872e1ac
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
hwui: Fix build in ISO C++11 mode

Make sure log calls can't be confused with C++11 string literals

Change-Id: I1d458e92e690f6f2b922a05494db8c01da54e460
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Work around uint16_t vs. char16_t confusion

Change-Id: I188e5a82b2dba821710eaea85d6cbef2ae004ce9
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>