| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
The util_get/clear_uid functions use int type for bitmap, and are used
e.g. for SEID allocation. However, valid SEIDs are in range 1 to 0x3E
(AVDTP spec v1.3, 8.20.1), and 8*sizeof(int) is often smaller than 0x3E.
The function is also used in src/advertising.c, but an explicit maximum
value is always provided, so growing the bitmap size is safe there.
Use 64-bit bitmap instead, to be able to cover the valid range.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds SPDX License Identifier and removes the license text.
-------------------------------------
License COUNT
-------------------------------------
Apache-2.0 : 80
LGPL-2.1-or-later : 42
GPL-2.0-or-later : 9
License: Apache-2.0
android/bluetoothd-wrapper.c
android/tester-hidhost.c
android/tester-map-client.c
android/hal-audio-aptx.c
android/hal-audio.c
android/hal-handsfree-client.c
android/tester-gatt.c
android/hal-pan.c
android/hal-socket.c
android/tester-hdp.c
android/tester-pan.c
android/tester-avrcp.c
android/hal-a2dp-sink.c
android/hal-gatt.c
android/hal-avrcp.c
android/tester-a2dp.c
android/hal-audio.h
android/hal-bluetooth.c
android/tester-socket.c
android/hal-health.c
android/hal-a2dp.c
android/hal-ipc.c
android/hal-avrcp-ctrl.c
android/hal-sco.c
android/hal-ipc.h
android/tester-main.c
android/hal-audio-sbc.c
android/hal-utils.c
android/hal-map-client.c
android/hal-handsfree.c
android/hal-log.h
android/hal.h
android/hal-utils.h
android/tester-bluetooth.c
android/hal-hidhost.c
android/audio_utils/resampler.h
android/audio_utils/resampler.c
android/system/audio.h
android/hardware/bt_sock.h
android/hardware/bt_gatt_client.h
android/hardware/bt_hh.h
android/hardware/bluetooth.h
android/hardware/hardware.h
android/hardware/bt_hf_client.h
android/hardware/bt_rc.h
android/hardware/bt_hf.h
android/hardware/bt_pan.h
android/hardware/bt_gatt_types.h
android/hardware/hardware.c
android/hardware/audio_effect.h
android/hardware/audio.h
android/hardware/bt_gatt_server.h
android/hardware/bt_gatt.h
android/hardware/bt_hl.h
android/hardware/bt_mce.h
android/hardware/bt_av.h
android/client/if-hh.c
android/client/if-sco.c
android/client/pollhandler.h
android/client/haltest.c
android/client/tabcompletion.c
android/client/if-hf-client.c
android/client/history.h
android/client/if-audio.c
android/client/terminal.h
android/client/if-av.c
android/client/if-main.h
android/client/if-av-sink.c
android/client/terminal.c
android/client/if-mce.c
android/client/if-hf.c
android/client/pollhandler.c
android/client/if-sock.c
android/client/if-rc-ctrl.c
android/client/if-rc.c
android/client/history.c
android/client/if-pan.c
android/client/if-gatt.c
android/client/if-bt.c
android/client/if-hl.c
License: LGPL-2.1-or-later
android/sco.h
android/socket.c
android/tester-main.h
android/hidhost.h
android/map-client.h
android/utils.h
android/hal-msg.h
android/health.h
android/avrcp-lib.c
android/bluetoothd-snoop.c
android/a2dp.c
android/bluetooth.h
android/a2dp-sink.c
android/handsfree-client.c
android/audio-msg.h
android/main.c
android/pan.c
android/ipc-tester.c
android/health.c
android/socket.h
android/handsfree.h
android/avrcp-lib.h
android/a2dp-sink.h
android/system-emulator.c
android/gatt.c
android/avrcp.h
android/pan.h
android/test-ipc.c
android/hidhost.c
android/a2dp.h
android/avrcp.c
android/sco-msg.h
android/bluetooth.c
android/map-client.c
android/handsfree-client.h
android/ipc.c
android/handsfree.c
android/gatt.h
android/ipc.h
android/ipc-common.h
android/compat/wordexp.h
android/cutils/properties.h
License: GPL-2.0-or-later
android/avdtp.h
android/avctp.c
android/avdtptest.c
android/sco.c
android/log.c
android/avdtp.c
android/avctp.h
android/compat/readline/history.h
android/compat/readline/readline.h
|
|
|
|
|
|
| |
And define new macros A2DP_GET_VENDOR_ID(), A2DP_GET_CODEC_ID() and
A2DP_SET_VENDOR_ID_CODEC_ID() for easily filling a2dp_vendor_codec_t
struct.
|
| |
|
|
|
|
|
| |
This removes dead code due to memory allocation with new0 not being
able to fail.
|
|
|
|
| |
AVDTP_Start can contain several Stream Endpoing IDs to be resumed.
|
|
|
|
| |
AVDTP_Suspend can contain several Stream Endpoing IDs to be suspended.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test /TP/SIG/SMG/BV-09-C frees the session after set_configuration is
called causing the following backtrace:
Invalid read of size 8
at 0x412B81: avdtp_sep_set_state (avdtp.c:846)
by 0x413F3F: avdtp_set_configuration_resp (avdtp.c:2515)
by 0x413F3F: avdtp_parse_resp (avdtp.c:2656)
by 0x4159B7: session_cb (avdtp.c:2057)
by 0x4E7E7FA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4E7EB97: ??? (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4E7EEC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4189D1: tester_run (tester.c:831)
by 0x40C8C7: main (test-avdtp.c:1392)
Address 0x58572b8 is 8 bytes inside a block of size 64 free'd
at 0x4C2ACE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x4E8450E: g_free (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4164B8: avdtp_unregister_sep (avdtp.c:3417)
by 0x40CEA5: unregister_sep (test-avdtp.c:123)
by 0x41704F: queue_remove_all (queue.c:387)
by 0x4170B4: queue_destroy (queue.c:76)
by 0x40CE54: destroy_context (test-avdtp.c:133)
by 0x40CE54: context_quit (test-avdtp.c:145)
by 0x40E74F: sep_setconf_cfm (test-avdtp.c:417)
by 0x413F27: avdtp_set_configuration_resp (avdtp.c:2512)
by 0x413F27: avdtp_parse_resp (avdtp.c:2656)
by 0x4159B7: session_cb (avdtp.c:2057)
by 0x4E7E7FA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4E7EB97: ??? (in /usr/lib64/libglib-2.0.so.0.4200.2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test /TP/SIG/SMG/BI-19-C was causing the following backtrace:
Invalid write of size 4
at 0x415653: avdtp_parse_rej (avdtp.c:2801)
by 0x415653: session_cb (avdtp.c:2067)
by 0x4E7E7FA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4E7EB97: ??? (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4E7EEC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4189D1: tester_run (tester.c:831)
by 0x40C8C7: main (test-avdtp.c:1392)
Address 0x5c75b60 is 96 bytes inside a block of size 104 free'd
at 0x4C2ACE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x4E8450E: g_free (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4101F0: stream_free (avdtp.c:697)
by 0x4E9C7FC: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4E9C81A: g_slist_free_full (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4106FF: avdtp_free (avdtp.c:974)
by 0x4106FF: avdtp_unref (avdtp.c:1042)
by 0x40CE18: destroy_context (test-avdtp.c:130)
by 0x40CE18: context_quit (test-avdtp.c:145)
by 0x40E38F: sep_start_cfm (test-avdtp.c:481)
by 0x415652: avdtp_parse_rej (avdtp.c:2799)
by 0x415652: session_cb (avdtp.c:2067)
by 0x4E7E7FA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4E7EB97: ??? (in /usr/lib64/libglib-2.0.so.0.4200.2)
by 0x4E7EEC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.2)
|
|
|
|
|
| |
This make sure that while processing a PDU the session callbacks are
not able to destroy the session causing crashes.
|
| |
|
|
|
|
| |
struct avdtp_server is no longer needed.
|
| |
|
|
|
|
|
|
| |
In order to deduplicate similar code in android/ and profiles/ we need
to handle local SEP queue outside of avdtp.c. GSList is transformed to
queue.
|
|
|
|
| |
Add seid check fixing registering too many SEPs
|
|
|
|
|
|
|
|
|
| |
Fixes SEID generation for avdtp. Currently SEIDs were assigned assuming
that SEID are registered and unregistered in the same order like:
seid = g_slist_length(seps) + 1
which makes it possible to reuse similar SEIDs. Note that helper
function allows maximum id of sizeof(int) * 8 which is smaller then
MAX_SEID but more then enough for local SEPs.
|
|
|
|
| |
As described in coding style M10.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Last reference to session may be dropped while calling connection_lost
so move watch ID clean before that.
external/bluetooth/bluez/android/avdtp.c:session_cb()
external/bluetooth/bluez/android/avdtp.c:avdtp_parse_resp() CLOSE
request succeeded
external/bluetooth/bluez/android/avdtp.c:avdtp_sep_set_state() stream
state changed: OPEN -> CLOSING
external/bluetooth/bluez/android/a2dp.c:sep_close_cfm()
external/bluetooth/bluez/android/avdtp.c:avdtp_sep_set_state() stream
state changed: CLOSING -> IDLE
external/bluetooth/bluez/android/avdtp.c:session_cb()
external/bluetooth/bluez/android/avdtp.c:connection_lost()
Disconnected: I/O error (5)
external/bluetooth/bluez/android/avdtp.c:avdtp_ref() 0x4a27fc8: ref=2
external/bluetooth/bluez/android/a2dp.c:bt_a2dp_notify_state() device
00:1E:DE:21:85:6A state 0
external/bluetooth/bluez/android/avrcp.c:bt_avrcp_disconnect()
external/bluetooth/bluez/android/avctp.c:avctp_shutdown() AVCTP:
closing uinput
external/bluetooth/bluez/android/avrcp.c:disconnect_cb()
external/bluetooth/bluez/android/avdtp.c:avdtp_unref() 0x4a27fc8: ref=1
external/bluetooth/bluez/android/avdtp.c:avdtp_unref() 0x4a27fc8: ref=0
external/bluetooth/bluez/android/avdtp.c:avdtp_free() 0x4a27fc8
==1225== Invalid write of size 4
==1225== at 0x11ABDE: session_cb (avdtp.c:2084)
==1225== by 0x48BD9C7: g_io_unix_dispatch (giounix.c:166)
==1225== by 0x48C2CCB: g_main_context_dispatch (gmain.c:2539)
==1225== by 0x48C2ED9: g_main_context_iterate.isra.19 (gmain.c:3146)
==1225== by 0x48C3167: g_main_loop_run (gmain.c:3340)
==1225== by 0x10D379: main (main.c:628)
==1225== Address 0x4a27fdc is 20 bytes inside a block of size 1,104 free'd
==1225== at 0x4897E6C: free (in /system/lib/valgrind/
vgpreload_memcheck-arm-linux.so)
==1225== by 0x48C5E2B: g_free (gmem.c:252)
==1225== by 0x11ABDB: session_cb (avdtp.c:2082)
==1225== by 0x48BD9C7: g_io_unix_dispatch (giounix.c:166)
==1225== by 0x48C2CCB: g_main_context_dispatch (gmain.c:2539)
==1225== by 0x48C2ED9: g_main_context_iterate.isra.19 (gmain.c:3146)
==1225== by 0x48C3167: g_main_loop_run (gmain.c:3340)
==1225== by 0x10D379: main (main.c:628)
==1225==
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
| |
This patch is a fix for PTS TC_SRC_REL_BV_01_I
PTS expects us to CLOSE stream not to ABORT the stream when
disconnecting A2DP.
|
|
|
|
|
| |
With this patch avdtp_close does avdtp_abort under the hood in case
stream is not yet in OPEN state.
|
|
|
|
|
|
|
|
|
|
|
| |
When matching remote SEP to local SEP we do not match vendor codecs
properly, i.e. neither vendor ID not codec ID are checked, which may
cause wrong endpoint to be selected in case there are more that one
endpoints using vendor codec on remote.
This patch fixes this by assinging vendor codec indentification to
local SEP after it's registered and uses this information when matching
SEPs.
|
|
|
|
|
| |
Use common style for multi-line comments consistent with rest of
codebase.
|
|
|
|
| |
Fix whitespace problems and not needed empty lines.
|
|
|
|
|
| |
Discover callback is only set when avdtp_discover was successful so we
need to check if it's set before calling.
|
|
|
|
| |
Respect 80 columns limit.
|
|
|
|
|
|
|
|
|
| |
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);
^ ~~~~
|
|
|
|
|
|
| |
send_request can be called as
send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0) with NULL
pointer which is passed to memcpy().
|
|
|
|
|
| |
When shutting down AVDTP connection we first abort and wait for stream
to go to idle state before disconnecting signalling channel.
|
|
|
|
| |
Fix not checking for ENOTSOCK while setting priority.
|
|
|
|
|
| |
This makes channel priority 5 so it has higher priority than regular
traffic but less than signalling channel.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
| |
The code was setting TRUE ignoring what the caller set.
|
|
|
|
|
| |
This is not necessary anymore since all delay reporting is now added
automatically whenever supported.
|
|
|
|
|
| |
This fixes rejection of DELAY_REPORT command while in OPEN state which
is tested by /TP/SIG/SYN/BV-05-C.
|
|
|
|
|
| |
If the SEP supports delay reporting and remote device request is GET_ALL
add delay report capability.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
avdtp_shutdown can be used to disconnect closing all existing stream
properly.
|
|
|
|
|
| |
With these functions the user application can detect when the AVDTP has
been disconnected and cleanup properly.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This strips AVDTP code of any dependency of core and btio to make it
transport agnostic.
|
|
These files are not added to any makefile on purpose because they still
have external dependencies.
|