revert "Hover 1/2"

This reverts:

2c778cc Revert "HOVER [1/2]"
bda2194 Revert "HOVER: Theme Engine compatibilities and some resources tweaks"
f2df944 Revert "HOVER: Fix a couple of things:"
e3c0f1d Revert "Hover settings (1/2)"
0a29ebf Revert "Hover notification timeout (1/2)"
4c1a72d Revert "HOVER: Option to exclude topmost app [1/2]"
31f334b Revert "revert "HOVER: Option to only show up in Fullscreen-Mode [1/2]""
df90153 Revert "HeadsUp: fix a nullpointer caused by a previous commit"
20a4ff9 Revert "HOVER: Match notification width on tablets too"
d485733 Revert "HOVER: Ensure to clear after reparenting all notifications"
e085049 Revert "HOVER: Fix notification content not being updated"
e714b3e Revert "HOVER: Rework showing behavior on tablets"
c1e18a8 Revert "HOVER: Don't process and/or show foreground app notifications"
b193dcb Revert "Revert "HeadsUp: fix a nullpointer caused by a previous commit""
3ed29be Revert "Hover: exclude from insecure lockscreen (1/2)"
6434f45 Revert "Revert "HOVER: Theme Engine compatibilities and some resources tweaks""
HeadsUp: Launch in floating window

Add some part of NotificationHelper
Credits to AOSPA team

Taken from:
https://github.com/lion0738/android_frameworks_base/commit/9e4b4b3bf10ccaee3ff64bb7b74f929210b85d69

Change-Id: I7001cebd69790b46b8dcfe9150c7ef104e5427a2

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
HeadsUp: option to launch in floating window [1/2]

Change-Id: Ia8ffb4088f5b48b222a77ef486ba8b14e193c26f
PhoneStatusBar: Readd headsup view when theme change occurs.

Change-Id: I5bbfa56650a1b2f9cd9c4365650f769bed009ab0

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
BaseStatusBar: Dismiss heads up on backpress.

Change-Id: I5b6191657cf0b74d825eb653a6e82c33e0527aad
Frameworks: QS performance profiles tile

Patchset 2: Fix not null comparation
Patchset 3: xxhdpi drawables
Patchset 4: Fix xxhdpi drawables (thx blunden)
            Rebased
Patchset 5: Add suggestions
            Sync on boot the system property with the setting
Patchset 6: Rebased

Change-Id: Ib32d3734b63f88a3473e0ab10d8edf30dae9ceb6
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Revert "Revert "power: Add CPU boosting interface""

This reverts commit 440bc65060fefb9f513b6a3662a8cd34bb4ff42e.
perf: Improve performance profiles

 * Performance Profiles is going to grow into a much more powerful
   feature which can apply advanced optimizations or power saving
   techniques depending on both the state of the hardware as well
   as the current applications in use.
 * Refactor the original code and move it into PowerManager so
   that it's managed from the same place.
 * Implement "automatic performance profiles". This feature will
   automatically select a profile when specific activities are
   running. Currently this list is static and engages performance
   mode for several benchmarks (trollface).
 * Added support for a new power hint, POWER_HINT_SET_PROFILE.
   Currently, these profiles are fired using a property trigger
   in init. This is easy, but the PowerHAL can do more.
 * Moved the setting to Settings.Secure and also wrapped calls
   to the service in the DEVICE_POWER permission. Nobody should
   mess with this stuff except the system.

TODO:
 * Allow user configuration per-app.
 * Implement an advanced power-saving mode.

Change-Id: I140ebc0648c4cf05900e005923247c3180be8c93

Conflicts:
	core/java/android/os/IPowerManager.aidl
	core/java/android/provider/Settings.java
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	services/java/com/android/server/power/PowerManagerService.java

Conflicts:
	core/java/android/provider/Settings.java
perf: Send a boost hint when a key on the navbar is pressed

 * A lot of stuff happens, especially when invoking recents.
 * Get ahead of the storm by sending a boost hint before
   kicking off the animations.

