History log of /system/bt/bta/gatt/bta_gattc_int.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6918d40fd9ca8c58c115cf694f165413165e5758 05-Dec-2017 Jakub Pawlowski <jpawlowski@google.com> GATT cache memory corruption fix

When doing GATT discovery, we interleave adding elements to vector,
and storing pointers to them. This can cause memory corruption, because
vector can reallocate the memory when adding element, leaving the pointers
invalid. To fix that, never store pointers to mutable vector elements.

Bug: 70041392
Test: manual, connected to HID device
Change-Id: I6bb3fec61afa742f446b66e3291c5f326738ee17
/system/bt/bta/gatt/bta_gattc_int.h
5b790feeeb211c42bf78ca3ae9c26aa30e516765 18-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Make copyright headers consistent with Google template; remove "(C)"

Test: Comment changes only; still compiles...
Change-Id: Id699a8170112f06e4a2c9f2e0f0834d1817ace4e
/system/bt/bta/gatt/bta_gattc_int.h
8a0f7ad094c5b1493e3791ba1db718c1791a5b94 10-Oct-2017 Jakub Pawlowski <jpawlowski@google.com> GATT discovery refactor

Currently, when doing service discovery, we store pending discovery
content into tBTA_GATTC_ATTR_REC structure, and rewrite it into cache,
service after service during discovery.
From now on, we save discovery result directly into pending_discovery,
and at end of discovery we swap it with cache. This remove unncecessary
intermidiate step, and simplify the discovery.

Bug: 67057055
Test: GattReadTest
Change-Id: Id09026b6fb6df04eaf0a0ebefeb6e35b3d175f62
/system/bt/bta/gatt/bta_gattc_int.h
fa9074885bea48e7844e2fd14df799df6da4782f 23-Oct-2017 Jakub Pawlowski <jpawlowski@google.com> Use vector instead of list for keeping GATT database content

We don't use any list features, but have to pay extra for it's features.
Replace with vector.

Bug: 67057055
Test: compilation
Change-Id: I4209c24b4f87780ea29e4e0707ce0a2a0d440d6b
/system/bt/bta/gatt/bta_gattc_int.h
2647452211f7beaee19610fe79442828ab2b0ee6 04-Oct-2017 Jakub Pawlowski <jpawlowski@google.com> Use LOG() macros in BTA GATT logging

Test: compilation test
Change-Id: If7676af5bf915df57ab6e876d2f27500ebf5c07d
/system/bt/bta/gatt/bta_gattc_int.h
d9ca4100b8a22950a3e560985ca09d885eb22f32 09-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Use std::list in GATT related code

Bug: 67057055
Test: sl4a Gatt* tests
Change-Id: I8201ebdad5ba4c3d5d0a2fd3d0fe9dc900b51d60
/system/bt/bta/gatt/bta_gattc_int.h
ee9a11f903af6ee6b3ca1bd59fc9f89fd029ceba 26-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Remove unnecesary BTA redefinitions for GATT part 3

Test: compilation test
Change-Id: I8d4b8cfd35fcb5ccd7067f1e02dedd1a58efa3ad
/system/bt/bta/gatt/bta_gattc_int.h
e9ef00c3fb2de5077a8ffdb728f1996cc1e9a155 26-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Remove unnecesary BTA redefinitions for GATT part 2

Test: compilation test
Change-Id: Iaf81188596c33b92f79f163dc95187ed5c6f52a4
/system/bt/bta/gatt/bta_gattc_int.h
ab7a368f3f602b3cd32533c2de4d0adb2031fb37 26-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Remove unnecesary BTA redefinitions for GATT part 1

Test: compilation test
Change-Id: I98ab63a187684ae4ffbb0cb23e5c9e67994be468
/system/bt/bta/gatt/bta_gattc_int.h
819e2ecb84a22d6e03ec9ed67b3260c0dd7e8aba 10-Jul-2017 Jakub Pawlowski <jpawlowski@google.com> Use one type for UUID (1/5)

Currently, we have few different representations for UUID in stack:
tBT_UUID, tSDP_UUID, bt_uuid_t, bluetooth:UUID, or uint8_t*.

