Update Android.mk files after 4.91 merge.

Change-Id: Ibb59d5bc33e25a0d8de17e016794975ad1d1e1cc
(cherry picked from commit e5c2a82d1069e361e735cc2a166eaae23f5364f9)

Conflicts:

	audio/Android.mk
	btio/Android.mk
	compat/Android.mk
	input/Android.mk
	lib/Android.mk
	plugins/Android.mk
	src/Android.mk
	test/Android.mk
	tools/Android.mk
Disable interactive gatttool option in Android.

Change-Id: I7e1055b87e569a7b596a292ce6bb911938144252
(cherry picked from commit 2d8e49a5ebec900a86df00e0468d7a43f4c25935)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Some files were removed in the preceeding merge; do not build them anymore.

Change-Id: I57e4f4df0a851021b71b6d9baa419971fc25a383
(cherry picked from commit cae7123e505236a377ac8309c1427b4058b905e6)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Enable compilation of gatttool utility.

This is used for testing attribute functionality with Bluetooth LE
and BR/EDR.

Change-Id: I3b40f977efa3deff0700b3a20d118d41338bfafb
(cherry picked from commit a195eb94fae74fe530baeb59af74a8cefa689f0b)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Bluetooth: Fix BlueZ version number in Android.mk files

BlueZ was already merged up to 4.93, but the Android.mk files were not
updated.

Change-Id: I0f854e694647719c09f5d79a20291eff43474db4
(cherry picked from commit f106b06710c26ce7d3b35dd01a7f3b628f644890)

Conflicts:

	btio/Android.mk
	tools/Android.mk
Low Energy/GATT Additions, and switch to mgmtops

Change-Id: I27dd53fb61c4fd0ba97951585573566351da24ff
(cherry picked from commit 2ad32b655dff2a36994e8e7c51a51db4a30be266)

Conflicts:

	plugins/Android.mk
	plugins/builtin.h
	plugins/mgmtops.c
	src/adapter.c
	src/adapter.h
	src/device.c
	src/device.h
	src/event.c
	src/event.h
Bluetooth: Add support for listing connections

Change-Id: Ie36230cd0af50542fe90d17f54be66723801569b
CRs-Fixed:301373
(cherry picked from commit aaaac90ce91827485a3263decbbffe49f509a91a)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Disable server related code til stable implementation

Fix crash in GATT when disconnecting from remote device
Comment out GATT server related stuff til we get stable
GATT server implementation.

Change-Id: Ie9acbab7e834f5fb641ecf861ac628354214bd1a
(cherry picked from commit 004cd4933c68bdf12c8f98fcd1fba0f2b1965bf8)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Fix GATT response timeout logic

Cancel timeout in case when the received data is the response to
the issued command.

Change-Id: I526471eb35ae6ca82fe77c9ab99b64a8df542b76
(cherry picked from commit 52be7197f2441ec1f0859518b4f663cc1648b309)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Bluetooth: changes to set remote device's class of device

Change-Id: I931f89917afbf4a5de2e92827da60660132dae89
(cherry picked from commit e749bb826115f6ec97739b33e50a809840b7bb23)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Fix in GATT characteristic discovery.

DiscoverCharacteristic method call should return with
object paths for all discovered characteristics regardless
of whether characteristic read value operation succeeded or not.

Change-Id: I7800f17bdd71be15994c9760850b4de2098f9cfa
(cherry picked from commit c6d1a1482f0339254c2bcf5f8da40cfce575f869)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Clean up of remote device list in case of connection failure

If connection to remote device fails during outstanding "CreateDevice"
or "CreatePairedDevice", remove the device from a list of
created device in adapter.

Change-Id: Ieb0df7a37aef252bdff507f737a95cae1f192a83
(cherry picked from commit 14331f3d384d81f6b8d1c6a0815288525377c2c2)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Clean up GATT service attribute when remote device disconnects.

Add call to attrib_client_disconnect() when disconnect is completed.

Change-Id: Ie2f5bb0d2af586a35c0d0824b3a89224d972f082
(cherry picked from commit be74d10096fa2698f82321c58677c10645e352d1)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Fix problem pairing when already connected

1. Recognizing LE connections when externally intitiated
2. D-Bus crash when service discovery performed without D-Bus request

Change-Id: Ib2356a9f5de9b688b0bb2ef4ad62907fe31e93a5
(cherry picked from commit 0260556ec226873f7438d9e653046c0e0e256e58)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Fix association between Paired LE devices and Keys

LE Long Term Keys (LTK) were not closely coupled with internal
"Paired Device" bookkeeping, making it possible for LTKs to
exist and be used after the pairing had been deleted.
SM Issue #4

Change-Id: I6ae54c480bcf51a406cb93d2be99897082718b86
(cherry picked from commit 2e93ca584b2444a1233bb6d338aa733972c55e2a)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Add Dual Mode checks finding LE devices

Change-Id: Iddd718989b973278ff85de1b1e0952a85b43c095
(cherry picked from commit 058622fabed134f54c167a57262781edb81cbc31)

Conflicts:

	src/adapter.c
Clean up GATT characteristics discovery session.

When detecting disconnect either by request or timeout,
clean up pending characteristic discovery session and
return pending discovery D-Bus calls with error result.

Change-Id: I9754d16e19be17abe2035d3e49456e9810f79689
(cherry picked from commit 8e2b1c6ca87cb4166ef4b3daccb2252c921ec9e8)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
New D-Bus method "Disconnect" on Characteristics i-face

Add method to close/disconnect an individual GATT service.
Disconnectiong from the last GATT service on a given remote
device, ACL connection will be dropped as well.

Change-Id: I36084150cb0ad19796ed9c24be20c659832fd3fd
(cherry picked from commit 02b9f192268d4c28ccf887678d2b9ced94dbb869)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
Fix for unbalanced reference count for attrib user data

Removed an extra all to g_attrib_ref() when writing client config descriptor.

Change-Id: I804eca304847a190191cacec818e83dabfcb02c4
(cherry picked from commit 0ffba3fb3fc54d58e23a9652b3180b8e07cc09ad)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
build: Updating LOCAL_MODULE_TAGS with optional tag

Change-Id: I28c789d353bf4538c462f63822707added3ee18e
CRs-Fixed: 310616
(cherry picked from commit 7eda3d959e34ff518865b957cff7f4d0af92c82f)

Signed-off-by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>