Bluetooth: HID: Add support for HID Device Role

This patch adds the HID Device Role support in Bluetooth framework.
Also AIDL and callback related files for HID Device role are added
to provide interface for third party applications to communicate with
HID device Service.

CRs-Fixed: 573086

Change-Id: Id03a362b7bcfa2e76056fa0197eaac12ce49b5a2
Bluetooth: Changes for LPP and extended LE scan

This patch includes implementation of a new Bluetooth
Adapter named QBluetoothAdapter for implementing LE
specific tasks that the default adapter doesnt perform.
This patch also implements Low power proximity and extended
LE scan functionality based on service UUIDs.

CRs-Fixed: 581289
Change-Id: I63e0593f79c8929d4e18cee0472fcb401c8892e7
OBEX: Reduce Obex MTU size for A2DP or SCO concurrency

Reduce Obex MTU to 8k from 64k when OPP send is tried with
SCO / A2DP streaming in progress, so that the continue
response for first complete Obex PUT packet is received
from SOC within 50 seconds time frame.

CRs-Fixed: 571865
Change-Id: I1eae114f57f2a92ee4b26c82d8f55fafe02775b8
Bluetooth: Cleaning up sap service object to avoid serviceRecord leaks

A case where script is running to do BT ON/OFF 2000 times. Sap service
class object is leaked while turning OFF BT, when it is referenced
(Directly OR Indirectly due to its member variables). So Garbage
Collector doesn't collect class object which is referenced. Setting
NULL for service class object & service connection, while cleaning up
those variable to mark as weak reference. Any objects memory is
immediately claimed by GC, which are marked as weak reference.

CRs-Fixed: 591180

Change-Id: I905d1e542c159c8f9addcb8491aee900697c9006
Bluetooth: Fix to avoid framework reboot during monkey.

A case where monkey is running & sometimes framework is
disconnected due to unhandled java Exception during the
binding of DUN, SAP, HID device & PAN service on unsuccessful
binding. So it never handled. Handing java exception while binding
DUN, SAP, HID device & PAN  services to solve this issue.

CRs-Fixed: 564709

Change-Id: Idea710593a3f9496305f636042605303e73e7749
Bluetooth: HID-C: Add support for error parameter for reportError

This patch adds support for error parameter in reportError providing
better flexibiltiy to application to respond to errors for Set Report
received from HID Host.

CRs-Fixed: 595139

Change-Id: Ieada7be8a6a91d310f20849af9e5a9b04766f4a5
Increases Gatt connection timeout value to be 30 secs

Some LE devices take more time to establish
LE connection. This change increases the
connection timeout value to take care of
this scenario.

Change-Id: Ie4cc79b53301f230553df02afd5d64dec637fe5d
CRs-fixed: 582556
Bluetooth: Validate input parameters of gatt characteristics

If the input parameters of gatt characteristics are not valid
return false

Change-Id: Icf44439992cb068339f7a4c4e50a3f28c25db6ce
CRs-Fixed: 534763
Bluetooth: Fix PXP LPP app link loss reconnection

When BLE link loss reconnection happens,the host is
not able to send Vendor specific commands
to the controller to start monitoring the RSSI
values.

CRs-fixed: 597822

Change-Id: I436889fae7f7d42c4f532690b726271ffc136e94
Bluetooth: Fix to avoid framework reboot during monkey.

A case where monkey is running & sometimes framework is
disconnected due to unhandled java Exception during the
unbinding of HID device service on unsuccessful unbinding.
Handling java Illegal Argument exception while unbinding
HID device service solves this issue.

Change-Id: I61a5620e756119d25f2a235e67d6404b216f4cbf
CRs-Fixed: 601533
[1/2] FW: LockScreen Notifications by AOSPAL

THANKS AOSPAL -> David L.-W <david.leppla.weber@gmail.com>

Port from: http://review.carbon-rom.com/#/c/1399/

My try on making notifications easily accessable from lockscreen.
Credits to ChameleonOS, I got the notification listener permission and some small other stuff from their ActiveDisplay implementation.

Lockscreen Notifications allow you to manage all your notifications directly on the lockscreen.