Additionally, tBT_UUID and bt_uuid_t are used to hold UUID as 128bit
as Little Endian or Big Endian, depending on which part of stack (GATT
or SDP) is using it.

This patch is creating one type, bluetooth::Uuid, that will replace all
other types.

Bug: 66912853
Test: all sl4a tests for GATT and RFCOMM
Merged-In: Ia42d3233146db0488728ed6f878f99b368fe8838
Change-Id: Ia42d3233146db0488728ed6f878f99b368fe8838
/system/bt/bta/gatt/bta_gattc_int.h
a484a888196ddf8bcbf1ad3226d6451bc735a94b 25-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Rename bt_bdaddr_t into RawAddress (3/3)

Test: compilation test
Change-Id: I4571721a0c6165a66450ee157a53d8d15bfc45d0
/system/bt/bta/gatt/bta_gattc_int.h
c2276b06572ab6fc1f900fbb1f41087e77d47e2a 10-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Use bt_bdaddr_t instead of BD_ADDR

Test: compilation test, sl4a GattReadTest
Change-Id: I8d1bd6914aec55bb53495b1d0d5e3d37b86865e6
/system/bt/bta/gatt/bta_gattc_int.h
d7ee6f2e85a1a8837b0b1e2e8ba1c72b53650cd8 05-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Get rid of BTA_GATTC_API_REFRESH_EVT

Test: compilation test
Change-Id: I631962183ac63d2b168005060bb1f0d4964b0884
/system/bt/bta/gatt/bta_gattc_int.h
31a6bf4f11b7f5483af93d9ded49f979167a0ccb 05-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Get rid of trivial BTA_GATTC_ events

Test: compilation test
Change-Id: I8c705d1bb0532cbe0dd69b1f3b0b5d1a63534a23
/system/bt/bta/gatt/bta_gattc_int.h
16bb48b320cde54a1a06a525f4d9be1421689649 25-May-2017 Jakub Pawlowski <jpawlowski@google.com> Fix GATT Server disconnecting for no reason

Connections created by GAP profile should be ephemeral, and not
interfere with the connection timeout.

When a device is bonded, listing services through DM would cause a
DM APP to create a connection, and later to disconnect. This causes
connection to timeout. In case a device was already connected, this
should not happen.

Bug: 34951749
Test: manual
Change-Id: Iad04fd9eed4c664f35131442e3f83a704497a067
/system/bt/bta/gatt/bta_gattc_int.h
7dd34f52bc950bae2fb1b30b17da0ff34ee016aa 14-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Read by UUID for PTS tests (4/5)

Add a hidden api for reading characteristic by UUID for PTS.

Bug: 35150313
Test: sl4a GattReadTest.byUuid
Change-Id: I072473c5f7b761707774efd89f8a22bfdf012135
/system/bt/bta/gatt/bta_gattc_int.h
96fb273d92a31204edcf43ab2594a19876d14056 25-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Add option to specify initial LE connection PHY (1/3)

For whitelist connections we always use all possible PHYs, for direct
connection use PHY specified by client.

Test: manual
Bug: 30622771
Change-Id: I720f134e2800dc3d282135bb7ffbe3882117c680
/system/bt/bta/gatt/bta_gattc_int.h
221e9bf6c9e9f974efd92ea4f054dbdba248d2db 15-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> BTA Application registration refactor

This patch replace BTA state machine state associated with registration
of new application, together with BTA_GATTC_API_REG_EVT, and
tBTA_GATTC_API_REG. Instead, it uses closure to post registration task,
and callback for registration event.

Bug: 30622771
Test: sl4a ConcurrentBleAdvertiserTest GattConnectTest
Change-Id: I62d68485170ef5472237d62b285353f2c9bc8250
/system/bt/bta/gatt/bta_gattc_int.h
84baa7f16e830394408278dbb8c508dd9fa02887 14-Nov-2016 Myles Watson <mylesgw@google.com> Remove BLE_INCLUDED define

