framework: Allow specifying max wallpaper width

For some devices with very high-res screen (1920x1200), the wallpaper
width suggested by the launcher may be too large for the GPU and so
we need to limit it. (2048 for the above mentioned screen)

We don't need to limit the height since that's the height of the
screen.

Change-Id: I188ac585370fb705cfa50d5ad84786e6f2cbd016

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/public.xml
	services/java/com/android/server/WallpaperManagerService.java
bootanimation: performance/speedup enhancements

bootanim: Don't cache textures if they're expected to use a lot of VRAM (rmcc)
https://github.com/CyanogenMod/android_frameworks_base/commit/14f9eecd3f543a25c4a2053d6155a9396a777a3a#cmds/bootanimation

bootanimation: performance enhancements (turl)
https://github.com/CyanogenMod/android_frameworks_base/commit/e6b54405aa70d7503a114d9c90ef7518abdd7133#cmds/bootanimation

bootanimation: fix usage of LOGW (intervigilium)
https://github.com/CyanogenMod/android_frameworks_base/commit/e45cf7d232490f44aecf8f2447220a8b5ace4c10#cmds/bootanimation

bootanimation: allow using RGB565 instead of ARGB8888 (tpruvot)
https://github.com/CyanogenMod/android_frameworks_base/commit/204282870a9c69b04ad5ddecd73fafbd7996cbc0#cmds/bootanimation

Change-Id: I203fa23f77d1349fb822a7662e2cd3998ba4c814

bootanim: Don't cache textures if they're expected to use a lot of VRAM

bootanimation cached all the textures generated until the animation
was completed.
For Hi-res animations with lots of frames (like the new CM9 anim on
xhdpi devices), this implied using large amounts of video RAM, more
than most devices actually have available, causing the animation to
stall (and in some cases, gralloc to lock up); so if an animation is
expected to use a lot of RAM (rough estimation based on frame size
and number of frames), disable cache entirely and generate the textures
on demand

Change-Id: I157e5cdde2aab1d82d980d77cbedd9f127c83a1d

bootanimation: performance enhancements

This patch implements two simple performance enhancements, which
might benefit devices. They are completely opt-in by setting
the following variables.

  * TARGET_BOOTANIMATION_PRELOAD: will preload the bootanimation
    zip to memory; this is handy on devices where the storage
    might be slow. By preloading it, we get quick access to the
    zip file, and the animation doesn't stutter.

  * TARGET_BOOTANIMATION_TEXTURE_CACHE: allows maintainers to
    force texture cache on/off.

Also fixes the sign warnings related to int / size_t comparison

Change-Id: Ie92d1b0aa90b43ba39c368a2a33657a60c3a64b5

bootanimation: fix usage of LOGW

Change-Id: I1d59df9f44f414d80058a532644cbbb40e22c701

bootanimation: allow using RGB565 instead of ARGB8888

RGB565 uses considerably less memory, and together with texture
cache, it allows us to offer a really smooth bootanimation on
not so powerful devices.

Change-Id: I9da8fd7e6a587b5895519dd0983ec9b8f676771b
Signed-off-by: houst0nn <houstonn@gmail.com>
bootanim: Add continuous splash support

 * We may or may not want to have a very smooth transition from the
   bootloader into Android by way of a continuous splash feature.
 * Add a compile-time flag which disables the initial screen clearing
   so that we don't drop a frame during the transition.

Change-Id: Ic453c901f1030ffebd9bdbeec59109bb5c585629
core: Add support for Luxembourgish

Change-Id: Idd65417a08c5035a75e0d33617dc28c88757a293
Hang off call by power button while screen is on

Enable power button end call and screen is off.  User use power button
to turn on screen will end call.  Should turn on screen and not end call

Change-Id: Idf34f7724dbf1796205332c5c7ef663102f8a30c
Signed-off-by: shower <shower929@gmail.com>
Do not show Home behind full screen activity

When ensureActivitiesVisibleLocked goes through foreground activity
stack and reaches non-fullscreen activity, it sets showHomeBehindStack
variable to true.

If there is a fullscreen activity behind, showHomeBehindStack remains
unchanged, which causes Home application to be displayed anyway.
In this case user will see a fullscreen activity and Home activity
simultaneously.

To fix the issue we set showHomeBehindStack to false when we reach
fullscreen activity in the activity stack.

