[1/2] base: Add Haptic Feedback to quicktiles

Change-Id: Ia3bbb6ef90a9f7b3cf45c341d3b95eb131a96694
(cherry picked from commit c90172514c0710853c9f066526bac92129b83806)
Revert "[3/3] AudioEffect: Add a stereo widener effect"

This reverts commit 5a1414c53f81118a35e8fb22231dcdd8ae335515.

(cherry picked from commit ac117455d8888bddc438343c7f901bb7c1e1edbf)
Revert "[3/3] AudioFX: Add center frequency param to bassboost"

This reverts commit e6b968b3bdf549ac65d70c21e937104a052dd38f.

(cherry picked from commit fc2a35e9175f4cfe192dd4fe85d5e1df0cede8ba)
Tunning max allowed background services

The serialize running of background services feature
delay some services startup when system bootup, and
lead some abnormal behaivor at the early of system startup.
Tunning will be disabled after system complete bootup.

Change-Id: I834607d9156253bee13848586a8136e24760fdf4
(cherry picked from commit bb4e8ebeb94d1199d4ac0a886635de2f1be2e0e2)
SpellChecker: bound check for string end

Check whether spell check result is out of end of string
Use strict one to avoid IndexOutOfBoundsException.

Change-Id: I6acac77e1e9750258ed364817a8615a6f56bebe4
(cherry picked from commit cd0d5dc9e390ff2f48ab2f910da5191f7b765a0e)
[ActivityManager] Ensure consistency behavior when a background activity brings another existed activity to front.

Symptom: ANR occurs on previous activity.
Root Cause:
In KK, when a background activity starts another existed background activity (bring to front),
if current focused stack is not the same as the stack of target starting activity,
it will still resume the top of target stack, even the top activity on the target stack may not the same as target activity.
And it will result incorrect focus, press back key will send to previous stack's top then popup ANR on previous activity:
"Reason: Waiting because no window has focus but there is a focused application".

By original code comment, it looks 'bring to front' should not happen in this issue case.
// If the target task is not in the front, then we need
// to bring it to the front...  except...  well, with
// SINGLE_TASK_LAUNCH it's not entirely clear.  We'd like
// to have the same behavior as if a new instance was
// being started, which means not bringing it to the front
// if the caller is not itself in the front.

If the caller and target are in the same stask, it will just deliver new intent without changing task order (the same behavior as JellyBean).
So the patch concept is just to avoid to use target stack to resume top when caller and target are in different stack.

Solution: Do not allow to resume another stack top if non-top activity try to bring existed activity to front.
It may not be a good solution, just a reminder for the issue case.

Reproduce steps:
Assume A, B, C are different app tasks.
When the application stack is like:
  Top C
      B
      A

 #Case 1: Home is foreground
  A starts B with NEW_TASK, C will resume, focus still stays at Home, and window order does not update.
  Then press back key or volumn key will result ANR on Home.

 #Case 2: App is foreground (Resumed activity is C)
  A starts Home, Home will resume, focus still stays at C, and window order does did not update.
  Then press back key or volumn key will result ANR on C.

Change-Id: If05070123b248e2335791e43a4d4ddee6db11d84
(cherry picked from commit ee35386cfdd51a6f32c4c9be2445cafcdd960d05)
UserTile: Fix displaying user information for multi-user devices

In commit 89ab0eb097322ac8eec40159b888dfb03b9413e9, we improved
the handling of single user devices but appear to have also
entirely deleted the name / avatar for multi-user devices.

This commit restores the deleted code for multi-user devices.

This fixes CYAN-4023.

Change-Id: I69fe1504da2b32cd5bf0fdc87f8f78c960e9c77f
(cherry picked from commit 8842fb63fa1668821c04924c5b93a078a640987e)
MediaFile: support more media types

Change-Id: Ib3109c5ebc762b97e45bd0bb5fa82ad77b0e6822
(cherry picked from commit c66f6749b12f88e47cd14e0a2a0739516327492c)
CM11 Themes: Ensure customTheme is not null.

The configuration retrieved via getConfiguration() sometimes contains
a null customTheme which results in the theme returning to holo when
applying a component such as icons.  Icons will change but styles
and fonts would return to the default.

Change-Id: Iac0cb8eed5de8fdc9fe8efd697d968f26e801c08
(cherry picked from commit 04a18236cabe6ad03023b3e152baee79ab78bdd1)
More red

(cherry picked from commit cef17756217525b2a51edff9062a1eef34af1a9b)
CM11 Themes: Properly handle SystemUI theme package name.

Change-Id: Ia8915684e1620184dcc513c2c5039ea20aabbd04
(cherry picked from commit 2bb7946b8dd32194d744b214732e8a93a5d07345)
Add MOAR Red

(cherry picked from commit b66f059c2c6e416b84e0773effe7cdb1b5a34e2a)
[1/2] Frameworks: Wakelock Blocker

Change-Id: Id4fd1d8da6ed40517094a5a156f7c6fea622e985

Conflicts:
	services/java/com/android/server/power/PowerManagerService.java

(cherry picked from commit a09a22527e846f0aa2df35b61bc23850b10ed581)

Conflicts:
	core/java/android/provider/Settings.java
Merge "CM11 Themes: Common overlay for sharing resources. [1/2]" into cm-11.0

(cherry picked from commit 814f46b43ae5a370235d4f45221685a075fe8da9)

Conflicts:
	core/java/android/content/res/AssetManager.java
	include/androidfw/AssetManager.h
Merge pull request #2 from CyanogenMod/cm-11.0

Update to upstream
(cherry picked from commit 174b8a5a2274a8a3d7995913c7ab7f5a97f617aa)

Conflicts:
	core/java/android/content/res/AssetManager.java
Set themes to install internal only

Themes should not be moveable to sdcard. Before this patch the new
style themes installed with forward lock would fail.

Change-Id: Iea50f5526b1c2c56a825757eac5bf4bb01b4686d
(cherry picked from commit 1c57c20bc5e7a84c34c9f3d8d64daff9f14624e2)
Floating Window: Welcome back

* Port squashed jellybean floating window to kitkat.

Floating window contributors:
@drcmda
@beerbong
@D4rKn3sSyS

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Merge notification manager service changes.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: If3d6338f657915754bd6cb9cb987df62c17aa6d0

Conflicts:
	services/java/com/android/server/NotificationManagerService.java

(cherry picked from commit afbe589a22cc32de69a27fe8ad77594ff076f166)
Kill floating activities running in the same thread when tapping outside
This change makes all activities from the same app to be finished when we tap outside the halo window. Other apps running in different threads
(floating or not) won't be finished.

Port from here: ParanoidAndroid/android_frameworks_base@f489f45

Change-Id: I9a6080d8e509089197c27ba415bf1f93bf74cd30
(cherry picked from commit 187b499f0b077a58fb5eda454a8300de19156503)
Launch floating notifications from notification panel (long click)

* Status bar - long click on notification select 'floating mode' option

Change-Id: Icf2915cf71f07d19cf8179ee5e561891b0a78e77
(cherry picked from commit d32ebb6af0f9b93bb678807408935dfcf889047f)
Recents: Launch as Floating App

Change-Id: Id087a3a0b38ffa637ad9d97647eff6a02d241006
(cherry picked from commit 66ee5611777539fa4a4daadc3e9e804516352652)