Test: Connect to a BLE Keyboard
Change-Id: I5f8f4017c90c3c404004632fd10e6c2b93bd7783
/system/bt/bta/gatt/bta_gattc_int.h
cd1fd07f1306e08fe048682dd5918987e579f937 09-Nov-2016 Myles Watson <mylesgw@google.com> bta: Apply clang-format

clang-format -i --style=file bta/*/*

(twice)

Test: mma -j32
Change-Id: Ib118b1dfb6a34f9a5bfe153d65841e9041165264
/system/bt/bta/gatt/bta_gattc_int.h
8af480e24549ba51a3f6858d9d9af504715e0bea 09-Nov-2016 Myles Watson <mylesgw@google.com> bta: Remove double asterisks in comments

Double asterisks at the beginning of the line
sed -i s,"^[*][*]"," *", bta/*/*

Double asterisks after a space
sed -i s,"^ [*][*]\([^*]\)"," *\1", bta/*/*
sed -i s,"^ [*][*]$"," *", bta/*/*

Test: mma -j32
Change-Id: Ib83b802c7000176683b4e7f24d1255b3c2c6c01c
/system/bt/bta/gatt/bta_gattc_int.h
4918648dd55ded3135aad68c866520cf2b5e1c3e 31-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Simplify BTA_GATTC_Listen

It is necessary to make BTA_GATTC_Listen not dependent on client_if
before it is moved to advertising interface, where it belongs.

Bug: 30622771
Bug: 24099160
Test: no tests necessary
Change-Id: I75dc7e0fcd64fd3437474933069941b52740f0b5
/system/bt/bta/gatt/bta_gattc_int.h
e68dc31025067bcd288128ac1e37b8bf18de756e 29-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Make bta_gattc_listen only start listening

The bta_gattc_listen method is used only to start advertising on devices
not using Vendor-Specific Callbacks. It should not notify the client
calling it of all connected devices.

It is also unnecessary to add the gatt client as listening for background
connections. No such thing is done for multi advertising.

Bug: 30622771
Bug: 24099160
Test: code is still compiling
Change-Id: Ia11a247b8416f77543087cd3f18331fcfe7bd207
/system/bt/bta/gatt/bta_gattc_int.h
2e8c421ddce1dae511a39b8e89415e8eb1944bfd 29-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Remove advertise whitelist functionality

Advertise filtering is never used. It is not finished - adding device to
whitelist can never succed. It is also making advertising API unification
hard.

Bug: 30622771
Test: no tests necessary
Change-Id: I9df9ea18b265a580c2fcdb28a6d6ce4be43f0a24
/system/bt/bta/gatt/bta_gattc_int.h
24ea892320ca85c7f6cdd77343da50818fe29002 14-May-2016 Jakub Pawlowski <jpawlowski@google.com> Add callbacks to GATT read/write operation

There is no need for read/write callback to be a global event. It should
execute local callback instead.

Change-Id: Id7e915af9d30092d2f754eddc7c3aed4970eeb2f
/system/bt/bta/gatt/bta_gattc_int.h
25984b0d221cf48cd4dd606b881674ce7b29bf44 24-Jun-2016 Jakub Pawlowski <jpawlowski@google.com> Get rid of unused BTA_DYNAMIC_MEMORY

Change-Id: Idc7fcddfecac9ab7d9800b496e2380ae277f357f
/system/bt/bta/gatt/bta_gattc_int.h
a05734c69c611567374c7d9a7c9184f60afaed06 24-Jun-2016 Jakub Pawlowski <jpawlowski@google.com> Use bta_gattc_cb directly, not through aliases

Right now, bta_gattc_cb is not used directly, instead it's passed as
argument to methods that can use it directly.

Change-Id: I54fef4b8b1e11b3289e7961f70bea187173e9804
/system/bt/bta/gatt/bta_gattc_int.h
e9e58ced195ec2c983c7723c9cbdabd45eb0f2fd 17-Jun-2016 Marie Janssen <jamuraa@google.com> bta: use standard types

Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Change-Id: Ib86de4de9f14529ecaa4f71597260e3b5785360b
/system/bt/bta/gatt/bta_gattc_int.h
6c81482c2ddf10ac3c2d948ed3b4f0a58faea55c 14-Jun-2016 Jakub Pawlowski <jpawlowski@google.com> Fix missing GATT Characteristic from last service

