Commit Graph

1626 Commits

Author SHA1 Message Date
Szymon Janc
412f893256 android/hal: Update services register commands with mode parameter 2014-03-04 10:18:27 +01:00
Szymon Janc
68cc1c5685 android/ipc: Add Mode parameter to register service command
This will allow to run daemon services in non-default mode.
2014-03-04 10:18:27 +01:00
Szymon Janc
b720a0637f android/bluetooth: Remove leftover function declaration 2014-03-03 20:04:47 +01:00
Szymon Janc
9395261651 android: Fix build under Android 2014-03-03 19:54:27 +01:00
Jakub Tyszkowski
90ce3b7bfc android/hal-gatt: Add skeleton for GATT HAL
This adds skeleton with stubs and proper build system entries.
2014-03-03 16:11:07 +01:00
Grzegorz Kolodziejczyk
1def0ca307 android/gatt: Add stubs for GATT commands handlers
Add empty handlers for GATT IPC commands.
2014-03-03 16:11:07 +01:00
Grzegorz Kolodziejczyk
319245da2b android/gatt: Add initial files
This adds initial daemon code for GATT profile.
2014-03-03 16:11:07 +01:00
Szymon Janc
4262d6e10f android/avrcp-lib: Fix destroy callback handling
AVRCP destroy callback was directly passed as AVCTP destroy callback
resulting in struct avrcp not being freed on remote disconnect.

This fix following Valgrind report:

931 (36 direct, 895 indirect) bytes in 1 blocks are definitely lost in
     loss record 53 of 55
   at 0x4896DC8: calloc (in /system/lib/valgrind/
     vgpreload_memcheck-arm-linux.so)
   by 0x48C5DB7: g_malloc0 (gmem.c:189)
   by 0x118671: avrcp_new (avrcp-lib.c:219)
   by 0x117D4F: connect_cb (avrcp.c:346)
   by 0x12068B: connect_cb (btio.c:232)
   by 0x48BD9C7: g_io_unix_dispatch (giounix.c:166)
   by 0x48C2CCB: g_main_context_dispatch (gmain.c:2539)
   by 0x48C2ED9: g_main_context_iterate.isra.19 (gmain.c:3146)
   by 0x48C3167: g_main_loop_run (gmain.c:3340)
   by 0x10BA03: main (main.c:490)
2014-03-03 16:11:18 +02:00
Grzegorz Kolodziejczyk
1c4a20bc66 android/tester: Add remove bond success test case
This adds remove bond success test case. SSP as pairing mode.
2014-03-03 12:53:25 +01:00
Grzegorz Kolodziejczyk
f745b613e9 android/tester: Add cancel bond success test case
This adds cancel bond success test case. SSP as pairing mode.
2014-03-03 12:53:25 +01:00
Grzegorz Kolodziejczyk
52b27253b5 android/tester: Add create bond with bad addr fail test case
This adds create bond with bad addr fail test case.
2014-03-03 12:53:25 +01:00
Grzegorz Kolodziejczyk
5d53e70759 android/tester: Add create bond with no discovery test case
This adds create bond with no discovery before create bond as NFC does.
SSP with confirm as authentication mode.
2014-03-03 12:53:25 +01:00
Grzegorz Kolodziejczyk
b3e574e1f9 android/tester: Add create bond with SSP fail test case
This adds create bond with SSP fail test case. Confirm is set as SSP
pairing mode.
2014-03-03 12:53:25 +01:00
Grzegorz Kolodziejczyk
75babd85bf android/tester: Add create bond with SSP sucess test case
This adds create bond with SSP succes test case. Confirm is set as SSP
pairing mode.
2014-03-03 12:53:25 +01:00
Grzegorz Kolodziejczyk
caa1dfc73f android/tester: Add create bond with PIN fail test case
This adds create bond with PIN fail test case.
2014-03-03 12:53:25 +01:00
Grzegorz Kolodziejczyk
8f8f75db3a android/tester: Add create bond with PIN success test case
This adds create bond with PIN success test case.
2014-03-03 12:53:25 +01:00
Grzegorz Kolodziejczyk
74f07466bf android/tester: Coding style and syntax fix
Remove white spaces, break lines over 80 characters, redundand braces
for single statement blocks.
2014-03-03 12:53:25 +01:00
Szymon Janc
c9f5b795cc android/avrcp-lib: Fix not freeing tx buffer on AVRCP shutdown 2014-03-03 11:12:46 +02:00
Szymon Janc
c7b5bf9bd4 android/socket: Remove leftover function declaration 2014-03-02 22:50:50 +01:00
Grzegorz Kolodziejczyk
a7b02c9cb3 android/hal-gatt-api: Add Server Response Confirmation Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
a1ae678eed android/hal-gatt-api: Add Server Request Execute Write Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
e91dbfd3de android/hal-gatt-api: Add Server Request Write Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
cf5796254e android/hal-gatt-api: Add Server Request Read Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
71bca9e1ae android/hal-gatt-api: Add Server Service Deleted Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
016a5ddd4b android/hal-gatt-api: Add Server Service Stopped Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
ab688aa2ed android/hal-gatt-api: Add Server Service Started Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
01491c143e android/hal-gatt-api: Add Server Descriptor Added Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
6c5e96bbe7 android/hal-gatt-api: Add Server Characteristic Added Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
85532964ff android/hal-gatt-api: Add Server Included Service Added Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
fddea728da android/hal-gatt-api: Add Server Service Added Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
67584deb49 android/hal-gatt-api: Add Server Connection Notification 2014-03-02 22:19:34 +01:00
Grzegorz Kolodziejczyk
8dfab692fe android/hal-gatt-api: Add Server Register Notification 2014-03-02 22:19:34 +01:00
Jakub Tyszkowski
f977eb5c98 android/hal-gatt-api: Add Client Listen event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
52588d5ca3 android/hal-gatt-api: Add Client Read Remote RSSI event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
1a2c59b384 android/hal-gatt-api: Add Client Exec Write event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
e37d6f37a9 android/hal-gatt-api: Add Client Write Descriptor event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
57d3b65810 android/hal-gatt-api: Add Client Read Descriptor event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
f051427612 android/hal-gatt-api: Add Client Write Characteristic event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
9eb57885c1 android/hal-gatt-api: Add Client Read Characteristic event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
ec374548a4 android/hal-gatt-api: Add Client Notify event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
95f2c9e067 android/hal-gatt-api: Add Client Register for Notification event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
4140026853 android/hal-gatt-api: Add Client Get Included Service event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
c7ca8b13a9 android/hal-gatt-api: Add Client Get Descriptor event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
6624b03c56 android/hal-gatt-api: Add Client Get Characteristic event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
0589710b48 android/hal-gatt-api: Add Client Search Result event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
9828ebe8d2 android/hal-gatt-api: Add Client Search Complete event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
7093092de1 android/hal-gatt-api: Add Client Disconnect event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
6df9839372 android/hal-gatt-api: Add Client Connect event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
3417c8beff android/hal-gatt-api: Add Client Scan Result event 2014-03-02 22:18:56 +01:00
Jakub Tyszkowski
5f77a85d55 android/hal-gatt-api: Add Client Register event 2014-03-02 22:18:56 +01:00
Luiz Augusto von Dentz
c3b30229bf android: Fix not cleaup AVRCP service
This causes the following leak:
744 (72 direct, 672 indirect) bytes in 1 blocks are definitely lost in loss record 114 of 119
   at 0x4C291D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FEC6: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x41C2ED: avrcp_new (avrcp-lib.c:203)
   by 0x41B4F8: connect_cb (avrcp.c:708)
   by 0x4212AB: connect_cb (btio.c:232)
   by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x403A54: main (main.c:490)
