Reduce observers in SystemUI: BatteryBarController

This is based on the work by Jens Doll for the StatusBarIconView

The ContentObserver class will be a singleton, so there is only
one observer for all instances.

On my Nexus 10 it reduced the observer count from 15 to 3

Change-Id: Ibdd6fca75e5f0245b2897c9d5aebb5a0961cc351
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Reduce observers in SystemUI: KeyButtonView

This is based on the work by Jens Doll for the StatusBarIconView

The ContentObserver class will be a singleton, so there is only
one observer for all buttons.

On my Nexus 10 it reduced the observer count from 48 to 4.

Change-Id: I3223a18fcb5d2c9c2e7de655c514ff751dcd345d
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Reduce observers in SystemUI: StatusBarIconView

Currently, for each status bar icon view there is a observer that
listens for changes of STATUS_BAR_NOTIF_COUNT. With one
notification usually having one or more status bar icons
you may end up easily with 10+ more observers for ~5 notifications.

With this commit the internal observer class becomes a singleton.
This means there is now only one observer for all status bar icons
and additional binder calls on new notification are avoided.

See "dumpsys content"

Change-Id: I7ca6481fe43e87c34b19d7b71e531cce93cf80ef
Fix build

Temporary fix for now.
Adapt torch intent for Glowpad

Change intent for this feature as we do not use AOKP'S torch.
LockScreen: Fix crash when unlocking twice

This will keep track if the BroadCastReceiver is registered and
will unregister it only if so.

Change-Id: I040d710cf0927394f36b2e3da251ac5a988ce1d6
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Lockscreen Longpress: Unlock Logic

In my opinion, we should unlock after
    user removes their finger.
This matches short-press unlock better
    and allows the user to change their mind
    on a target (I do that a lot).
Added a vibration action on longpress
    being true.

Change-Id: Ife590119dbdf10474b9c62f252e7f5d6dfc87387
Add BAMF theme engine

Thanks to travp624 @ TeamBaked for originally porting this

Change-Id: I9dd9347ac62e3b1fb49a4562d84eb7b295cdc2b2
Telephony: Add DCHSPAP to getTcpBufferSizesPropName

Change-Id: I868f0eae2db6032b43e9c1a1bd23860ab7bbebca
Add additional Method that check whether a table is empty or not

Application Devleopers are using queryNumEntries API
implemented by "COUNT(*)" to check whether a table is empty or not.
COUNT(*)  has to process the entire table to compute the result.
But, "EXISTS" can stop after a single matching row has been found.
So, Using "EXISTS" is more faster than "COUNT(*)"
I added new API using "EXISTS" to check whether a table is empty or not

Change-Id: Idcc2633d0a5349c59f41e125cf34c9dc6622cdbe
Properly rotate full [-pi, +pi] orientation range if available

The code currently in place assumes that orientation has a range
of [-pi/2, +pi/2] as may be found with a touch digitizer. However,
when used with a digitzer that can report the full [-pi, +pi] range
of orientations (e.g. a stylus) the calculations here are incorrect.

This patch checks if the post-rotation value is out of range for
the axis, and wraps it back around.

Change-Id: I03a22f7bf9526a5d995df1a18430d6dd24c6d6ee
Bug fix for building the hover target list

lastHoverTarget should be updated even though lastHoverTarget is not null.
If not, the hover target list cannot have more than one hover target.

Change-Id: I21b49e8cbf3657321b2f1f2c20a3bdeb7f07bd48
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Add missing ACTION_MEDIA_UNMOUNTED intent

When an SD card is removed without the user unmounting, the intent
ACTION_MEDIA_BAD_REMOVAL is fired but is missing the preceeding
ACTION_MEDIA_UNMOUNTED which is needed to keep UI consistency.

Now when bad media removal is detected an ACTION_MEDIA_UNMOUNTED
intent is sent before the ACTION_MEDIA_BAD_REMOVAL.

Change-Id: I133300f42bafab141351e796d7cfc13c15d133e0
framework:base: iterator error in singletone provider

In case of singletone provider, we don't count it in the guset user.
After we remove it from the array, and resize the array, need to move
iterator back.

Change-Id: I99920a6beccc9de0e67ffeb632b1940efaee10b9
Fix AMotionEvent_getHistorical* to take const AInputEvent* motion_event

See b.android.com/55873

Change-Id: Idff7b71480991e16f57e55748fafa57d5827b10b
GlowPad Torch: No Screen Timeout

Should disable screen timeout if
    glowpad torch is on.

Change-Id: I32a0f7880b738ad9185e795d6cd828a0238d5f24
Check themes of current user, not user 0.

Change-Id: I1688dbd1b89a9da50b6372eb2faac56e61679c50
Profiles : Allow nfc override (1/2)

Part 2 : http://review.cyanogenmod.org/#/c/37013/

Allow user to override nfc state via profiles
Request jira : https://jira.cyanogenmod.org/browse/CYAN-989

Change-Id: Ief7fa4ab83527f488fbd8c0bc96448a2a2cde6fb
FW: Ability to hide Profiles toggle in Power Menu (1/2)

Some users would prefer hiding the profiles toggle in the power menu even if the feature is enabled.
Merge branch 'jb-mr1' of git://github.com/Root-Box/frameworks_base into RootBox