Commit Graph

936 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
484fba7019 android/A2DP: Fix selecting invalid bitpool range for SBC
For SBC bitpool range may not strictly match with presets so it needs to
be adjusted to fit within remote capabilities otherwise the remote device
may reject the configuration.
2014-01-16 16:01:40 +02:00
Luiz Augusto von Dentz
1a8dba380c android/A2DP: Change to connected state when a transport open
This changes the connected state to be only sent once a transport is
open, before this was done right after the signalling was connected but
this reflect in the audio HAL side attempting to open a stream while
with possible no transport available.
2014-01-16 16:01:40 +02:00
Szymon Janc
944a282821 android: Fix distcheck build
Add missing monitor/rfcomm.h to android-tester sources. This fix
following build error on make distcheck:

  CC       emulator/android_android_tester-bthost.o
../emulator/bthost.c:40:28: fatal error: monitor/rfcomm.h: No such
    file or directory
 #include "monitor/rfcomm.h"
2014-01-16 12:32:10 +01:00
Jakub Tyszkowski
1d6fbfb1da android/pics: Add PICS and PIXIT for AVCTP
Add PICS/PIXIT for AVCTP, targeting Android 4.4.
2014-01-16 09:04:41 +01:00
Andrzej Kaczmarek
c838bfcbb9 android/a2dp: Fix memory leak
audio_ipc_send_rsp_full() does not free buffer passed as parameter
thus it should be freed by caller.

This fixes following Valgrind report:

==1238== 5 bytes in 1 blocks are definitely lost in loss record 22 of 54
==1238==    at 0x4896DC8: calloc (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so)
==1238==    by 0x48C5DB7: g_malloc0 (gmem.c:189)
==1238==    by 0x1150EF: bt_stream_open (a2dp.c:1177)
==1238==    by 0x1116A7: ipc_handle_msg (ipc.c:95)
==1238==    by 0x111C11: audio_watch_cb (audio-ipc.c:66)
==1238==    by 0x48BD9C7: g_io_unix_dispatch (giounix.c:166)
==1238==    by 0x48C2CCB: g_main_context_dispatch (gmain.c:2539)
==1238==    by 0x48C2ED9: g_main_context_iterate.isra.19 (gmain.c:3146)
==1238==    by 0x48C3167: g_main_loop_run (gmain.c:3340)
==1238==    by 0x10B207: main (main.c:436)
2014-01-16 08:59:31 +01:00
Andrzej Kaczmarek
6bbd5c1736 android/a2dp: Fix memory leak
avdtp_service_cap_new() makes own copy of data stored in "codec" thus
it should be freed by caller.

This fixes following Valgrind report:

==1238== 6 bytes in 1 blocks are definitely lost in loss record 27 of 54
==1238==    at 0x4896DC8: calloc (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so)
==1238==    by 0x48C5DB7: g_malloc0 (gmem.c:189)
==1238==    by 0x115B4B: discover_cb (a2dp.c:303)
==1238==    by 0x111DE7: finalize_discovery (avdtp.c:933)
==1238==    by 0x114441: session_cb (avdtp.c:2556)
==1238==    by 0x48BD9C7: g_io_unix_dispatch (giounix.c:166)
==1238==    by 0x48C2CCB: g_main_context_dispatch (gmain.c:2539)
==1238==    by 0x48C2ED9: g_main_context_iterate.isra.19 (gmain.c:3146)
==1238==    by 0x48C3167: g_main_loop_run (gmain.c:3340)
==1238==    by 0x10B207: main (main.c:436)
2014-01-16 08:59:31 +01:00
Andrzej Kaczmarek
1ff2c28807 android: Add simple rotation of snoop file
Already existing snoop file is renamed by adding ".old" suffix before
new one is created. This is useful in case phone is restarted so logs
are not overwritten and for this reason it's only applied in case
default snoop file name is used.
2014-01-16 08:59:31 +01:00
Andrzej Kaczmarek
e76815ac82 android: Fix typo in bluetoothd-snoop.c 2014-01-16 08:59:31 +01:00
Grzegorz Kolodziejczyk
0b10840450 android/tester: Add set device DISCTIMEOUT prop fail test case
This adds set device DISCOVERY TIMEOUT property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
c04a915086 android/tester: Add set device BONDED_DEV prop fail test case
This adds set device BONDED DEVICES property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
22b4fe5ba3 android/tester: Add set device SCAN_MODE prop fail test case
This adds set device SCAN MODE property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
9a53dcd009 android/tester: Add set device SERVICE_RECORD prop fail test case
This adds set device SERVICE RECORD property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
e31e1fd972 android/tester: Add set device BDADDR prop fail test case
This adds set device BDADDR property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
108c88e4e0 android/tester: Add set device TIMESTAMP prop fail test case
This adds set device TIMESTAMP property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
54601890e6 android/tester: Add set device RSSI prop fail test case
This adds set device RSSI property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
fb0d8bb9a5 android/tester: Add set device TOD prop fail test case
This adds set device TYPE OF DEVICE property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
dddaa9451c android/tester: Add set device COD prop fail test case
This adds set device CLASS OF DEVICE property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
cb1b9f0bf0 android/tester: Add set device UUIDS prop fail test case
This adds set device UUIDS property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
85ebf5278d android/tester: Add set device BDNAME prop fail test case
This adds set device BDNAME property fail test case.
2014-01-15 14:22:34 +01:00
Grzegorz Kolodziejczyk
436d497f29 android/tester: Add set device FRIENDLY_NAME prop success test case
This adds set device FRIENDLY NAME property success test case.
2014-01-15 14:22:34 +01:00
Luiz Augusto von Dentz
0a6f949ff6 android/A2DP: Connect transport channel when initiator
This connects transport channel when initiator of open request.
2014-01-15 14:52:44 +02:00
Luiz Augusto von Dentz
c6fed41a02 android/A2DP: Add handling of incoming transport connection
This adds handling of incoming transport connection attempt.
2014-01-15 14:52:44 +02:00
Andrzej Kaczmarek
e21b24d825 android/a2dp: Fix freeing preset on SEP close
In case SEP was opened from local side, corresponding a2dp_setup
structure has just reference to a2dp_preset which is stored on presets
list. As a result, when closing SEP such preset will be freed leaving
dangling pointer on presets list.
2014-01-15 11:32:51 +02:00
Andrzej Kaczmarek
63ffbe33a5 android/a2dp: Fix IPC response length calculation
struct audio_rsp_open_stream has only zero-length array member thus its
size equals to 0. We need to explicitly specify size of array element
type here.
2014-01-15 11:10:13 +02:00
Marcel Holtmann
e41b156cae android: Actually btmon does not need GLib includes 2014-01-14 20:40:29 -08:00
Marcel Holtmann
5b1724b1ae android: Fix typo in referenced source file 2014-01-14 20:37:13 -08:00
Marcel Holtmann
79700f68d4 android: Include btproxy utility in distribution 2014-01-14 20:31:55 -08:00
Marcel Holtmann
3cccbe0549 android: The property_set wrapper is actually written by Intel 2014-01-14 12:35:42 -08:00
Grzegorz Kolodziejczyk
9ccd058b71 android/tester: Add get device FRIENDLY_NAME prop fail test case
This adds device FRIENDLY NAME property fail test case.
2014-01-14 19:31:00 +01:00
Grzegorz Kolodziejczyk
9d18cce59e android/tester: Add get device VERINFO property fail test case
This adds device VERSION INFO property fail test case.
2014-01-14 19:31:00 +01:00
Grzegorz Kolodziejczyk
7675a308cb android/tester: Add get device DISCTIMEOUT prop fail test case
This adds device DISCOVERY TIMEOUT property fail test case.
2014-01-14 19:31:00 +01:00
Grzegorz Kolodziejczyk
739dfcaa86 android/tester: Add get device BONDED_DEV property fail test case
This adds device BONDED DEVICES property fail test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
d69ac36ae7 android/tester: Add get device SCAN_MODE property fail test case
This adds device SCAN MODE property fail test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
8b2a398f5f android/tester: Add get device SERVREC property fail test case
This adds device SERVICE RECORD property fail test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
6dbd4d7a63 android/tester: Add get device BDADDR property fail test case
This adds device BDADDR property fail test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
aea28763f3 android/tester: Add get device TIMESTAMP prop success test case
This adds device TIMESTAMP property success test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
9019405d76 android/tester: Add get device RSSI property success test case
This adds device RSSI property success test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
a129b4ed94 android/tester: Add get device TOD property success test case
This adds device TOD property success test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
1b95da7678 android/tester: Add get device COD property success test case
This adds device COD property success test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
f67ba852ae android/tester: Add get device UUIDS property success test case
This adds device UUIDS property success test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
d81c0f3f57 android/tester: Add get device BDNAME property success test case
This adds device BDNAME property success test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
9e093223c1 android/tester: Add get device properties success test case
This adds device properties success test case.
2014-01-14 19:30:59 +01:00
Grzegorz Kolodziejczyk
9f5ccde335 android/tester: Fix for asynchronous test case condition check
This patch fixes checking the state of test case. Due to asynchronous of
callbacks during state check of every single condition, state can be
checked double time by callback condition check with pass status already
set in meantime. Now state is kept as one decremented int.
To pass it must be equal zero and cannot be checked set again.
2014-01-14 19:30:51 +01:00
Szymon Janc
97ee2aa4b9 android: Fix host build if libcap headers are not present 2014-01-14 13:26:46 +01:00
Szymon Janc
8622810347 android: Remove support for old Android versions
This removes compatibility with Android 4.3 and older. Android 4.4 is
current target. Due to bug in Audio HAL in 4.2 build was failing on
that version anyway.
2014-01-14 12:57:18 +01:00
Szymon Janc
988bfaeac2 android/README: Update documentation with AOSP 4.4
This includes:
 - sample repository to AOSP 4.4 based repository with support for
   Nexus 4 and Nexus 7 2013 devices.
 - adds info about snoop service
 - other random additions