2014-03-02 20:42:57 +02:00
Luiz Augusto von Dentz
8a50b1f2eb android/avctp: Fix leaking passthrough handler
In case the handler is not destroyed by the owner automatically free it
as there is no use for it after the session is freed.
2014-03-02 20:42:57 +02:00
Marcel Holtmann
537dba6265 android: Fix ntoh24 and hton24 for big endian platforms 2014-03-01 12:01:21 -08:00
Szymon Janc
0fad8a94a1 android/socket: Fix errno handling in rfsock_set_buffer 2014-03-01 17:22:23 +01:00
Szymon Janc
30806e2eb9 android/hal-ipc: Fix double include of errno.h 2014-03-01 17:22:23 +01:00
Szymon Janc
7dbad8ee51 android/hal-audio: Fix error code handling in audio_ipc_init
Make audio_ipc_init follow convention of returning negative code on
error. This also fix passing negative error code to strerror in case
of pthread_create failure (this function returns non-negative code
on error).
2014-03-01 17:22:23 +01:00
Szymon Janc
21ad4b8f15 android/hal-audio: Fix errno handling in set_blocking 2014-03-01 17:22:23 +01:00
Szymon Janc
a374c5dc73 android/socket: Use same RFCOMM channels for services as Linux daemon
Use numbers from doc/assigned-numbers.txt.
2014-03-01 13:39:22 +01:00
Szymon Janc
95db67e01f android/hal-pan: Fix empty parameters list in functio definition 2014-02-28 19:08:49 +01:00
Szymon Janc
dd5a24fd35 android/hal-pan: Fix using wrong structure in pan_cleanup 2014-02-28 19:07:37 +01:00
Szymon Janc
c9a95f87eb android/ipc-tester: Fix structure passed to core unregister tests 2014-02-28 19:01:15 +01:00
Szymon Janc
7d95d027b1 android: Create comon header for IPC
This header contains IPC specific structures and code not related to
BT and audio HAL protocols. This allows to fully decouple IPC from
HAL messages.