Change-Id: I0cecd0c58f8bc8479ea44f63af796500d7b9d7d2

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
base: fix volume panel translucency after stream icon click

Change-Id: I290ecb07106198882739a5b734f4d6a89d3eb5fb
JIRA: CYAN-4487
Issue: https://jira.cyanogenmod.org/browse/CYAN-4487
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

Conflicts:
	core/java/android/view/VolumePanel.java
IndexOutOfBoundsException observed rarely in ProcessStats

Sometime IndexOutOfBoundsException is observed in ProcessStats
while allocating longs array. This could be due to synchronization.
This fix will return if array index is >= size.

Change-Id: I1df34152c95f2ff61829da07f750e79a6f1efab3
CRs-fixed: 626638
base: App crash when select suggestion's length more than specified.

App crashed by catch IndexOutOfBoundsException which raised
by check span range when select suggested string.The root
cause is that the editor will truncate the suggested string
which length is more than it specified, but it also set span
use the suggestion's original length.

Update the suggestion's real length after editor replace the
original string to suggested.

Change-Id: I2d765701934a9e68be172cb87a104590f3cdeceb
CRs-Fixed: 532211
Applications crash observed while selecting words from suggestion list

While selecting words from suggestion list, applications are crashing as
textview span are going out of index. For textinput where spaces are not
allowed length difference shall be calculated properly to avoid Index
out of bound situations.

Change-Id: I360318cf9241abbb7f58ad1ddf3f3c8d364f17d1
CRs-Fixed: 642057
Fixing IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within the loop may delete
the elements from History stack.

Change-Id: I195da10a8e9161572bdb653ad3021998d4f2a939
CRs-Fixed: 651963
audio: Fixed dead lock in AudioService during volume change

- AudioService goes into dead lock when there is a volume
  change for source stream and the respective aliased stream
  simultaneously from multiple threads
- When setIndex is called for source stream, it also updates
  the index for the aliased streams. Meantime, setAllIndexes
  is called on aliased stream. Initially, it gets index of
  default device of source stream. It requires lock on the
  source stream. This is leading to a dead lock
- Fix is to avoid locking parent while updating child
  streams. Removing lock from method and synchronizing
  parent only when it is updating member variable.

Change-Id: Id38e539e2ec178ea25548312a1dd62d2de3043da
CRs-fixed: 635789
Added validity check for Pointer Index

Checking if the pointer index is valid before querying for X & Y
coordinates. This is done to avoid IllegalArgumentException.

Change-Id: Ic7f3022d33c313a0bfe8b55c9bc89019b33d23b7
Frameworks: Fix to avoid crash when the tab is not set.

Tab is not highlighted in Videoapp unlike Music app.
Instead the list is highlighted with mSelectedTab a negative value
when onFocusChange is called.
Add a check for mSelectedTab.

Change-Id: I930657b8a9be4be4d973f876242a15a667ec6f94
CRs-Fixed: 657606
audio: Inform audio HAL if it is a voice call initiated by Telephony

setMode() API with IN_CALL mode can be called by any of the Apps.
In HAL, it is required to distinguish if it is a real voice call
or not. Inform to audio HAL if it is a voice call by checking
getPhonestate() updated by telephony.

CRs-Fixed: 662804
Change-Id: I20a661f49f6566bdd1e23d6de18b509e2728ef19
Common: Add the api to parse the string to current language

These APIs are used to parse the text to local languange.
For example, if the carrier name in English is got from network or SIM card, we will
use these APIs to parse it to local language and display it to the user.

Change-Id: Id4922c526d77f434b43c5ac013472b6a1cd5069c
Fixing parcel leaks to avoid virtual memory leak

Client has to call recycle() on parcel object after its usage
otherwise native layer of binder won't clear the resources of
parcel which were allocated for IPC

Change-Id: Ib31ddcc92aa4ebd80bb66729922b9133692e9c9e