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.
Fix BatteryBar showing on all 3 locations

Change-Id: Idbdd16ea5442b032119ce48d586b2207e8cf0281
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
HALO (1/2)

HALO is Androids one and only multitasking solution.

We explicitly do not go the Samsung/Cornerstone route. This solution is basically an extension of
the regular notificationshade, which is an aggregator for notifications that can be checked out when
time permits. HALO completes it by allowing you to respond to tasks on the spot, trying to be as
unintrusive as possible and flexible in regards to policies (white/black lists).

Features:

- Apps open up in floating state, apps underneath do not pause
- complete SystemUI & Core integration, making HALO feel like a native feature, source/SDK and UI/UX
- HALO has white and blacklists, which for now allow fine control for apps pinging through HALO
- multiple gestures to navigate HALO:
  - double-tap-move: move
  - tap-drag-left/right: task through notifications, finger up launches
  - tap-drag-up: dismiss notification
  - tap-drag-down: put HALO into semi-hidden state
  - swipe while HALO is hidden wakes it up
  - drag-to-X to remove HALO altogether
- comes with as few settings as possible, everything should be self explanatory and intutive,
  users must be informed about the double-tap gestures which is the only catch.

Known issues:

- Integration has been finished for PhoneUI. TabletUI and PIE must be integrated still.
- Packageinstaller must allow HALO through its overlay check or it will disable the install-app button.
- The low level has a few remaining issues:
  - Some apps still go up fullscale (they trick us with services, circumventing the intent flagging)
  - Some 3D games still pause
  - There is one known app that refuses to end on back or touch-outside, that is WeChat
  - The activitystack pause implementation works but is makeshift

To-Do:

- On-screen tutorial at first start up to teach users the gestures
- Fixing all known issues, full integration in the remaining UI's
- Perhaps hybrid engine integration for running floating apps in a decreased size

Merge branch 'multiwindow' into jellybean

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/AndroidManifest.xml
	packages/SystemUI/res/values-land/dimens.xml
	packages/SystemUI/res/values/dimens.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	services/java/com/android/server/NotificationManagerService.java
Fix HALO crashes

Bugfix for Layout < 0 crash which would kill a couple of apps whose
  content was compromised by smaller displays/dpi's.
change "next" to "done" in minute IME option under 24-hour format

We don't need "next" button under 24-hour format any more.
So, we changed from "next" button to "done" in IME option
when setting minute under 24-hour format

AOSP commit: https://android-review.googlesource.com/#/c/54121/3

Change-Id: Ic9b1673248183060ba7279b63648a85dc39ca3b9
Fix incorrect fragment animation used for hiding fragments

Mirror of support lib patch
https://android-review.googlesource.com/#/c/60032/ into
frameworks/base.

AOSP Commit: https://android-review.googlesource.com/#/c/60167/

Change-Id: I8d1cb2e217721336674b8e3e2ef8722a8d9baefd
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