This is first step to make HAL part of IPC unit-testable and reusable
between BT HAL and audio HAL.
2014-02-28 15:22:45 +01:00
Szymon Janc
d61f3fc72e android/a2dp: Use common IPC for audio socket
This makes audio HAL to use same code for IPC as BT HAL.
2014-02-28 15:22:45 +01:00
Szymon Janc
3f7daeb0e8 android: Add support for disabling notifications in IPC 2014-02-28 15:22:45 +01:00
Szymon Janc
a3b0e736af android/unit: Update test-ipc with disconnect handler support 2014-02-28 15:22:45 +01:00
Szymon Janc
5862f2f6a5 android: Add support for registering disconnect callback in IPC
Allow to register callback which is called in case of IPC failure
(eg malformed message) or disconnection. This makes caller responsible
for performing expected action in such case.
2014-02-28 15:22:45 +01:00
Szymon Janc
dd1e44fce1 android: Refactor IPC init
This allows to pass socket path and max service ID while initializaing
IPC. This is first step to allow use it both for BT and Audio HALs.
2014-02-28 15:22:45 +01:00
Sebastian Chlad
a7471c5334 android/pics: Add PICS and PIXIT for HFP
Added PICS and PIXIT target Android 4.4
2014-02-28 13:10:41 +01:00
Sebastian Chlad
b0ce17b5df android/pics: Add PICS and PIXIT for HSP
Added PICS and PIXIT target Android 4.4
2014-02-28 13:09:25 +01:00
Andrei Emeltchenko
b0d2871a18 android/avrcp: Implement get player attributes text 2014-02-28 11:02:15 +02:00
Andrei Emeltchenko
2fdd6528a5 android/avrcp: Add list player attributes command 2014-02-28 11:02:15 +02:00
Andrei Emeltchenko
c1977e7f3c android/avrcp: Refactor get_caps() to allow parameter
Allow passing parameter specifying capability ID.
2014-02-28 10:59:00 +02:00
Grzegorz Kolodziejczyk
8fbe112020 android/hal-gatt-api: Add Server Send Response 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
1574417acd android/hal-gatt-api: Add Server Send Indication 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
ea61f8890d android/hal-gatt-api: Add Server Delete Service 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
00641251a8 android/hal-gatt-api: Add Server Stop Service 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
011f1b8e13 android/hal-gatt-api: Add Server Start Service 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
8859abc7ab android/hal-gatt-api: Add Server Descriptor 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
7a98837153 android/hal-gatt-api: Add Server Characteristic 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
ec71b193cb android/hal-gatt-api: Add Server Included Service 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
e72eb6f8e4 android/hal-gatt-api: Add Server Service 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
b00bb711e1 android/hal-gatt-api: Add Server Disconnect 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
2197a65076 android/hal-gatt-api: Add Server Connect 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
16a85dcd3b android/hal-gatt-api: Add Server Unregister 2014-02-27 22:11:56 +01:00
Grzegorz Kolodziejczyk
6560358265 android/hal-gatt-api: Add Server Register 2014-02-27 22:11:56 +01:00
Jakub Tyszkowski
47af8ad9a0 android/hal-gatt-api: Add Client Test Command 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
61c5fdb0e0 android/hal-gatt-api: Add Client Set Advertising Data 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
83ced6b01b android/hal-gatt-api: Add Client Get Device Type 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
d02aa1acd4 android/hal-gatt-api: Add Client Read Remote RSSI 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
8c3e4af646 android/hal-gatt-api: Add Client Deregister for Notification 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
1f3d2f1cd5 android/hal-gatt-api: Add Client Register for Notification 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
e55570b960 android/hal-gatt-api: Add Client Execute Write 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
967acfbac9 android/hal-gatt-api: Add Client Write Descriptor 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
cc4e96ef5b android/hal-gatt-api: Add Client Read Descriptor 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
621fce73e4 android/hal-gatt-api: Add Client Write Characteristic 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
f5207a1fa6 android/hal-gatt-api: Add Client Read Characteristic 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
2c4ff18695 android/hal-gatt-api: Add Client Get Descriptor 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
8d31dd6625 android/hal-gatt-api: Add Client Get Characteristic 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
bc7222d2cb android/hal-gatt-api: Add Client Get Included Service 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
04a3644671 android/hal-gatt-api: Add Client Search Service 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
7dbe032c40 android/hal-gatt-api: Add Client Refresh Remote Cache 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
ca940bfa36 android/hal-gatt-api: Add Client Listen 2014-02-27 21:57:28 +01:00
Jakub Tyszkowski
557fc016de android/hal-gatt-api: Add Client Disconnect Remote 2014-02-27 21:57:27 +01:00
Jakub Tyszkowski
7ab2074a3e android/hal-gatt-api: Add Client Connect Remote 2014-02-27 21:57:27 +01:00
Jakub Tyszkowski
595a5cb7b2 android/hal-gatt-api: Add Client Scan 2014-02-27 21:57:27 +01:00
Jakub Tyszkowski
8b7d09015b android/hal-gatt-api: Add Client Unregister 2014-02-27 21:57:27 +01:00
Jakub Tyszkowski
494dcac6fe android/hal-gatt-api: Add Client Register 2014-02-27 21:57:27 +01:00
Jakub Tyszkowski
3e0e5c15a5 android/hal-gatt-api: Add missing opcodes in GATT Service
Add missing Listen and Set Advertising Data opcodes and reorder them as
they appear in HAL's headers.
2014-02-27 21:57:27 +01:00
Szymon Janc
61a8048b0c android/tester: Add breaks at last cases of switch statements 2014-02-27 15:05:31 +01:00
Jakub Tyszkowski
25d9d91d02 android/tester: Add guard for late callback calls
This fixes callbacks being called in wrong test case when current test
has already failed or timed out.
2014-02-27 15:05:31 +01:00
Szymon Janc
450d49cb07 android/tester: Use signalfd for tracking daemon lifetime
This fixes the main loop being blocked, waiting for daemon termination
while daemon waits for freezed emulator to respond.
2014-02-27 15:05:31 +01:00
Jakub Tyszkowski
1791338b1f android/tester: Execute hh virtual unplug cbacks in main loop
Execute generic HIDHost virtual_unplug_cb in tester's main loop.
2014-02-27 15:05:31 +01:00
Jakub Tyszkowski
36de542148 android/tester: Execute hh report cbacks in main loop
Execute HIDHost generic get_report_cb in tester's main loop.
2014-02-27 15:05:31 +01:00
Jakub Tyszkowski
768f55b498 android/tester: Execute hh protocol mode cbacks in main loop
Execute generic HIDHost protocol_mode_cb in tester's main loop.
2014-02-27 15:05:30 +01:00
Jakub Tyszkowski
baea35a68a android/tester: Execute hh info cbacks in main loop
Execute generic HIDHost hid_info_cb in tester's main loop.
2014-02-27 15:05:30 +01:00
Jakub Tyszkowski
ebfb3817ce android/tester: Execute hh connection state cbacks in main loop
Execute generic HIDHost connection_state_cb in tester's main loop.
2014-02-27 15:05:30 +01:00
Jakub Tyszkowski
1f1de7208f android/tester: Execute socket cbacks in main loop
Execute socket test's callbacks in tester's main loop.
2014-02-27 15:05:30 +01:00
Jakub Tyszkowski
7e9f86e933 android/tester: Execute adapter state changed cbacks in main loop
Execute generic adapter_state_changed_cb in tester's main loop.
2014-02-27 15:05:30 +01:00
Jakub Tyszkowski
75d38d39a0 android/tester: Execute adapter props cbacks in main loop
Execute generic adapter_properties_cb in tester's main loop.
2014-02-27 15:05:30 +01:00
Jakub Tyszkowski
38dc82f3b2 android/tester: Execute device properties cbacks in main loop
Execute generic remote_device_properties_cb in tester's main loop.
2014-02-27 15:05:30 +01:00
Jakub Tyszkowski
420ce17d67 android/tester: Execute discovery state cbacks in main loop
Execute generic discovery_state_changed_cb in tester's main loop.
2014-02-27 15:05:30 +01:00
Jakub Tyszkowski
378d18c25e android/tester: Execute device found cbacks in main loop
Execute generic device_found_cb in tester's main loop.
2014-02-27 15:05:30 +01:00
Andrei Emeltchenko
99af839d74 android/avrcp: Fix passing wrong len
When handling vendor dependent PDUs len was passed in wrong order to
callback function. It is really wrong to pass such a parameter and
expect that callbacks would handle it.
2014-02-26 18:26:04 +01:00
Andrei Emeltchenko
0da74a1afc unit/avrcp: Add /TP/CFG/BV-02-C test
Test verifies that the Target responds to Get Capability request.
2014-02-26 18:26:04 +01:00
Andrei Emeltchenko
ded70b727e android/avrcp: Add avrcp_get_capabilities request
Implement avrcp_get_capabilities() request through
avrcp_send_vendordep_req(). avctp_send_req() is not exported so we use
the functions which are exported by AVCTP code.
2014-02-26 18:26:03 +01:00
Johan Hedberg
32b444a25d build: Link crypto code with the emulator 2014-02-26 17:59:37 +02:00
Grzegorz Kolodziejczyk
6c0e9f03fc android/hal-ipc-api: Fix Add Set Volume command struct packing
This adds missed packed struct attribute to hal-ipc command.
2014-02-26 14:56:33 +01:00
Szymon Janc
c3ff0ca0d0 android/pts: Fix lines over 80 characters 2014-02-24 22:23:34 +01:00
Szymon Janc
af9ebd4a0f android/pts: Update MAP tests results 2014-02-24 22:12:52 +01:00
Szymon Janc
93c12a9281 android/hal-ipc: Fix race condition when closing IPC
Protect command socket cleanup with mutex to avoid bogus exit when
stopping notification thread.
2014-02-24 20:28:41 +01:00
Szymon Janc
3c7f2c9430 android/bluetooth: Don't set remote name to empty string
If remote device has name but it is empty (0 bytes) just ignore it and
continue using address as name. This will avoid sending remote device
property notification with empty name.
2014-02-24 20:28:41 +01:00
Luiz Augusto von Dentz
1e8a6d5b4d android/avctp: Checks error on send_event
In case of EINTR retry sending the event otherwise print the errno.
2014-02-24 17:02:11 +01:00
Luiz Augusto von Dentz
569685b752 android/avctp: Fix failing silently if uinput is not initialized
This adds a check for uinput before attempting to use send_key and if it
is not initialized response with AVC_CTYPE_NOT_IMPLEMENTED which is the
same code used when a unkown key is received.
2014-02-24 17:02:11 +01:00
Andrei Emeltchenko
6f51c94e27 android/avctp: Set uinput to invalid fd when creating session
When AVCTP session was created uinput was zero which is valid file
descriptor and that was conflicting with socketpair() fds.
2014-02-24 17:02:11 +01:00
Szymon Janc
aa887bf05a android: Update socket service id name to match service name 2014-02-24 13:45:09 +01:00
Luiz Augusto von Dentz
3dd85709ac android/avrcp-lib: Add avrcp_set_passthrough_handlers
This adds avrcp_set_passthrough_handlers which can be used to set
pass-through PDU handlers table and user data.
2014-02-24 13:34:18 +01:00
Luiz Augusto von Dentz
8656a965de android/avrcp-lib: Add avrcp_set_control_handlers
This adds avrcp_set_control_handlers which can be used to set control
PDU handlers table and user data.
2014-02-24 13:33:59 +01:00
Luiz Augusto von Dentz
2b0a3f5c7c android/avrcp-lib: Rename AVCTP session to conn 2014-02-24 13:33:51 +01:00
Andrei Emeltchenko
9f42e2dfc0 android/avrcp: Use NULL for zero pointers 2014-02-24 13:25:25 +01:00
Szymon Janc
64d17c7904 android: Add pts-pan.txt to EXTRA_DIST 2014-02-24 12:12:25 +01:00
Szymon Janc
34f32c03dd android/handsfree: Use HFP code for connection handling
HFP code is now able to handle disconnection on its own so just use
this instead of using own watches.
2014-02-24 10:49:38 +01:00
Andrei Emeltchenko
b4f90cf6f9 android/tester: Fix slang "never used" warning
The patch fixes following warning:
...
android/android-tester.c:2185:2: warning: Value stored to
'adapter_status' is never read
        adapter_status = data->if_bluetooth->set_adapter_property(prop);
        ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