Features:
- Pocket mode turn screen on when phone is pulled out of pocket and turn it off when phone gets back in pocket
- Hide low priority notifications
- Hide non-clearable notifications
- Allow dismissing even non-clearable notifications from lockscreen
- Just turn screen on when there's currently a notification pending
- Toggle between expanded and normal notification view by longpressing

This should still be considered as beta, even if it seems to work very well for me.

Lockscreen Notifications: Make "wake on notifications" user configurable

and some other small changes that hopefully will improve battery live

Lockscreen notifications: make height user configurable [1/2]

Lockscreen Notifications: fix possible NPE

Lockscreen Notifications: try on fixing notifications sometimes not responding

Lockscreen Notifications: always scroll to bottom so one sees the newest notification first

Lockscreen Notificaitons: Fix NPE while on setup wizard on clean flash

Lockscreen Notifications: several fixes

- fix notification not responding when removed and added in a short period of time (e.g. gravity screen start/stop)
- just unlock screen on notification click when there's an activity to start
- fix notification hide animation
- just wake screen on reposted notifications when it's not ongoing (wake on notification before made the device stay awake for ever when a download/countdown or something similiar was running)

PS3: Fixes & New Options (privacy, position)

Lockscreen Notifications: just scroll down in "showAllNotifications"

Lockscreen Notifications: Copyright

Lockscreen Notifications: make offset top user configurable & add privacy mode [1/2]

Lockscreen Notifications: Fix possible NPE

Lockscreen Notifications: make width dynamic (WRAP_CONTENT)

PS4: clean whitespace
PS5: hope this fix the bug
PS6: Off by default
PS7: Fix logic
     Fix IllegalArgumentException

Conflicts:
	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Change-Id: Ibd73d05b5440c7376b87018ae7c702e3b85875b6
[1/2] Lockscreen Notifications fixes

- Lockscreen Notifications: make animations a bit faster
from: https://github.com/AOSPAL/android_frameworks_base/commit/5b6e143c4edeb9454650dbc05e597fbbae6b5c26

- Fix ongoing notifications reappearing when hidden & some small animation tweaks again.
from: https://github.com/AOSPAL/android_frameworks_base/commit/ac9bf6a36a7275d1e98e2ae6750723b1e006dd4d

-  Lockscreen Notifications: fix notifications disappearing on orientation change
from: https://github.com/AOSPAL/android_frameworks_base/commit/e9dcb99f0bd3e74a45ee7d15ebc19a99db7a09a2

Change-Id: Id72ec7c6c9e61fc7502299e434e0ba0d12957ec7
[1/2] LS Notification dinamic width & blacklist options

- Lockscreen Notifications: disable dynamic width for devices <= xhdpi

- [1/2] Base: Lockscreen notifications: Option to disable dynamic width
from: https://github.com/OmniKang/android_frameworks_base/commit/87d6598b63a1b83e93631b0fcb0822365cf7563b

-  [1/2] Base: Lockscreen notifications: Allow apps to be excluded from being displayed
from: https://github.com/OmniKang/android_frameworks_base/commit/8631349b965f507eeff4b5616c1f581bc4e6e615

 Credits to 0xD34D / ChameleonOS for the original implementation for Active Display

PS3/4: fixes

Change-Id: I796b08cb94185ea17139bd74f1b41d287ba65155

Conflicts:
	core/java/android/provider/Settings.java

Change-Id: I796b08cb94185ea17139bd74f1b41d287ba65155
Lockscreen Notification: fix default settings derp

Change-Id: Ief7344359059d72b6498d9d9ce61dfd11b43f404
Lockscreen Notifications: fix phone turning on in pocket

Change-Id: Ia0385280510f1d684c5dcf537dd2049c6916ddec
[1/3] base: allow disabling non intrusive incall ui

Change-Id: Ibe9c65f1fe024a859d98d96fd86199607a1060de
Frameworks: port Active Display from ChameleonOS (1/2)

Change-Id: I65b42c2346f88844f831fcdcaa85d318e72b0678
Merge "[1/3] base: allow disabling non intrusive incall ui" into kk4.4
Merge branch 'kk4.4' of https://github.com/TEAM-Gummy/android_frameworks_base into kk4.4