GATT Service is contained between start and end handle. If
characteristic definition is at end handle, and it's value definition is
after end handle, it will not be properly discovered. That's because we
use value_handle instead of attribute_handle to identify
characteristics.

As a workaround, increase service boundary if value is defined after
it's definition.

Bug: 29253825
Change-Id: Ib145aea4f5cf38a1fbb977c301136e16f8f900f7
(chery picked from commit 552e630435a68d8f51d458dccf8697c625cf1510)
/system/bt/bta/gatt/bta_gattc_int.h
19117701657073f3b8ba03620c081a8976b318a6 26-May-2016 Jakub Pawlowski <jpawlowski@google.com> Convert GATT related BTA code to C++

Change-Id: I9c36d0ebeb1143395b3b38b3d179d12a9503d28a
/system/bt/bta/gatt/bta_gattc_int.h
9dc998503590163068845827d951fc2f05a17bda 17-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Use handles to identify GATT attributes (1/4)

Bug: 27778668
Change-Id: Id7454450c1ce2164001a1f9ca0b91f18d84e3fd6
/system/bt/bta/gatt/bta_gattc_int.h
5204fd71b3ca799942c45a36548faeba4d89477d 15-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Restructure GATTC

This patch changes how GATTC is structured. Up till now, it
contained tBTA_GATTC_CACHE and tBTA_GATTC_CACHE_ATTR. Those
structures were so ugly, someone hide them inside internal
header, to make sure noone would ever access them from outside
GATTC. They are now replaced with:
tBTA_GATTC_SERVICE,
tBTA_GATTC_CHARACTERISTIC,
tBTA_GATTC_DESCRIPTOR and
tBTA_GATTC_INCLUDED_SVC.

Those looks much better, and were made globally avaliable.
Thanks to way they're build, we no longer need set of access
methods, which were also very ugly:
BTA_GATTC_GetFirstChar
BTA_GATTC_GetNextChar
BTA_GATTC_GetFirstIncludedService
etc.

This patch breaks HID, DO NOT SUBMIT without HID refactor.

Bug: 27455533
Change-Id: Ic42cfff175e0cc1a0d8e1a1216e2b4b756cbf77d
/system/bt/bta/gatt/bta_gattc_int.h
14a73093ba78d237959f625fd27bd4edd9f0ff48 04-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Remove bta_gattc_id2handle

Now that the instance id is equal to handle, we no longer need this
mapping function.

Bug: 27455533
Change-Id: I6760f8fc81460df8520d4ebf1899ed256ce5ad1e
/system/bt/bta/gatt/bta_gattc_int.h
bc5d65496d7dc9d87d4fe3e3c92dadb043559786 02-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Use attribute handle instead of id in GATT cache

Currently we generate an id for each GATT attribute. Those ids
are used to differentiate between attributes that have the same
UUID. We need to get rid of those ids because it won't work with
partial GATT database updates due to "service change"
notifications. Instead, attribute handles, which are unique
across the whole GATT database will be used.

This is first patch in series to achieve that. It gets rid
of id generation, and just assigns handle in place of ids inside
of gatt cache. Upcoming patches will change the GATT cache API
and eventually get rid of "id" completly.

Bug: 27455533
Change-Id: I74c10872ecc223329b8ac7fef4085963bf272624
/system/bt/bta/gatt/bta_gattc_int.h
c10b209f62a52d2a782d4d8c97734b6c142f2567 06-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> GATT cache storage refactoring

Currently when storing GATT cache into file, we save it piece
after piece, max 10 elements at once. This is not necessary,
we have enough space to just save all at once.
Also the logic doesn't need to be so complicated - no need
to state machine for such simple task.

Bug: 27455533
Change-Id: I82923dbedfb317835e45e13e0ea28151eb524d37
/system/bt/bta/gatt/bta_gattc_int.h
1be7ae1a0890380b8a3daebcade0c1f55b04b167 04-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Remove btla-specific comments