2014-02-24 10:28:57 +01:00
Szymon Janc
07a07fadca android: Add --leak-check=full option to valgrin in system-emulator 2014-02-22 21:56:46 +01:00
Szymon Janc
c6d09297cd android/bluetooth: Fix memory leak in store_link_key
If loading key file from file failed free key file. This fix following:

490 (40 direct, 450 indirect) bytes in 1 blocks are definitely lost in
    loss record 122 of 126
   at 0x4028B4C: malloc (vg_replace_malloc.c:291)
   by 0x40A25B2: g_malloc (in /lib/i386-linux-gnu/
    libglib-2.0.so.0.3800.2)
   by 0x40B8DB1: g_slice_alloc (in /lib/i386-linux-gnu/
    libglib-2.0.so.0.3800.2)
   by 0x40B92DC: g_slice_alloc0 (in /lib/i386-linux-gnu/
    libglib-2.0.so.0.3800.2)
   by 0x40946BB: g_key_file_new (in /lib/i386-linux-gnu/
    libglib-2.0.so.0.3800.2)
   by 0x8054A84: new_link_key_callback (bluetooth.c:563)
   by 0x804FB44: notify_handler (mgmt.c:278)
   by 0x804F357: queue_foreach (queue.c:186)
   by 0x804FE6C: can_read_data (mgmt.c:290)
   by 0x804ED12: read_callback (io-glib.c:168)
   by 0x40E0CF4: ??? (in /lib/i386-linux-gnu/libglib-2.0.so.0.3800.2)
   by 0x409CAED: g_main_context_dispatch (in /lib/i386-linux-gnu/
    libglib-2.0.so.0.3800.2)