This was made visible by the following commit:
446ef1de8d373c1b017df8d19ebf9a47811fb402

Change-Id: I535c1283a4e26f5cf606375b837d4b7195324af0
Prevent Lockscreen album art from activating FLAG_KEEP_SCREEN_ON

This is a small fix to the showWallpaper method, in which a power
consumption problem has been introduced. This showWallpaper method
toggles the window flag FLAG_SHOW_WALLPAPER, when album art is being
shown in Lockscreen. It is important to set pixel format to
PixelFormat.OPAQUE if flag FLAG_SHOW_WALLPAPER is not being set.

If not, an application that uses window flag FLAG_KEEP_SCREEN_ON
will prevent the keyguard from going to sleep and drain battery.

Change-Id: I1808be28047977ae5ac4dd1168ea25cac8a55a78

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
remove unnecessary switchUser call

If userId doesn't change, no need to do switchuser.or it will
introduce some tweak for gps modules in quick off/on because
they need cost time in off/on.

Change-Id: Ie5e408dc8be69c8a63a18bcb2cfe478cef4d70e6
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
Solve three memory leaks related to PatchCache

A Patch can be fairly large, holding bitmap data, but
is also frequently leaked which adds to the severity.
The feature is used in many important processes such
as Home, SystemUI and Chrome.

The following leaks are solved:

1. The Patch itself was not always freed.
PatchCache::removeDeferred() can mark patches to be
cared for by PatchCache::clearGarbage(). But
mCache.remove() would only destroy the container
and the pointer, not the Patch object itself.

2. The vertices stored in the Patch at Patch::createMesh()
would always leak. The empty/default destructor in Patch
would not properly destroy "vertices" since it's just a
pointer.

3. A BufferBlock that's added to the mFreeBlocks
in PatchCache could leak. The leak happened when a
patch later needed the entire free block, because the
object was removed from the list but never deleted
in PatchCache::setupMesh().

Change-Id: I41e60824479230b67426fc546d3dbff294c8891f
MSimNetworkController: fix Quick Settings

Proper values are sent based on the SIM set as the data SIM

Change-Id: I2e70e52af54261d54b9527157ae69ae26bec97f1
msim: Add DC-HSPAP support

Change-Id: I811af85ba163d57589cb60cd1bb0996b817ee186
server: start cne service

Connectivity Engine (CnE) provides advanced network selection per socket,
reduced signalling traffic, and increased power savings.
The service implements the interface defined by CNEManager which Android
applications may use.

Change-Id: I9ffd1f5d60f5e9e185ab482a35b3b07f29a4124c
(cherry picked from commit 3a4e3ba1bc67c460ec3c2fd4ef169ae25e3e69b1)
(cherry picked from commit 1bb0036652318ac8bbecf3e6c810bbc779387c61)
(cherry picked from commit 3c8af4a2546d9b71d113072d680107cb56651e71)
(cherry picked from commit 861a4b062196020bf24a5b3731c717b5b95a7d77)
(cherry picked from commit e3dba9799892f13c5bc2376b81cf5dceae17492c)

Add Connectivity Engine (CnE) WQE support

Enhanced connectivity features viz. Wifi Quality Estimation.
Supports dual network mode - wifi & mobile simultaneously.
Use QcConnectivityService when CnE is enabled for all CnE features.

Change-Id: I14b02e21515bfc1b5fd2fc4f28e5190fa80f83f8

server: Initialize ConnectivityService on low memory device

Skip initialization of QcConnectivityService and
use ConnectivityService.java for a low memory device

CRs-Fixed: 531430

Change-Id: I2111ec32f6e40ca79b7fc91ec4cef97ac27f3b3a

Update CNE feature values.

Start QcConnectivityServices for the new
application traffic profiling feature too.

Change-Id: I52ae76420ebd098d43fe0663f41ce622a407b90e

connectivity: allow inheritance to subclass

set modifier to protected in order to allow
subclass to use the same data and avoid redefinition.

Change-Id: I2dc688d3e433775cb073ec6faae3981807212cc9

Change visibility of methods

Change the visibility of some methods so that
they are accessible to the child class.

Change-Id: Ie1a45978b42742cac0aaedba29fb2375882c0ae4
CRs-Fixed: 611347
Merge branch 'kitkat' of https://github.com/AOSPA-legacy/android_frameworks_base into PA-kk

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	services/java/com/android/server/SystemServer.java