Commit Graph

1204 Commits

Author SHA1 Message Date
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
Ravi kumar Veeramally
ce8bf58e5f android/pan: Fix bnep interface name
Android uses bt-pan static interface in PAN profile. In server role
it uses it as bridge name. But current implementaion passes interface
names like bnep0, bnep1... Android Framework is unaware of this name
and unable to allocate IP address after profile connection setup.
2014-02-07 11:21:22 +02:00
Szymon Janc
375bed1c4d android/pan: Fix unregistering NAP bridge
This fix not removing NAP bridge in case of error or last device
disconnect.
2014-02-07 11:21:22 +02:00
Szymon Janc
29bf1a3aab android/pan: Move functions up to avoid forward declarations 2014-02-07 11:21:22 +02:00
Szymon Janc
800c6b6678 profiles/network: Allow to pass interface name to bnep_new 2014-02-07 11:21:22 +02:00
Szymon Janc
7498648468 android/client-audio: Fix not stopping play thread on write error 2014-02-06 15:08:57 +01:00
Luiz Augusto von Dentz
7af429c001 android/pan: Use g_slist_free_full to free devices list
Calling g_slist_remove within the callback of g_slist_foreach is very
inefficient as it has to iterate in the list twice to figure which
element to remove.
2014-02-06 15:23:50 +02:00
Luiz Augusto von Dentz
1d1fc983e4 android/hidhost: Use g_slist_free_full to free devices list
Calling g_slist_remove within the callback of g_slist_foreach is very
inefficient as it has to iterate twice in the list to figure which
element to remove.
2014-02-06 15:23:00 +02:00
Luiz Augusto von Dentz
939d25f0b0 android/AVRCP: Fix possible invalid read
Like in A2DP case it is not safe to call g_slist_remove within
g_slist_free_full callback.
2014-02-06 14:32:18 +02:00
Luiz Augusto von Dentz
8da3f38086 android/A2DP: Fix invalid read
Invalid read of size 8
   at 0x30EE465A78: g_slice_free_chain_with_offset (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x418209: bt_a2dp_unregister (a2dp.c:1576)
   by 0x4039E6: main (main.c:347)
 Address 0x4f2d248 is 8 bytes inside a block of size 16 free'd
   at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x30EE44EF7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x30EE4655CA: g_slice_free1 (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x30EE465F0C: g_slist_remove (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x41645F: a2dp_device_free (a2dp.c:174)
   by 0x30EE466477: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x30EE46649A: g_slist_free_full (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x418209: bt_a2dp_unregister (a2dp.c:1576)
   by 0x4039E6: main (main.c:347)
2014-02-06 14:00:56 +02:00
Luiz Augusto von Dentz
cbce18be22 audio/AVCTP: Lookup key name from key_map table
The key_map table already contain the key name.
2014-02-05 16:23:42 +02:00
Luiz Augusto von Dentz
b47d64f7a5 audio/AVCTP: Add keys that can be mapped to uinput
This adds the remaining AV/C keys that can be mapped to uinput.
2014-02-05 16:22:22 +02:00
Jakub Tyszkowski
83c7a21fe4 android/client-audio: Add sine generator as fallback
When no audio file path is provided use sine generator.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
5002b8a9b9 android/client-audio: Add init_check
Add calling init check for audio device.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
11bdba6ee4 android/client-audio: Add setting sample rate
Add setting sample rate for output stream.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
0a72877566 android/client-audio: Add set_parameters
Add seting output stream parameters using key=value pairs string
(key1=value1;key2=value2).
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
0fa227bd77 android/client-audio: Add get_parameters for output
Get current parameters for the audio stream.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
9613c04075 android/client-audio: Add getting sample rate
Get current sample rate for output stream.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
5c4241f514 android/client-audio: Add getting audio format
Get current audio format for output stream.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
3fd697c505 android/client-audio: Add get_channels
Get audio channels configuration.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
6f94ee9b6d android/client-audio: Add get_buffer_size for output
Get buffer size for output stream.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
e19841f0d3 android/client-audio: Add get_latency for output
Get output stream latency.
2014-02-05 15:08:24 +01:00
Jakub Tyszkowski
d40b147c2b android/client-audio: Add playback suspend/resume
Add audio stream suspending and resuming.
2014-02-05 15:08:24 +01:00