2014-02-22 21:56:46 +01:00
Marcel Holtmann
c7ccca8027 android: Add extra empty line in API docs 2014-02-21 22:09:21 -08:00
Marcel Holtmann
1fb4f90818 android: Fix copy&paste issue in error message 2014-02-21 10:20:35 -08:00
Sebastian Chlad
b1dd7119df android/pts: Update test results for A2DP 2014-02-21 17:54:36 +01:00
Andrzej Kaczmarek
8648ed970e android/socket: Fix calling cleanup with invalid pointer 2014-02-21 15:29:09 +01:00
Andrzej Kaczmarek
f68a71a4d4 android/hal-audio: Add simple downmix to mono
This patch adds simple downmix support from stereo to mono in order to
support mono channel mode as it's mandatory for SBC codec. It uses
simple (L+R)/2 calculation which should be good enough.
2014-02-21 13:01:50 +01:00
Grzegorz Kolodziejczyk
fd25ce76a2 android/tester: Fix Discovery Stop - Success test case
This removes start discovery returned status check what derives double
check of expected status. Returned status should be only checked for cancel
discovery.
2014-02-21 12:53:22 +01:00
Grzegorz Kolodziejczyk
dc8221d63d android/tester: Fix tester setup result set
Tester setup result is set to pass after set to fail because of missing
function return. This adds return from function after setting of setup
result to fail.
2014-02-21 12:53:22 +01:00
Lukasz Rymanowski
240eec7fed android: Do not resolve name if we have it in the cache
With this patch, deamon will not ask kernel to resolve name of remote
device during inquiry in case device name is already in the local cache.
Instead Android will be updated with already known device name.
2014-02-21 11:45:12 +01:00
Lukasz Rymanowski
be76f91c20 android: Add resolve_name parameter to confirm_device_name 2014-02-21 11:45:11 +01:00
Sebastian Chlad
42698720dd android/pts: PTS test results for PAN
This adds initial PTS test results for PAN profile.
2014-02-21 11:18:37 +01:00
Sebastian Chlad
37178ee0d9 android/pixit: correct PIXIT value
It is important for NAP role to set proper PTS btaddr in PIXIT
2014-02-21 11:18:37 +01:00
Szymon Janc
46246ab913 android/hal-handsfree: Use fixed size buffers for commands
This make code follow same conventions for all commands and simplify
code.
2014-02-21 11:18:37 +01:00
Szymon Janc
4d28eb85b7 android/hal-bluetooth: Use fixed size buffers for commands
This make code follow same conventions for all commands.
2014-02-21 11:18:37 +01:00
Andrei Emeltchenko
4351d46804 android: Add initial AVRCP common code
The patch makes AVRCP to be transport agnostic so that it can be used in
with socket pair to build unit tests.

