GATT, HID, HOG, might be interested in the fact that some device has
been unpaired in order to clear cache or similar. This patch adds means
to register and unregister callback for unpaired event.
When session_cb returns FALSE respective watch id is removed so it
must be cleanup. This fix following Glib warning when unrefing
avdtp after transport was disconnected by remote:
(process:28510): GLib-CRITICAL **: Source ID 2 was not found when
attempting to remove it
First it searches for control and data PSMs and then search again
for remote mdep id. It would be better to search remote mdep id
and cache in first time itself. Patch avoids load of sdp search
request for second time.
Those function can be used by other tester modules
In addition function emu_remote_disconnect_hci_action has been changed a
bit so it take handle from step data now. It was needed as cid_data was
static in tester_gatt.c
Encryption is mandatory for keyboards. Instead of using hardcoded security
level it's now set per device (with LOW as default) and raised for
keyboards (after the SDP query is done). This level is then used to
establish outgoing connections and raising the security level of the
incomming ones.
PTS expects to close all data channels before sending delete
confirmation to peer. FD is passed over IPC to Android Bluetooth
application so it needs to be shutdown while freeing channel to
avoid races.
Shutdown_mdl shutdown io channels and unrefs it. After that related
callbacks will shutdown or close and free its data. Due to timing
issue process_md_delete_mdl_req send delete confirmation response to
peer before properly shutting down all opened data channels.
MCAP library is maintaining two sets of mcl list. On mcl_disconnected
call mcl instance is removed from regular mcl list and cached in
mcl_cache list. health.c doesn't maintain any cached mcls list. So
mcl_conn variable doesn't make any sense of not being connected on
mcl_disconnected call back. So unref mcl on mcl_disconnected and don't
do anything in mcl_unached callback.
Test TC_SRC_TG_HFAV_CLH_MD_BV_04_I pass when Music application triggers
music play/pause after it gets both: Button Pushed and Button
Released events.
Note that AOSP Music player triggers play/pause just after it gets
Button Pushed
Since Android KitKat we can use sys/prctl.h and sys/capability.h
as specified in the manual page. Fixes also build warnings:
...
warning: implicit declaration of function 'prctl'
[-Wimplicit-function-declaration]
if (prctl(PR_SET_KEEPCAPS, 1) < 0) {
^
...
This patch refactor a bit select_device_bearer function so we can get
debug log out of it. This log might be very useful in dual mode devices
scenarios
In a case get_app(), get_device(), get_channel() fail prevent
dereference of NULL pointer. Fixes clang warnings:
...
android/health.c:1980:15: warning: Access to field 'dev' results in a
dereference of a null pointer (loaded from variable 'channel')
queue_remove(channel->dev->channels, channel);
^~~~~~~~~~~~
1 warning generated.
...
So far BfA updates android bond state after link key(s) are
distributed. With LE pairing it might happen that no keys are
distributed e.g remote device has Initiator Key Distribution and
Responder Key Distribution set to 0. In such case link is encrypted
with STK and after its disconnected, pairing needs to be done again.
With this patch Android will get update about pairing complete just
after BfA gets pairing complete from the kernel. It solve issue withnot
updated Android settings application, which is hanging on "Pairing", in
case when no keys are distributed.
However, bacause Android does not see the difference between bonded /
paired devices and because Android does not allow to update its bond
state if FSM it is not in 'pending' state, BfA updates Android with
BONDED state on pair_complete with success. This is how we are doing
so far for bonding and non-bonding pairing.
Note: BfA will update its bonded state after link key(s) are
distribiuted.