fb: clean up our and AOSP code for wifi and carrier label animation

we introduced with this AOSP commit

https://github.com/SlimRoms/frameworks_base/commit/288e3ec70e866105ba61f9ebf259cad29786ad9c

the ability to keep wifi and carrier label up to date on every network
change which happens. The big advantage of this change is that all the
calls for updating the label which are present in PhoneStatusBar are not
needed anymore. We can reduce it to call only when we have animations in progress
or if notifications update and we must decide if the label is still visible or not.
This are way less animation calls then before and on clean AOSP

As well clean up some of our old code which workaround all this calls.

This commit fixes two present minor issues
- carrier label was visible behind notifications (AOSP behaviour but conflicts with our transparency settings)
- due of new updatehandling it happened sometimes that on switching to QS the label was a bit to long visible
- animations are now completly always in sync

PS:
- animate from qs to notification drawer a bit later

PS:
- simplify it more
- fix direct pulldown QS shows sometimes carrier label

Change-Id: I74b80b8b72817da460703635a027f57bb4858f32

Conflicts:

	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
fb: add bottom margin to stock default battery icon

We set the layout parameters programmatically so the fix from
google does not take effect. To solve set the bottom margin
programmatically based on the current display density

Change-Id: I9caa0e729afa19eb7cb852a1df6ad036a2839d1b
Frameworks: Fix 0% battery QS tile

when tile is recreated. Fetch the values from
BatteryController

Change-Id: Id0539016e1c479ac1f75535647d91a26f69a76b5
fb: disable navigation bar camera button if widget carousel is enabled

Beside that the animation which starts when dragging the camera icon
to the left is broken if the user has enabled carousel animation like
tablets it does not feel natural even when we use the right animation for it.

So diable the camera button in this case and allow only swiping the camera widget on carousel mode

Change-Id: I6ba5eda7cd4603b1644ae088401b57861e4937a1

Conflicts:

	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
fb: force carrier label height on first boot

reported tester issue:
- boot up
- pull down QS before any network action was done
- carrier/wifi label is shown on qs

Expected behaviour: should not show up on QS in any cases

Fix: force hide on first statusbar construct

seems to be in rare cases this update is needed to avoid showing the carrier
label on QS on first boot up and no connection is there hence emergency label
is shown

Change-Id: I72d2ddc7767938dd2ea657bd2d976b945b1f6467
Return: Smart Pulldown [1/2]

Adds the ability to directly open the QS panel when there are
no notifications present in the notification panel.
This commit combines the enhancement by HardCorePawn for detectin
notification types for the same.

Credits: kufikugel, HardCorePawn

PS 2-4 : Cleanup

Change-Id: I3c9b048f2616d2b8950930cc5bfac27c2364e826
[1/2] Base: Network traffic indicator

Before: http://i.imgur.com/bCR0oLZ.jpg
After: http://i.imgur.com/ssTi6pB.png

OmniGears: https://gerrit.omnirom.org/#/c/4851/

Change-Id: Ibd824b85f6c9f6fd96eb7787747bff2c71056263
frameworks/base: Day and week on data usage (1/2)

Adds the ability to set day and week on when the data usage
graph resets, instead of just month.

Change-Id: I61b0aa3bdea015793928e4af2b8d8a79147a123e
framework: Bring back the status bar activity indicators for mobile data and wifi

* adds a setting for this as well as reverting the following commit:

Change-Id: I7aa85f7c8442c45d17e42cac7823dfe93e3f24c1
Fixed incorrect calculation of dirty invalidation area

Padding was already taken into consideration before calling
invalidateDrawable in ProgressBar.

Change-Id: I75f25b0b7ee87d394422c58888ed3a1cca5d06a8
Fix error checking in MemoryFile.

mmap returns MAP_FAILED on failures, not 0 (NULL).
Also, convert some C style casts to C++ since they
make intent clearer.

Change-Id: I367993c73e9ee576f11ebe76e530d2c2f27c662d
MountService listeners can not be unregistered

When unregistering MountService listeners, their Binder proxy
objects were compared to registered listeners instead of their
backing objects.

Change-Id: Ie98a686b1d17544f1eda59fb3eb0dc02d836c1b2
Fix a variety of small publicly-reported bugs.

Possible NULL dereference in cmds/bootanimation/BootAnimation.cpp.
https://code.google.com/p/android/issues/detail?id=61556

Missing fclose in core/jni/android_os_Debug.cpp.
https://code.google.com/p/android/issues/detail?id=61546

Bad loop guards in core/jni/android_util_Process.cpp.
https://code.google.com/p/android/issues/detail?id=61557

Assignment to wrong variable in libs/androidfw/AssetManager.cpp.
https://code.google.com/p/android/issues/detail?id=61560

Missing delete[]s in libs/androidfw/ObbFile.cpp.
https://code.google.com/p/android/issues/detail?id=61549

Leaks on error in tools/aapt/Images.cpp.
https://code.google.com/p/android/issues/detail?id=61552

Two missing fclose calls in tools/aapt/Resource.cpp.
https://code.google.com/p/android/issues/detail?id=61553

Missing fclose in tools/aidl/aidl.cpp.
https://code.google.com/p/android/issues/detail?id=61554

Change-Id: I5820f3824e72d07a9acb776cf0af3e7443f5694a
Make SurfaceView layers captured by screenshotApplications()

Since SurfaceView layers are located below application layers,
SurfaceView is not captured by screenshotApplications()
when the application is running in fullscreen.

Moreover, ws.isFullscreen(dw, dh) returns mostly true
on the devices which do not use the navigation bar.

Change-Id: Ia1036c79054950384a97504714929fd85c8147de
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Re-initialize error after attach

If flag for error after attach is not reinitialized, it may cause
NullPointerException on subsequent onAttachedWindow if error text
was reset to null.

Change-Id: I8976c28a6ca71017e5c4b3f29d4eeeb2eda48c38
Cursor leakage due to cancellation signal

If a query call was cancelled, the cursor adaptor might leak. The
adaptor is now closed if any exception is thrown during query.

Change-Id: Ic4c2edeaf2fcef56b4ef59484a36d3233aa12dbc
Fix visibility of multiple non-fullscreen activities.

Issue detail:
Assume X, Y are non-fullscreen activities.
 a.Home starts an activity X in task A in application stack.
 b.X starts an activity Y in <task A> or <new task B>
 c.Activity X will be invisible.

How to fix:
Because the function "isActivityOverHome" means an activity is able to see home.
But there may have many non-fullscreen activities between the top non-fullscreen activity and home.
If flag "behindFullscreen" is set, those middle activities will be invisible.
So it should only take care from who is adjacent to home.
Then check two flags frontOfTask(task root) and mOnTopOfHome for constraining the condition.

Change-Id: I60bcea304976414e44835a0a38675aae365e9e19
wlan: Do not disable the network on Assoc Reject/Authentication Failure.

A failed network, if disabled, would result in no further connection
attempts for the same.Thus, do not disable the network rather enable
all the disabled networks, as supplicant shall disable the networks
temporarily on subsequent failures and would give fair chance to
select the prioritized networks.

Change-Id: I27bfdfed420e935c1bc21fb968d6a5ba75ca92aa
CRs-fixed: 582883
Merge pull request #1 from Mahdi-Rom/kk-4.4

Sync up with Madhi framework_base