The idea is that all AVRCP specific logic will stay on avrcp-lib until it
receives proper unit tests and then eventually will be used by audio
plugin as well.
2014-02-20 13:57:55 +02:00
Andrzej Kaczmarek
62261d0b6b android/README: Add note on libglib under Valgrind 2014-02-19 20:26:52 +01:00
Luiz Augusto von Dentz
3fb59115b7 android/hal-avrcp: Add notification handlers 2014-02-19 19:17:16 +01:00
Luiz Augusto von Dentz
32cc2bedbf android/hal-avrcp: Add .set_volume implementation 2014-02-19 19:17:16 +01:00
Luiz Augusto von Dentz
6753264d4e android/hal-avrcp: Add .register_notification_rsp implementation 2014-02-19 19:17:16 +01:00
Luiz Augusto von Dentz
5c3c1441ed android/hal-avrcp: Add .set_player_app_value_rsp implementation 2014-02-19 19:17:16 +01:00
Luiz Augusto von Dentz
96b14998e6 android/hal-avrcp: Add .get_element_attr_rsp implementation 2014-02-19 19:17:16 +01:00
Luiz Augusto von Dentz
3656c6fb14 android/hal-avrcp: Add .get_player_app_value_text_rsp implementation 2014-02-19 19:17:16 +01:00
Luiz Augusto von Dentz
7d519df9df android/hal-avrcp: Add .get_player_app_attr_text_rsp implementation 2014-02-19 19:17:16 +01:00
Luiz Augusto von Dentz
36f0586325 android/hal-avrcp: Add .get_player_app_value_rsp implementation 2014-02-19 19:17:15 +01:00
Luiz Augusto von Dentz
d4b59ee629 android/hal-avrcp: Add .list_player_app_value_rsp implementation 2014-02-19 19:17:15 +01:00
Luiz Augusto von Dentz
5aa5117647 android/hal-avrcp: Add .list_player_app_attr_rsp implementation 2014-02-19 19:17:15 +01:00
Luiz Augusto von Dentz
604acf4a34 android/hal-avrcp: Add .get_play_status implementation 2014-02-19 19:17:15 +01:00
Luiz Augusto von Dentz
b41ca5f43e android/avrcp: Add command handlers stubs 2014-02-19 19:17:15 +01:00
Luiz Augusto von Dentz
ff33778a87 android/hal-ipc-api: Use variable length for text attributes
This prevent having to increase the MTU size just to fit all attributes
when in fact some attributes are numbers (3 out of 8) in text format
which should not get even close to use 256 bytes defined by bt_rc.h.
2014-02-19 19:17:15 +01:00
Luiz Augusto von Dentz
1446bca69d android/hal-ipc-api: Add Set Volume command 2014-02-19 19:17:15 +01:00
Szymon Janc
6c1c75b368 android: Match socket IPC messages types with HAL name 2014-02-19 18:37:03 +01:00
Szymon Janc
c3b4322d18 android/hal-socket: Match functions names with HAL name 2014-02-19 18:37:03 +01:00
Szymon Janc
1f7c726bfd android/hal-sock: Rename to hal-socket
This will match convention used for lib and daemon part of HAL.
2014-02-19 18:37:03 +01:00
Szymon Janc
e323df9475 android/socket: Move statics declarations after types definitions
This also makes connections list static.
2014-02-19 18:37:03 +01:00
Szymon Janc
70bc1db7a2 android/hidhost: Add idle time callback implementation
Although this callback is for deprecated functionality and
corresponding notification is never send by daemon it should be
implemented for library and IPC completeness.
2014-02-19 18:37:03 +01:00
Szymon Janc
9d1f5a9ca9 android/pts: Update MAP results 2014-02-19 17:05:46 +01:00
Szymon Janc
fbe1e434a5 android/pixit: Update MAP setting 2014-02-19 17:05:46 +01:00
Szymon Janc
90b8f78803 android/pts: Update PTS test results for PBAP 2014-02-19 17:05:46 +01:00
Szymon Janc
307e4e14b3 android/pics: Fix PBAP settings 2014-02-19 17:05:46 +01:00
Szymon Janc
2ed242f4e9 android/socket: Update PBAP profile version in SDP record
Android supports PBAP 1.1.
2014-02-19 17:05:38 +01:00
Lukasz Rymanowski
f4ff283b43 android: Fix for BT Turn off while pairing
This patch fix an issue when Android disables BT during ongoing
paring. In this case mgmt did not accept any commands and BT gets
in some unknown state.
Since Android turns off BT anyway, it is ok to just cancel all
the mgmt requests before send power off command.
2014-02-17 14:42:15 +01:00
Marcel Holtmann
8addbf220e monitor: Add support for resolving random addresses 2014-02-17 00:23:29 -08:00
Andrei Emeltchenko
29fa9f53d8 android: Fix memory leak: uuid free
Free uuid before exiting.
2014-02-14 11:35:16 +01:00
Luiz Augusto von Dentz
0d8db636db android/hal-ipc-api: Add Passthrough Command notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
16b11a26a3 android/hal-ipc-api: Add Volume Changed notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
a040d1bfa1 android/hal-ipc-api: Add Register Notification notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
eebb90c754 android/hal-ipc-api: Add Get Element Attributes notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
83541b26ed android/hal-ipc-api: Add Set Player Values notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
a788d22d81 android/hal-ipc-api: Add Get Player Values Text notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
d69e42b45d android/hal-ipc-api: Add Get Player Attributes Text notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
cb78844274 android/hal-ipc-api: Add Get Player Values notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
c6a6cb31c7 android/hal-ipc-api: Add List Player Values notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
e23e02ed6a android/hal-ipc-api: Add List Player Attributes notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
eb1263196b android/hal-ipc-api: Add Get Play Status notification 2014-02-14 11:30:10 +01:00
Luiz Augusto von Dentz
786229f4f8 android/hal-ipc-api: Add Remote Features notification 2014-02-14 11:30:10 +01:00
Anderson Lizardo
ed1d75bee9 android/test-ipc: Use correct boolean values for glib functions 2014-02-12 20:20:03 +01:00
Luiz Augusto von Dentz
625fb585f5 android/hal-ipc-api: Add Register Notification Response 2014-02-12 19:26:32 +01:00
Luiz Augusto von Dentz
8c897760ca android/hal-ipc-api: Add Set Player Attributes Value Response 2014-02-12 19:26:32 +01:00
Luiz Augusto von Dentz
aad6de2ef1 android/hal-ipc-api: Add Get Element Attributes Text Response 2014-02-12 19:26:32 +01:00
Luiz Augusto von Dentz
c333844d4c android/hal-ipc-api: Add Get Player Values Text Response 2014-02-12 19:26:32 +01:00
Luiz Augusto von Dentz
c5522c9b0e android/hal-ipc-api: Add Get Player Attributes Text Response 2014-02-12 19:26:32 +01:00
Luiz Augusto von Dentz
0ff573021f android/hal-ipc-api: Add Get Player Attributes Response 2014-02-12 19:26:32 +01:00
Luiz Augusto von Dentz
341fe1cd57 android/hal-ipc-api: Add List Player Values Response 2014-02-12 19:26:32 +01:00
Luiz Augusto von Dentz
abe47600a8 android/hal-ipc-api: Add List Player Attributes Response 2014-02-12 19:26:32 +01:00
Luiz Augusto von Dentz
94b3b2b76f android/hal-ipc-api: Add Get Play Status Response 2014-02-12 19:26:32 +01:00
Andrei Emeltchenko
a6d0df8950 android/socket: Fix wrong memory access
This fixes accessing proto[2] in the code.
2014-02-12 15:23:22 +01:00
Szymon Janc
71f6681382 android/README: Update with implementation status summary
This will give a better overview of implemented features.
2014-02-12 13:59:55 +01:00
Andrzej Kaczmarek
968be4037c android/socket: Fix sockets security
Socket security shall be based on flags passed from HAL.

