Commit Graph

22 Commits

Author SHA1 Message Date
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
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
Luiz Augusto von Dentz
cabb62a161 build: Fix make check
Fix not checking for ENOTSOCK while setting priority.
2014-01-28 15:40:30 -08:00
Luiz Augusto von Dentz
0212a969f6 android/AVDTP: Make stream channel priority 5
This makes channel priority 5 so it has higher priority than regular
traffic but less than signalling channel.
2014-01-29 00:31:59 +01:00
Luiz Augusto von Dentz
6fe28e354d android/AVDTP: Make signalling channel priority 6
This makes signalling priority 6 so it can push commands before the
stream channel, without this the stream channel may be schedule
first and cause the signalling commands to timeout while waiting a slot.
2014-01-29 00:31:59 +01:00
Marcel Holtmann
61fea27878 android: Use full include path for header files 2014-01-25 20:11:19 -08: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
6eba17bf80 android/AVDTP: Fix ignoring endpoint delay reporting
The code was setting TRUE ignoring what the caller set.
2013-12-23 16:29:31 +01:00
Luiz Augusto von Dentz
a40ff5b2e1 android/AVDTP: Remove get_all parameter for get_capability callback
This is not necessary anymore since all delay reporting is now added
automatically whenever supported.
2013-12-23 16:29:31 +01:00
Luiz Augusto von Dentz
b6cc883696 android/AVDTP: Fix rejecting DELAY_REPORT command while in OPEN state
This fixes rejection of DELAY_REPORT command while in OPEN state which
is tested by /TP/SIG/SYN/BV-05-C.
2013-12-23 10:59:44 +02:00
Luiz Augusto von Dentz
f4f6c6026e android/AVDTP: Fix not sending delay reporting capability
If the SEP supports delay reporting and remote device request is GET_ALL
add delay report capability.
2013-12-23 10:59:44 +02:00
Luiz Augusto von Dentz
82c1095423 android/AVDTP: Duplicate fd passed to avdtp_new
This use dup to create a new fd to be used by AVDTP session leaving the
caller free to close the original fd. Note that even if the caller
decides to keep the original fd it will still be notified when
avdtp_shutdown is called since it uses shutdown.
2013-12-20 13:07:53 +02:00
Luiz Augusto von Dentz
9d893d60a9 android/AVDTP: Add avdtp_shutdown
avdtp_shutdown can be used to disconnect closing all existing stream
properly.
2013-12-20 09:26:54 +02:00
Luiz Augusto von Dentz
2621ba911f android/AVDTP: Add avdtp_add_disconnect_cb and avdtp_remove_disconnect_cb
With these functions the user application can detect when the AVDTP has
been disconnected and cleanup properly.
2013-12-20 09:26:54 +02:00
Luiz Augusto von Dentz
24fc2b639e android/AVDTP: Fix not removing start_timer source
It is possible that stream->start_timer can be set on stream_free which
should then should take care of remove it properly otherwise it can
trigger which would very likely cause a crash.

Thanks to Hannu Mallat <hannu.mallat@jolla.com> for reporting it.
2013-12-18 14:53:34 +02:00
Luiz Augusto von Dentz
1ce1db5002 android/AVDTP: Fix not calling callback if GET_CONFIGURATION is rejected
If GET_CONFIGURATION command is rejected and a callback exists it should
be called with the reject error, this fixes test /TP/SIG/SMG/BI-10-C.
2013-12-05 12:36:03 +02:00
Luiz Augusto von Dentz
cb5058cf26 android/AVDTP: Fix not calling callback if GET_CAPABILITIES is rejected
If GET_CAPABILITIES command is rejected and a callback exists it should
be called with the reject error, this fixes test /TP/SIG/SMG/BI-04-C.
2013-12-05 12:36:03 +02:00
Luiz Augusto von Dentz
262e11982b android/AVDTP: Fix not calling callback if DISCOVER is rejected
If DISCOVER command is rejected and a callback exists it should be
called with the reject error, this fixes test /TP/SIG/SMG/BI-01-C
2013-12-05 12:36:03 +02:00
Luiz Augusto von Dentz
21b1bd698b android/AVDTP: Strip dependencies
This strips AVDTP code of any dependency of core and btio to make it
transport agnostic.
2013-11-25 16:50:31 +02:00
Luiz Augusto von Dentz
e40bfde22e android: Add copy of current AVDTP implemention
These files are not added to any makefile on purpose because they still
have external dependencies.
2013-11-25 15:59:28 +02:00