Change-Id: I91a19b2cfbc96d7567e0e0914058619ea364c1d4
/system/bt/bta/gatt/bta_gattc_int.h
be18a6078194547400fa9594a62d9d1bea5d7bea 03-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Simplify UUID handling in GATT cache

Bug: 27455533
Change-Id: I653b563d3b3c233ffe31b0a35d396a66db363459
/system/bt/bta/gatt/bta_gattc_int.h
136db0d32d38958577a3f125c6799ac2a059955f 03-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Revert "Remove unused field p_cur_char"

This reverts commit 25e17fb1c7a894dec49fc8eddb2bbfb20a9eeb21.

Change-Id: I21936ae37c1e052ab53233b3465e336369a423df
/system/bt/bta/gatt/bta_gattc_int.h
25e17fb1c7a894dec49fc8eddb2bbfb20a9eeb21 03-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Remove unused field p_cur_char

Change-Id: I956f966ddbb44506a5da8e1ab4ccb028bafa92de
/system/bt/bta/gatt/bta_gattc_int.h
9fd552b1f51c1313e801592f271376c7af62b2f4 11-Feb-2016 Jakub Pawlowski <jpawlowski@google.com> Add handle range to BTA_GATTC_GetGattDb

Change-Id: Iaf0280853278a4f28dde5b952b646096cfb12d97
/system/bt/bta/gatt/bta_gattc_int.h
63e500e7cb8a45d771d73cd43721405851089c06 05-Feb-2016 Jakub Pawlowski <jpawlowski@google.com> Use dynamic memory for keeping GATT cache

Change-Id: I60674c47246d8fe2094fe78ce31b752fa2acb89e
/system/bt/bta/gatt/bta_gattc_int.h
5919554fe8e03b87a7c7724238481b85e9cf6630 04-Feb-2016 Jakub Pawlowski <jpawlowski@google.com> Don't unregister notifications for unmodified services

Change-Id: Ie02dd72a2d4a423ab532ec84a4d588ab83f3e22b
/system/bt/bta/gatt/bta_gattc_int.h
533fdbf46fb623aefbe4d0107b5cccd41aec097a 22-Jan-2016 Jakub Pawlowski <jpawlowski@google.com> Add new HAL method get_gatt_db

Currently getting GATT database from HAL requires multiple calls
and iterating over each element. This is long, unnecessary
complicated process, error prone process. This patch adds new
method, get_gatt_db that can be used to grab whole GATT database
for remote device just in one call.

Change-Id: Ib5d88fbc28d09d5c191e7c0152ca61d6a34f7a81
/system/bt/bta/gatt/bta_gattc_int.h
1b3ac367492750439ebecd393af1799242767ef3 02-Dec-2015 Jakub Pawlowski <jpawlowski@google.com> Fix race condition during simultaneous SDP

Right now sdp_conn_id and p_sdp_db are stored in static global
bta_gattc_cb between call to bta_gattc_sdp_service_disc and
bta_gattc_sdp_callback. If multiple instances of SDP discovery
are running simultaneously, they override this field, and free
same memory multiple times. This patch fixes that by making sure
sdp_conn_id and p_sdp_db are unique for each SDP discovery.

Bug: 25801255
Change-Id: I8ec52229e906e6b8748db7504f77e1f4d7006fbe
/system/bt/bta/gatt/bta_gattc_int.h
258c2538e3b62a8cdb403f2730c45d721e5292b4 28-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - moved GKI buffer allocation wrappers to OSI

* Moved the following GKI buffer allocation functions to OSI:
- GKI_getbuf() -> osi_getbuf()
- GKI_freebuf() -> osi_freebuf()
- GKI_get_buf_size() -> osi_get_buf_size()

For now we need the osi_getbuf() / osi_freebuf() allocation wrapper,
because we need to be able to call osi_get_buf_size() on the allocated
buffer.
In the future those should be replaced with osi_malloc() / osi_free().
Currently, the osi_malloc() buffer size internal allocation tracker
does not always track the size, hence we need the osi_getbuf() wrapper.

* Replaced GKI_MAX_BUF_SIZE with BT_DEFAULT_BUFFER_SIZE