Android public API uses both encrypt and auth flags for "secure"
sockets which should be mapped to high security on our side, but since
this would also trigger requirement for 16-digits pin code (which is
not used in Android) we'll ignore auth flag and use either low or
medium security based on encrypt flag value only.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
4e3ad171df android/socket: Update channel numbers
OPP and PBAP channel numbers are set to same values as in Bluedroid.
Both MAP and SPP use channel numbers assigned dynamically.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
5b2756dd9b android/socket: Include HF AG in built-in profiles
This patch adds entry for HF AG profile in built-in profiles list. This
it to reserve channel number so it's not assigned to other service
registered by application. Method for creating SDP record is not
provided so it's not possible for application to register HF AG service
by mistake (this can be only done by handsfree profile implementation).
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
6c411b1832 android/socket: Register SDP record for application service
This patch adds SDP record for services registered from application
(other than built-in services).
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
a41087b916 android/socket: Add support for dynamic channel numbers
This patch adds support to register server with channel number assigned
dynamically, i.e. first free number is assigned. Channels which are
reserved for built-in services are not assigned for other services.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
f6b4d248ed android/tester: Update test data
Trying to listen on already assigned channel will now return busy
status instead of just fail.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
7f9ab50d9d android/socket: Make servers list as static array
Since there is only small, fixed number of channels to allocate for
RFCOMM servers we can store them in static array. This will make
lookup for free channel simpler once we add support to assign channel
numbers dynamically.

At startup, channels reserved for built-in services which have static
channel number are marked as reserved so they cannot be assigned for
other service.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
18f045b574 android/socket: Simplify SDP records handling
Records are now created using helper function which creates SDP record
with common contents like service class, name and protocols. Other
attributes are then added by custom functions.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
a5e248b29d android/socket: Improve logging
This patch makes logging more consistent by including rfsock pointer in
most messages which identifies socket structure unambigously (instead
of using bunch of file descriptors for the same purpose) and puts other
parameters in order in some cases.

Additionally, some new logs are introduced to better track socket
structures and connections lifetime.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
30023350be android/socket: Refactor socket related symbol names
This patch changes names of symbols related to various sockets to be
consistent and easier to follow in code.

Symbols related to actual BT (RFCOMM) socket are prefixed with "bt_".
Symbols related to local socket for Java comm are prefixed with "jv_".
Remote socket for Java comm is called "hal_sock".
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
eb5e7f97e6 android/bluetooth: Handle 128-bit UUIDs
It's now possible to add record with 128-bit UUID Service Class which
are used for custom applications. To simplify implementation adapter
uuids list stores now full UUID in uuid_t structure instead of uint16_t
short UUID.
2014-02-12 13:50:49 +01:00
Szymon Janc
b751d1894b android: Fix btmon build 2014-02-12 13:49:53 +01:00
Anderson Lizardo
124f6f0595 android: Add test-ipc to "make check" 2014-02-12 11:49:31 +02:00
Anderson Lizardo
10be885113 android/test-ipc: Fix crash due to invalid ipc_register() parameter
This test checks for proper handling of invalid Service ID on a IPC
message, but it was attempting to register handlers for this invalid ID,
which on current ipc_register() implementation was causing a buffer
overrun.

