Revert "Frameworks: TRDS fix possible UI freeze on auto mode change"

This reverts commit 01fce5f446fec9332f7dd412666458aeab954c99.
Revert "Harden against transiently unavailable backup transports"

This reverts commit 3c11c88cc44035a7943dcbda41f8f2923310c9b3.
Show live wallpapers in the recents view on high-end devices

Change-Id: Iefbf4f292b6a9bfdb516f154cc2976db2ba86cde
[1/2] Speed up booting on multicore devices.

1. Add multithreading support to Installer/installd.
2. Parallelize package scanning.
3. Parallelize boot dexopt.

Change-Id: Id42b2bf4a737f93f9ecd9b5819344adbb735f0fb
Live Volume Steps [1/2]

lvs: transitioned volume steps volume normalization.

-This calculates an equivalent volume ratio for the new
volume steps.

-example: Volume steps are set at 60. Volume is set at 5. That is
very low volume. Then volume steps are switched to 5. Now you
are instantly in a state were your volume steps are 5 and your
volume is 5. That's full volume! This fixes that issue.

-So it basically keeps the volume from jumping around while your
changing volume steps. It may be a little lower but should be
very close.

Change-Id: I1f50a68f5e361976f463b2497e2fea765144e5a1
[1/2] Base: Volume panel timeout

Change-Id: Iba6cca4afd5cc1ed81ada2564f03360345fbdd6c
wifistatetracker: silence more logging

Change-Id: I3d8e7cf0ed028b1213149d89088a2021c838e433
[2/2]Show CPU Info

This shows CPU temp (if available) for every core governor + online + freq

Change-Id: I4bcd3eb9801332ccf20785c146f3701444c03628

Conflicts:
	packages/SystemUI/AndroidManifest.xml
	packages/SystemUI/src/com/android/systemui/BootReceiver.java
Remove duplicate code in Editor.java

Eliminate duplicates by calling resumeBlink()/suspendBlink().

Change-Id: Ia19ae1bf1a5c981700aa20be67ed9d557e2bfc56
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Fix graphics corruption caused by HWUI caches

Some caches(PatchCache, TextureCache, PathCache) for HWUI
uses deferred removal for their cache entries even though
actual resource objects are immediately freed by
ResourceCache.
For this reason, the uniqueness of a resource address in
the caches is not guaranteed in specific cases.
(Because malloc() can return the same address when malloc()
and free() called very frequently.)

So it can be possible the cache have two cache entries for
two different resources but the same memory address.
(Of course one of the resources is already freed.)
It also can be possible mGarbage vector in PatchCache has
duplicated addresses and this can lead to duplicated free
blocks in the free block list and graphics corruption.
(Deferred removal was implmeneted based on an assumption of
unique resource addresses.)

So this patch makes sure resource objects are freed after
the resources are removed from the caches to guarantee
the uniqueness of a resource address and prevent graphics
corruption.

Change-Id: I040f033a4fc783d2c4bc04b113589657c36fb15b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Audio: Fixed system/call stream volume can't adjust with HS connected.

Issue Description:
When headset connected, the system/voice call stream volume can't be
adjusted from Volume bar.

Root Cause:
Currently adjustStreamVolume is applied to stream type alias and the
device for the stream alias. So when headset connected and adjust
volume for SYSTEM_STREAM, the operation will be applied to RING_STREAM
(which is aliased by SYSTEM_STREAM) and speaker. As headset is returned
from getDeviceForStream(SYSTEM_STREAM), but speaker for RING_STREAM.

Solution:
Change the adjustStreamVolume to apply volume to the stream alias and
the device for the stream type exactly.

Change-Id: Icd226d9eb197017cd3c186a0096edaed755680ec
Signed-off-by: Guo Xie <gxie@marvell.com>
ANR caused by incorrect cleanup in BroadcastQueue.

Two broadcasts could be sent to the same app simultaneously:
one foreground, one background. For example, LOCALE_CHANGED
and PACKAGE_CHANGED are delievered to com.android.vending
at the same time.
1. AMS started new vending process to handle LOCALE_CHANGED.
   And set app.curReceiver = LOCALE_CHANGED.
2. Before LOCALE_CHANGED is handled by vending process,
   PACKAGE_CHANGED was delievered to vending process too.
   AMS set app.curReceiver = PACKAGE_CHANGED. Bad!
3. Vending process finished handling LOCALE_CHANGED.
   AMS clear app.curReceiver = NULL. Bad!
   And Vending process  killed itself without handling
   PACKAGE_CHANGED.
4. AMS known vending process has died, but didn't know that
   BgBroadcastQueue was still waiting for finish message
   for PACKAGE_CHANGED.
At last, BgBroadcastQueue reported ANR for PACKAGE_CHANGED.

This patch adds protection before clearing app.curReceiver,
only set to NULL if the finishing receiver = app.curReceiver
So handleAppDied would know that PACKAGE_CHANGED was not
finished yet, it will abort the broadcast and continue.

Change-Id: Ic4f31b35e21823d4a3c27712391ecbede213a494
Signed-off-by: Guobin Zhang <guobin.zhang@intel.com>
This value should be hidden.

Change-Id: I2b31c769649650cbbbd5fcadc315c6e0e6e76c1a
frameworks/base:(Hack)Print the content of textview

This hack allows us to print content of Textview
when ro.debug.textview is set . This allows us
to capture the contents of textview which will help
us capture benchmark results for thirdparty apps
which use TextView to display results.

Change-Id: I3500cc35b37c08d93e24ccaf12dcce359fc84da2
Signed-off-by: Vishal Bhoj <vishal.bhoj@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
frameworks/base:(Hack)Print the content displayed with Canvas.drawText

This hack allows us to print content that displayed with the drawText
method of Canvas.java when ro.debug.drawtext is set to true.

This allows us to capture the contents on the screeen
which will help us capture benchmark results for thirdparty apps
which use drawText of Canvas to display results.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
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>
load non opengles wallpapers for platforms without hardware graphics

Platforms without a hardware graphics, frequently get
"Unfortunately, System UI Crashed" pop-up message on boot-up, which
is due to an Android Runtime Exception
"java.lang.RuntimeException: eglConfig not initialized" when SystemUI
fail to load OpenGLES wallpapers.

This patch make sure that Android runtime checks for GPU availability
(by checking a build time property "ro.nohardwaregfx") before loading
opengles wallpapers.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
ProcessStats: Handle changes in the scaling frequnency

Switching from MP to IKS mode results increase in number of operating points
and results in bug #1183781 . The patch makes sure that whenever the available
scaling frequency changes it resets the existing values and sets them as per the
new values.

Change-Id: Ic74cdc2015f3c4ddd61cb116d1f4b4ed1204a3bf
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
frameworks/base: Fix build in ISO C++11 mode

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