* Added new file include/bt_common.h that can be usee to include
few files that should be included alost everywhere (e.g. bt_target.h"
NOTE: This file might be removed in the future and we should include
everywhere the right set of header files.

* Removed some of the GKI-related references

* Removed file include/gki_target.h

Change-Id: Ie87830e73143de200746d54235aa99f228a95024
/system/bt/bta/gatt/bta_gattc_int.h
1a3844f933bd63c8a381371dabfb35c6a0249e3e 25-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - Replaced usage of GKI queue with OSI fixed_queue

* Added new functions to OSI:
- fixed_queue_init()
- fixed_queue_length()
- fixed_queue_try_remove_from_queue()
- fixed_queue_try_peek_last()

* Renamed fixed_queue_try_peek() to fixed_queue_try_peek_first()

* Replaced usage of GKI queue functions with OSI fixed_queue functions:
- GKI_init_q() -> fixed_queue_new(SIZE_MAX)
NOTE: unlike GKI_init_q(), fixed_queue_new() allocates memory /
state that needs to be released by calling fixed_queue_free()
- GKI_enqueue() -> fixed_queue_enqueue()
- GKI_dequeue() -> fixed_queue_try_dequeue()
NOTE: fixed_queue_try_dequeue() is non-blocking
- GKI_queue_length() -> fixed_queue_length()
- GKI_queue_is_empty() -> fixed_queue_is_empty()
- GKI_getfirst() -> fixed_queue_try_peek_first()
- GKI_getlast() -> fixed_queue_try_peek_last()
- GKI_remove_from_queue() -> fixed_queue_try_remove_from_queue()
- Queue elements iteration.
In the fixed_queue implementation we have to use the underlying
list_t mechanism to iterate over the elements.
OLD:
p = GKI_getfirst(queue);
...
while ((p = GKI_getnext(p) != NULL) {
...
}
NEW:
list_t *list = fixed_queue_get_list(queue);
for (const list_node_t *node = list_begin(list);
node != list_end(list); node = list_next(node)) {
p = list_node(node);
}

* Remove initialization of the GKI module, because it is not needed
anymore

* Removed unused files in GKI:
gki/common/gki_common.h
gki/ulinux/gki_int.h
gki/ulinux/gki_ulinux.c

Change-Id: I3ff9464db75252d6faf7476a9ca67c88e535c51c
/system/bt/bta/gatt/bta_gattc_int.h
d2246b6ebdc1db60c2db8dd0e34a3121a71117e9 29-Aug-2014 Priti Aghera <paghera@broadcom.com> LE: Remove stored link key if encryption fails due to missing key (remote)

Remove the link key if encryption fails due to missing key or
authentication error. When a remote device loses the bond, all
HOGP services cached should be discarded and all client configuration
descriptors needs to be re-enabled. This will ensure successful
re-connection.

Bug: 15022622
Change-Id: Ie1730830c0cbbc294e2cd579d7dca69d16cf8218
/system/bt/bta/gatt/bta_gattc_int.h
3b4d3fb7f1b0fa51400cc6531e1e693471949486 11-Jul-2014 Nitin Arora <niarora@codeaurora.org> am 02d9b7b4: Bluetooth: Increase number of allowed notifications

* commit '02d9b7b41f1fcf21e798a4c0aabde89f00729d08':
Bluetooth: Increase number of allowed notifications
02d9b7b41f1fcf21e798a4c0aabde89f00729d08 09-Jan-2014 Nitin Arora <niarora@codeaurora.org> Bluetooth: Increase number of allowed notifications

This change increase the maximum number of notifications
that can be registered for LE remote devices.
This count is increase from 7 to 15.

Change-Id: I422704e9bae69c48b731757526ed9ee4055aa643
/system/bt/bta/gatt/bta_gattc_int.h
90715aad34cdead03fc22bc18891c04838e90e87 01-Jul-2014 Mike J. Chen <mjchen@google.com> Fix GKI buffer leak in GATT event handling

The GATT event handler was telling the BTA dispatcher that
it would always free the GKI msg buffers itself, but in fact
this wasn't true. There were some cases where the buffer is
queued and freed later (queued in p_clcb->p_q_cmd for later
access and freeing), but many times the event handlers
(like bta_gattc_ci_save()) don't queue the buffer and don't
free it, causing a GKI buffer leak.

Also, prevent a double free case (not certain it happens, but
in theory it could) if bta_gattc_sm_execute() queues a buffer
in bta_gattc_disc_cmpl().

Lastly, remove held flag since it's redundant with whether
p_q_cmd is null or not. Just go with one source of truth and
not have one shadow the other.

Change-Id: I1bd43919b8a2e125076e26cd6a3a08480b3e7e2d
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/bt/bta/gatt/bta_gattc_int.h
7fa4fba6f59f97df00aff07dbe8fb21b114b3c2c 17-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Merge BT 4.1 features

The features include:
- LE Peripheral Mode
- Link Layer topology (LE Central & Peripheral Concurrency)
- Dual Mode Topology (Ability to choose LE transport when connecting with
other Dual Mode devices)
- Fast advertising Interval
- Limited Discovery Time Changes
- GAP Authentication and Lost Bond
- Dual Mode Addressing
- Common Profile and Service Error Code
- 32 bit UUIDs

Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42

Conflicts:
stack/btu/btu_hcif.c
/system/bt/bta/gatt/bta_gattc_int.h
8fe58875ce67c6e1099e7ba2339dcd2b979491b0 17-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Merge BT 4.1 features

The features include:
- LE Peripheral Mode
- Link Layer topology (LE Central & Peripheral Concurrency)
- Dual Mode Topology (Ability to choose LE transport when connecting with
other Dual Mode devices)
- Fast advertising Interval
- Limited Discovery Time Changes
- GAP Authentication and Lost Bond
- Dual Mode Addressing
- Common Profile and Service Error Code
- 32 bit UUIDs

Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42
/system/bt/bta/gatt/bta_gattc_int.h
9291a71c28b2eedff2c1ad760ebe3b3c1f5a6a29 25-Mar-2014 Zhihai Xu <zhihaixu@google.com> LE: Add API to configure MTU for a given connection (2/4)
This patch from broadcom(andre)
bug:13571470
Change-Id: I932905590ee9c40cb67e7d09715c0f8e59d2f662
/system/bt/bta/gatt/bta_gattc_int.h
e96ce0e945e210b22bbf6a3869809852c7e1d35e 06-Mar-2014 Andre Eisenbach <andre@broadcom.com> DO NOT MERGE: LE: Add status callback function for LE broadcasts
Cherry pick from master

Change-Id: If4342050ce1141a9c2111286e7b3cccdc012a91e
/system/bt/bta/gatt/bta_gattc_int.h
9426d530e9bbc5d3ffae55515388d49185c61325 25-Mar-2014 Andre Eisenbach <andre@broadcom.com> LE: Add API to configure MTU for a given connection (2/4)

bug:13571470
Change-Id: I932905590ee9c40cb67e7d09715c0f8e59d2f662
/system/bt/bta/gatt/bta_gattc_int.h
a4611ac05f07360785adcff8640da01a3894e4c5 06-Mar-2014 Andre Eisenbach <andre@broadcom.com> DO NOT MERGE: cherrypick from master to fix b/13289050

LE: Add status callback function for LE broadcasts

Change-Id: If4342050ce1141a9c2111286e7b3cccdc012a91e
/system/bt/bta/gatt/bta_gattc_int.h
b9912730d082c7bca7d94bb9ddac4447cfad362f 13-Nov-2013 Zhihai Xu <zhihaixu@google.com> DO NOT MERGE BLE HID device connection failure due to security error.

When HID BLE device start encryption, if some other GATT application
already start encryption(but not finished yet) by calling
gatt_security_check_start. The HID BLE device will be failed to start
encryption, which will cause it to disconnect the BLE HID connection.
The solution is to check whether we already started the encryption
, If the encryption is already started, wait until the encryption
finished, then continue to start security check for BLE HID device.
add encrytion complete event to notify all GATT client encryption done.
filter the event just for BTA HH LE GATT client.

bug:11636246
Change-Id: If58e57c623cc8cfa05208587b010bec68c71306c
/system/bt/bta/gatt/bta_gattc_int.h
7051db3a486aae771d9b5a81c3546790f86ede34 13-Nov-2013 Zhihai Xu <zhihaixu@google.com> BLE HID device connection failure due to security error.

When HID BLE device start encryption, if some other GATT application
already start encryption(but not finished yet) by calling
gatt_security_check_start. The HID BLE device will be failed to start
encryption, which will cause it to disconnect the BLE HID connection.
The solution is to check whether we already started the encryption
, If the encryption is already started, wait until the encryption
finished, then continue to start security check for BLE HID device.
add encrytion complete event to notify all GATT client encryption done.
filter the event just for BTA HH LE GATT client.

bug:11636246
Change-Id: If58e57c623cc8cfa05208587b010bec68c71306c
/system/bt/bta/gatt/bta_gattc_int.h
8dc42c603f5571047878640705eee18fa5396f11 01-Nov-2013 Andre Eisenbach <andre@broadcom.com> LE: Increase number of simultaneous connections

Currently the maximum number of parallel connections is 4. This patch
increases the limit to allow for more devices.
bug 11571899
Change-Id: I42b77e6b67f59d7d430d879a5fb0eb80982160b5
/system/bt/bta/gatt/bta_gattc_int.h
5c44e45473e5fc2fa89411ab1add7dbfc979f1f8 07-Aug-2013 Andre Eisenbach <andre@broadcom.com> LE: Add peripheral role support (2/4)

Initial stack support for the LE peripheral role.

Change-Id: I261d751b43b7020760bff345b472b6f60caa60be
/system/bt/bta/gatt/bta_gattc_int.h
6975b4d711142b885af479721cada448952c6b41 06-Aug-2013 Andre Eisenbach <andre@broadcom.com> LE: UPF 45 bug fixes

This change fixes the following issues:
- Second GATT-over-BR/EDR channel cannot be established when there
already is an existing GATT-over-BR/EDR channel
- If encryption fails for an LE connection due to a missing key,
the security state is not being cleared and blocks all further
security processing
- When DM discovery of an LE Peripheral device fails with a
connection timeout, no further discovery requests can be made
- GATT service discovery can get into endless loop when duplicate descriptor
definitions are found on the remote device
- When GATT over BR/EDR fails, BTA does not give a connection
callback to the application initiating the connection
- BR/EDR connection to remote platform does not generate API callbacks
- Stack crash discovered during UPF after remote disconnects
- The host is sending HCI disconnect to invalid HCI handle when
SMP fails because of a connection timeout
- Possible race condition:
If a disconnect is immediately followed by a connection complete,
the connection complete cannot be processed in the BTA GATT state
machine
- Write Complete event is not triggered for Prepare Write requests

Change-Id: I539cdedd68007818ff4f0d0213cee1c913f72d0f

Conflicts:
bta/gatt/bta_gatts_act.c
/system/bt/bta/gatt/bta_gattc_int.h
e1202caae4920139ea0cfed5c51f5f76b2dc8bc4 15-May-2013 Andre Eisenbach <andre@broadcom.com> LE: Add GATT disable functions

This patch adds required disable functions to the GATT sub-system to
properly unregister with the stack. Without the disable functions in
place, turning Bluetooth off with a GATT device connected may lead to
unexpected behaviour and cause GATT to fail on sub-sequent stack
restarts.

Change-Id: I7cb80e96109e2c09882991298d0487b506f5ffdd
/system/bt/bta/gatt/bta_gattc_int.h
946c681e59451164b343b7ab9415aa73b0d176bc 04-Apr-2013 Andre Eisenbach <andre@broadcom.com> Fix LE background connections not adding device to white-list.

Also changed maximum number of client applications to 32.

Change-Id: Id4697924b211330e231b36d7f89ca9d89b54117f
/system/bt/bta/gatt/bta_gattc_int.h
ead3cde4bac0c3e32cd31f149093f004eef8ceeb 06-Feb-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Initial version of BLE support for Bluedroid

Change-Id: I9825a5cef9be2559c34c2a529b211b7d471147cf
/system/bt/bta/gatt/bta_gattc_int.h
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/bta/gatt/bta_gattc_int.h