The fix was to use a valid ID during registration, but still attempt to
use an invalid one when sending the message.
2014-02-12 11:26:56 +02:00
Anderson Lizardo
e6c0fa067b android/client: Fix set_info command
Although this command is not implemented by BlueZ, make sure it is
callable from haltest so at least the IPC can be tested.

Also memset() the hid_info parameter to not pass uninitialized data
around.
2014-02-12 11:26:56 +02:00
Anderson Lizardo
cdbede8514 android/hidhost: Trivial coding style fix
Fix two lines over 80 columns.
2014-02-12 11:26:56 +02:00
Anderson Lizardo
03a24ae461 android/tester: Update SDP PDU after UUID change
Now it is expected to receive a 16-bit UUID for PNP_INFO.
2014-02-12 11:26:56 +02:00
Anderson Lizardo
9b00e93b11 android: Use 16-bit UUID for SDP search
These UUIDs are assigned by BT-SIG and therefore there is no need to
use full 128-bit UUIDs. This also avoids unnecessary conversion from
string representation.
2014-02-12 11:26:56 +02:00
Marcel Holtmann
cde69653e0 android: Update copyright and license details 2014-02-11 10:42:56 -08:00
Andrzej Kaczmarek
0a38f7f3e5 android/README: Add Valgrind description 2014-02-11 17:31:42 +01:00
Andrzej Kaczmarek
1b7c044dc4 android: Add support for Valgrind in debug variants
This patch allows bluetoothd to be run with Valgrind easily in debug
variants.

For userdebug and eng variants bluetoothd is renamed to bluetoothd-main
and bluetoothd acts a wrapper to launch it either with or without
Valgrind (this is decided by value of persist.sys.bluetooth.valgrind
property).
2014-02-11 17:31:39 +01:00
Szymon Janc
ba4702b208 android/handsfree: Use uint16_t for buffer length in IPC messages
This will match other IPC messages format.
2014-02-10 16:08:50 +01:00
Szymon Janc
5827e1f047 android: Fix Handsfree volume command notification description 2014-02-10 13:38:36 +01:00
Szymon Janc
b79d1f2d39 android/hal-msg: Match handsfree structures to IPC document 2014-02-10 13:38:36 +01:00
Luiz Augusto von Dentz
ea609c0b01 android/avdtp: Fix coding style
Respect 80 columns limit.
2014-02-10 14:08:45 +02:00
Andrei Emeltchenko
00c35d3f1d android/avdtp: Fix passing NULL pointer to memcpy
The patch fixes following clang warning:
...
profiles/audio/avdtp.c:3293:2: warning: Null pointer passed as an
argument to a 'nonnull' parameter
        memcpy(cap->data, data, length);
        ^                 ~~~~
2014-02-10 14:08:45 +02:00
Andrei Emeltchenko
47f6853fa2 android/avdtp: Fix passing NULL pointer to memcpy
send_request can be called as
send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0) with NULL
pointer which is passed to memcpy().
2014-02-10 14:08:45 +02:00
Andrei Emeltchenko
600ad0f6cd android/haltest: Remove unneeded assignment 2014-02-10 14:08:45 +02:00
Szymon Janc
d2e481c322 android/build: Some whitespace fixes 2014-02-10 13:05:45 +01:00
Szymon Janc
6a43401fb7 android/build: Match compiler options used in autotools and Android.mk 2014-02-10 13:05:45 +01:00
Andrzej Kaczmarek
4190ac1223 android/a2dp: Fix audio deregistration
Unregistering a SEP can trigger abort_cfm callback if some device is
connected thus we should free setups list after all endpoints are
unregistered to avoid error in abort_cfm due to non-existing setup.
2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
496dd38b11 android/a2dp: Disconnect headset on IPC failure
In case audio IPC is suddenly disconnected (most likely due to crash of
mediaserver process) we should disconnect headset since it is no longer
associated with valid setup and cannot be used properly.
2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
17b55a1f90 android/hal-audio: Write SBC parameters to logcat 2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
3290badf07 android/hal-audio: Ignore write call when closing
We should not try to neither auto-resume nor write when state is set to
NONE as this is case when we're being closed and it's ok do ignore
write request.
2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
217b2102f1 android/a2dp: Notify audio state on SEP close 2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
4e50a5f7ff android/a2dp: Shutdown AVDTP gracefully
When shutting down AVDTP connection we first abort and wait for stream
to go to idle state before disconnecting signalling channel.
2014-02-10 13:22:56 +02:00
Andrei Emeltchenko
a7032c97ef android/haltest: Close file in case of error 2014-02-07 11:03:08 +01:00
Szymon Janc
7bb2a16843 android/pan: Bring bridge interface down before removing it
Otherwise bridge will be 'in use' and won't be removed.
2014-02-07 11:21:22 +02:00
Szymon Janc
5ab76c6042 android/pan: Pass error in nap_remove_bridge
Don't return EOPNOTSUPP but just pass error from errno.
2014-02-07 11:21:22 +02:00
Szymon Janc
b4fbbb033e android/pan: Use ioctl instead of sysfs for setting forward delay
Using sysfs is causing problems due to filesystem permissions
(bluetoothd is running as bluetooth user) and bluetoothd already has
required capabilities for setting forward delay through ioctl.
2014-02-07 11:21:22 +02:00