fb: fix reconstruct statusbar illegal argument exception

Finally I got a logcat what is happening in rare cases. If the reconstruct
happens during a notification ticker was send it returns a negative
width value for the static layout and systemUI crashes.

E/AndroidRuntime(  970): java.lang.IllegalArgumentException: Layout: -23 < 0
E/AndroidRuntime(  970):        at android.text.Layout.<init>(Layout.java:138)
E/AndroidRuntime(  970):        at android.text.StaticLayout.<init>(StaticLayout.java:104)
E/AndroidRuntime(  970):        at android.text.StaticLayout.<init>(StaticLayout.java:90)
E/AndroidRuntime(  970):        at android.text.StaticLayout.<init>(StaticLayout.java:68)
E/AndroidRuntime(  970):        at android.text.StaticLayout.<init>(StaticLayout.java:48)
E/AndroidRuntime(  970):        at com.android.systemui.statusbar.phone.Ticker$Segment.getLayout(Ticker.java:72)
E/AndroidRuntime(  970):        at com.android.systemui.statusbar.phone.Ticker$Segment.getText(Ticker.java:91)
E/AndroidRuntime(  970):        at com.android.systemui.statusbar.phone.Ticker.addEntry(Ticker.java:226)
E/AndroidRuntime(  970):        at com.android.systemui.statusbar.phone.PhoneStatusBar.tick(PhoneStatusBar.java:2862)
E/AndroidRuntime(  970):        at com.android.systemui.statusbar.phone.PhoneStatusBar.addNotification(PhoneStatusBar.java:1432)
E/AndroidRuntime(  970):        at com.android.systemui.statusbar.CommandQueue$H.handleMessage(CommandQueue.java:322)

to avoid this check before a new StaticLayout is constructed if the width is < 0 and if this
is the case abort the operation. This is in this case a legit way due that the notification
gets reconstructed during this process later so or so

Change-Id: I6ed68bbb9226101d3573f3d76deb793ddae69627
Screenstate Toggle : Remove 2G toggle (1/2)

dropped and use PA implementation
add vanir SU utility classes

originally ported from AOKP

Change-Id: Ibc8c16e75339940f071b3b81fdc140690122e9be
Active display: Respect Quiet Hours

PS2: Use QuietHoursHelper

PS4: Fix PS3

Change-Id: Iba6f339e8073fa28ee6b96a6b889cd3faf724111
[WIP] Multi-window

This is a big work in progress, which currently has some bugs,
but begins to look okay.

You can already multitask a little bit, by using the
app switcher and long-pressing an icon, then select "Add to
Split View".
Last window touched gets the key focus.

Code is very ugly, I know. Don't merge it, don't use it
for now. Unless you want to make your code ugly.

Enjoy :)

PS 11-16: Rebase

Change-Id: I4a03a84539fd3ac1273f0d3503fe8fafcd16be26

Conflicts:
	core/java/android/app/Activity.java
	core/java/android/app/IActivityManager.java
	core/java/android/content/Intent.java
	core/java/android/view/IWindowManager.aidl
	packages/SystemUI/res/values/custom_strings.xml
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
	services/java/com/android/server/am/ActivityStack.java
	services/java/com/android/server/wm/WindowManagerService.java
Revert "Fix for Concurrency issue reported in  525529"

This reverts commit 7eb1fcb76989f11aaa9ca0a78e0361239ff5317d.

Change-Id: I37815b93bf2b25caff171888dc13788479a9c8c4
CRs-Fixed: 585504
Use highp precision for scaled coordination

If scaled coordination is closer to zero than what
the medium precision can store, distance becomes
zero and it causes divided by zero.

Change-Id: I8ee921dd1f57564a442e685266b12d95fc08e165
NetworkPolicy: Validate policy templates before updating

Ensure all the policies to be added are validated, otherwise
this service will throw IllegalArgumentException and cause
system crash when updating network template after receiving
ACTION_NETWORK_STATS_UPDATED.

Change-Id: I3faef0ac2a2fcea64ba5dde9c9256f6714280e2e
CRs-Fixed: 561490
WifiState: Don't aquire transitionwakelock in airplane mode

NetworkTransitionWakelock is for transition from Wifi to mobile.
It will cause device no sleep for 60s. There is no need to acquire
it in airplane mode.

Change-Id: I1487dc4787948d09e482f22e88d01768b54964da
Add touch feedback to the clear all recents button
privacyguard: Share privacy package name between activity stacks

AOSP 4.4 now has a stack supervisor with differents activity stacks for home and focus activities.
Every ActivityStack instance has a ref to this supervisor. Just share the privacy guard package name
throught the supervisor.

Patchset 2: Fix formatting

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

Conflicts:
	services/java/com/android/server/am/ActivityStack.java
ActivityThread: Throw an exception back to caller when supposed to

this dirt snuck in with halo.

Change-Id: I8f6ad0f55d135449eb08afc073fe4b3a23ebf4cf
Temp fix with multi window.
sometimes the second task not splittling as it lost the focus by begginning
force to check its status.
Mokee frameworks
Squash Translation from CM and Slim
Port back Flip to mute Action from 4.2 (1/3)
Active Display : permission fix from mokee

- do not unregister the caller if it is coming from ActiveDisplay as well
Fix NPE issue
Squash Update from Mokee
Revert "Squash Update from Mokee"

This reverts commit f34918281c58ead434f089919c9ea178c607ec51.
notification/settingspanel: stop getting a gesture recorder

We're currently getting gesture information on fling even
if the log ouput for DEBUG_GESTURES is turned off so.. lets stop.

-Vanir

Change-Id: I70810fb2fb9e4b134492ffdd1ac844fe65f7fb75