2014-01-14 13:26:24 +02:00
Luiz Augusto von Dentz
5903b4f510 android/AVDTP: Fix invalid free of struct discover
If callback releases the last reference it can cause the following:
Invalid free() / delete / delete[] / realloc()
   at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x386244EF7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x410356: finalize_discovery (avdtp.c:933)
   by 0x414462: session_cb (avdtp.c:2555)
   by 0x38624492A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x3862449627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x3862449A39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x403A95: main (main.c:439)
 Address 0x4cf7af0 is 0 bytes inside a block of size 24 free'd
   at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x386244EF7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x410356: finalize_discovery (avdtp.c:933)
   by 0x4110BC: avdtp_unref (avdtp.c:1026)
   by 0x416491: a2dp_device_free (a2dp.c:122)
   by 0x4165DF: bt_a2dp_notify_state (a2dp.c:166)
   by 0x417170: discover_cb (a2dp.c:333)
   by 0x41034E: finalize_discovery (avdtp.c:931)
   by 0x414462: session_cb (avdtp.c:2555)
   by 0x38624492A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x3862449627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x3862449A39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
2014-01-14 11:53:00 +01:00
Luiz Augusto von Dentz
d2ba4c96ac audio/A2DP: Add implemention of SEP abort confirmation 2014-01-14 11:53:00 +01:00
Luiz Augusto von Dentz
b0b5ef76f8 audio/A2DP: Add implemention of SEP close confirmation 2014-01-14 11:53:00 +01:00
Luiz Augusto von Dentz
f0552102b4 audio/A2DP: Add implemention of SEP suspend confirmation 2014-01-14 11:52:59 +01:00