Halo: port Halo from Paranoid

Change-Id: I8a7255d801e9033c4997909045c0637867d6f562
HALO cleanup

hdpi and mdpi drawables were inconsistent, if you plan to use HALO on
lower res devices you must reproduce them.

Change-Id: I2746837bacd60c3079ace4c7523a68b8cd415f5f

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/halo/Halo.java
HALO: new drawables for hdpi and mdpi

- scaled down the xhdpi drawables properly for hdpi and mdpi
- removed some old and unused halo pngs

Conflicts:
	packages/SystemUI/res/drawable-hdpi/ic_notify_halo_normal.png
	packages/SystemUI/res/drawable-hdpi/ic_notify_halo_pressed.png
	packages/SystemUI/res/drawable-mdpi/ic_notify_halo_normal.png
	packages/SystemUI/res/drawable-mdpi/ic_notify_halo_pressed.png

Change-Id: I24ba08b833f3c4bae6ccef94e6028c5389d3abf5
HALO: Option to pause the underlying app (1/2)

- adds an option to pause the active app when using HALO
- this is enabled by default for devices with low memory
- (currently: <640MB RAM available to the kernel)

Conflicts:
	core/java/android/provider/Settings.java
	services/java/com/android/server/am/ActivityStack.java

Change-Id: I2be96d53d84cad7aad01ed554c5637e1073828cf
Reworked transparent layer
When a halo'ed window is opened, the transparent layer will be always visible. It will manage the background dim.
This fixes some apps dimming its sandboxed processes (like chrome).

LayerActivity manages its own lifecycle. When it's focused after paused it finishes itself.

System processes (identified by "android" pkg in SystemUI and system uid in Activity) don't use the layer and still use their own background. This
has been kept this way to not interfere with their activity.

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Change-Id: I6474c506af082d9d62c008aea2d22f150c0a0dfb
LayerActivity: Corrected lifecycle
Should contemplate the case that the activity gets stopped
Show as floating window on recent apps

This also removes "hybrid properties" from recents menu, it is fairly unneeded
now. This is a test, It's probable that it will be removed later

Change-Id: I3db3a996fa08367e3dfa4231079fe5e811e3b08a

Conflicts:
	packages/SystemUI/res/menu/recent_popup_menu.xml
	packages/SystemUI/res/values-es/strings.xml
	packages/SystemUI/res/values/strings.xml
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
HALO: Add master switch to disable Halo (1/2)

-Port master switch from @Der-Schubi.
-Fixed Halo not showed at first notifiction pulldown.

Change-Id: I51d7ceab86303e1d322b4d403e31ceb3173d3669

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Don't bring home to the front if we're opening a floating activity
Revert "HALO: Add master switch to disable Halo (1/2)"

This reverts commit b98ea1163279a1900d7516f4e73e4d712ecce249.
Give floating flag to previous activities in the stack
When launching stacked activities, only the last one is flagged as floating in sysui when tapping halo.
This causes the system to show the launcher when the first stacked activity is launched (this first intent gets the flag FLAG_ACTIVITY_TASK_ON_HOME
in TaskStackBuilder).
This change makes all the stacked activities get the floating flag if the last one has it.
Enable Halo pressed image in expanded status bar

Conflicts:
	packages/SystemUI/res/drawable/ic_notify_halo.xml

Change-Id: I5677dec3b7aadd5e3ebe610e8ffe00c2b39ee143
Halo: unregister settings obeservers

Change-Id: I57ec9b874c332bec8be2b3e3ed2505f6be53b79e
Revert removing FLAG_ACTIVITY_CLEAR_TOP from intent
Removing that flag from the intent provokes some apps not being able to finish pressing the back key.
This change doesn't affect other opened apps.

Change-Id: I81a47f8e648114d8e2144a3b9854ede299d67871
HALO: halo can save last position now

Change-Id: I5a608b02323ab9fdfa3922a3c9844e75c3a1ab09

fix

Change-Id: I00ced429cfcc90507b8cc14b228a74b8902e67e8
HALO: keep apps in recents

Change-Id: I9ede8a1aba8d6721f077a39a31b6cc5cd8272dc2

Conflicts:
	services/java/com/android/server/am/ActivityRecord.java

Conflicts:
	core/java/android/app/Activity.java
Prevent notification acces via HALO on protected lockscreens
HALO Style revamp

- speech bubbles are centered
- number batches are roundand simplified, same color as in g+
- markers appear as dots above the bubble
- hiding and dimissing triggers text hints
- couple of bugfixes

WARNING: some of the drawables are good for xhdpi only for now and must
be scaled down for the other resolutions

Change-Id: Ib656664f6f8c42b747df18d65d1e3fb40cb7480c

Conflicts:
	packages/SystemUI/res/values/strings.xml
Finish the floating activity again

Change-Id: I1db29ddd2c056d7645f1028e084face815a44e0c
HALO hiddenstate-fix + smaller numberbatch

once HALO is hidden an orientationchange won't wake it up getting in
your way.

Change-Id: Id7c2232e4e3e6e49392becbdcddeb1a494faafc8