Commit Graph

1178 Commits

Author SHA1 Message Date
Ravi kumar Veeramally
16b7f0c59e android/tester: Add HIDhost SetProtocol test 2014-01-20 16:23:38 +01:00
Ravi kumar Veeramally
d4b09ba697 android/tester: Add HIDhost GetProtocol test 2014-01-20 16:23:38 +01:00
Ravi kumar Veeramally
8c147bec42 android/tester: Add HIDhost VirtualUnplug test 2014-01-20 16:23:38 +01:00
Ravi kumar Veeramally
8101318fe2 android/tester: Add HIDhost Disconnect test 2014-01-20 16:23:38 +01:00
Ravi kumar Veeramally
3e41780447 android/tester: Add HIDhost Connect test
Emulated HID SDP and L2CAP Control and Interrupt channels.
2014-01-20 16:23:38 +01:00
Ravi kumar Veeramally
a2d6586eff android/hidhost: Remove unnecessary check
HID device will return unsupported or invalid response for unsupported
or invalid get/set protocol request. Need not to check prior to that.
2014-01-20 16:23:38 +01:00
Ravi kumar Veeramally
3abb6d368d android/hidhost: Fix connection state notification on profile unregister
Issue found while writing end2end tests. Usually profile unregister is
called when final cleanup of bluetoothd. Freeing connected hid devices
through g_slist_foreach is a asynchronous call. Profile is cleaned up
and and ipc also complete cleanup. But free_hid_devices tries to notify
hal which doesn't exist that time. So behaviour is unexpected.
2014-01-20 16:23:06 +01:00
Johan Hedberg
fb922ee610 emulator/bthost: Add SMP support 2014-01-20 16:26:33 +02:00
Szymon Janc
cada0c0896 core: Add flags parameter to bt_search_service
This allows to pass custom SDP flags to sdp_connect.
2014-01-20 15:19:25 +02:00
Jakub Tyszkowski
65e8e6ba32 android/pts: Add PTS test results document for AVCTP
This will allow for better tracking of current state of implementation.
2014-01-20 13:31:19 +01:00
Jakub Tyszkowski
bdfac94fcf android/pts: Add PTS test results document for AVRCP
This will allow for better tracking of current state of implementation.
2014-01-20 13:31:18 +01:00
Jakub Tyszkowski
24062f87e1 android/pts: Add PTS test results document for A2DP
This will allow for better tracking of current state of implementation.
2014-01-20 13:31:18 +01:00
Jakub Tyszkowski
5d6a183585 android/pan: Initialize GError with NULL
This patch fixes the following issue:

bluetoothd[10552]: android/pan.c:register_nap_server()
bluetoothd[10552]: android/pan.c:nap_create_bridge() bnep
(bluetoothd:10552): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
The overwriting error message was: l2cap_bind: Address already in use (98)
bluetoothd[10552]: android/pan.c:destroy_nap_device()
2014-01-20 12:20:12 +02:00
Szymon Janc
a8a9ac51b1 android/tester: Update property name use to start daemon 2014-01-19 20:21:01 +01:00
Szymon Janc
1e0e4dfde2 android/bluetooth: Fix sending device prop change event with no props 2014-01-19 20:21:01 +01:00
Luiz Augusto von Dentz
73f26e34e8 android/A2DP: Notify when audio state change to suspend 2014-01-18 23:32:37 +02:00
Luiz Augusto von Dentz
5ab13f5539 android/A2DP: Notify when audio state change to stopped 2014-01-18 23:32:37 +02:00
Luiz Augusto von Dentz
786f12c057 android/A2DP: Notify when audio state change to started 2014-01-18 23:32:37 +02:00
Luiz Augusto von Dentz
3ab724f7b2 android/hal-msg: Add defines for each audio state 2014-01-18 23:32:37 +02:00
Anderson Lizardo
9f81646b8f android: Fix const to non-const issue on android-tester
According to definition from hardware/bluetooth.h, the "val" field does
not have const modifier.

Fix clang errors like:

android/android-tester.c:760:14: error: initializing 'void *' with an
expression of type 'const char (*)[18]' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
2014-01-18 16:21:42 +01:00
Marcel Holtmann
d715a2ee3c android: Sort the documentation files a little bit 2014-01-17 18:32:58 -08:00
Szymon Janc
a44277dfda android/snoop: Drop capabilities on startup 2014-01-17 20:41:45 +01:00
Szymon Janc
4ae70ba552 android: Change user to bluetooth when starting daemon 2014-01-17 20:41:45 +01:00
Szymon Janc
6fdab888da android: Update README with init.rc updates 2014-01-17 20:41:45 +01:00
Szymon Janc
334c59f993 android/system-emulator: Update property used for start/stop services 2014-01-17 20:41:45 +01:00
Szymon Janc
89008b789f android/hal: Update property used for start/stop services 2014-01-17 20:41:45 +01:00
Szymon Janc
72c77073a4 android: Add sample init.bluetooth.rc file
This file is intended to be included from device init.rc.
2014-01-17 20:41:45 +01:00
Andrzej Kaczmarek
c2dfa92892 android/a2dp: Fix typo in condition 2014-01-16 17:50:32 +02:00
Szymon Janc
73613fe026 android/bluetooth: Fix discovering new devices
Device found events should be send also for known devices if this is
new discovery session. Otherwise Android will ignore those devices.
2014-01-16 15:46:41 +01:00
Andrzej Kaczmarek
b6659c9c7c android/hal-audio: Implement set_parameters for device 2014-01-16 16:01:41 +02:00
Andrzej Kaczmarek
8b845a3f09 android/hal-audio: Fix AudioFlinger crash
We need to return some valid values for buffer size and latency so
AudioFlinger does not crash. For now just use some dummy values until
codec implementation is in place.
2014-01-16 16:01:41 +02:00
Andrzej Kaczmarek
7efff0013a android/hal-audio: Fix module loading 2014-01-16 16:01:41 +02:00
Andrzej Kaczmarek
51ca1c6c92 android/hal-audio: Handle audio preset from stream
This patch adds handling of audio preset received after stream is
opened. Preset is used to initialize codec and then to set input
configuration so audio subsystem can write data in a format that
codec can handle later.
2014-01-16 16:01:41 +02:00
Andrzej Kaczmarek
068c5e3f81 android/hal-audio: Add support to suspend output stream
This patch adds support to suspend output stream via Audio IPC.
>From HAL perspective stream can be either in standby or suspended -
the former is default one and can be auto-resumed on write while the
latter cannot be resumed only after explicitly going into standby
on audio code request.
2014-01-16 16:01:41 +02:00
Andrzej Kaczmarek
eb2c8e6ac8 android/hal-audio: Add support to resume output stream
This patch adds support to resume output stream via Audio IPC.
Stream is automatically resumed on first write when stream is in
standby state.
2014-01-16 16:01:41 +02:00
Andrzej Kaczmarek
454371df80 android/hal-audio: Add support to close output stream 2014-01-16 16:01:40 +02:00
Andrzej Kaczmarek
ddc558fbe9 android/hal-audio: Add support to open output stream
This patch adds support to open output stream via Audio IPC.
Since only SBC is supported, we always try to open stream for first
endpoint only which is enough.
2014-01-16 16:01:40 +02:00
Andrzej Kaczmarek
141bbc0232 android/hal-audio: Add support to unregister audio endpoints 2014-01-16 16:01:40 +02:00
Andrzej Kaczmarek
87353f527e android/hal-audio: Add support to register audio endpoints
This patch adds support to register audio enpoints via Audio IPC.
Endpoints are registered based on predefined codecs table and for
each defined codec one endpoint is registered. By default, only
SBC will be supported.
2014-01-16 16:01:40 +02:00
Lukasz Rymanowski
987fae9513 android/hal-audio: Add audio_ipc_cmd
Add function to handle send/receive on audio_sk.
2014-01-16 16:01:40 +02:00
Luiz Augusto von Dentz
b270a8cbd2 android/A2DP: Add timeout to setup stream if remote becomes idle
If remote initiate the connection but do not setup any stream take over
the role and initiate the stream setup procedure.
2014-01-16 16:01:40 +02:00
Luiz Augusto von Dentz
b4d7dd4351 android/A2DP: Send stream fd in open stream response
This adds support of sending stream fd within open stream response.
2014-01-16 16:01:40 +02:00
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
Luiz Augusto von Dentz
85dfe54a9e audio/A2DP: Add implemention of SEP start confirmation 2014-01-14 11:52:59 +01:00
Luiz Augusto von Dentz
a7e6f93477 audio/A2DP: Add implemention of SEP open confirmation 2014-01-14 11:52:59 +01:00
Luiz Augusto von Dentz
54ed16806e audio/A2DP: Add implemention of SEP set_configuration confirmation 2014-01-14 11:52:59 +01:00
Luiz Augusto von Dentz
cce40aefe2 android/A2DP: Discover endpoints when initiator 2014-01-14 11:52:59 +01:00
Luiz Augusto von Dentz
38305eb3a9 audio/A2DP: Add implemention of SEP suspend indication 2014-01-14 11:52:59 +01:00
Luiz Augusto von Dentz
18f5cab60b audio/A2DP: Add implemention of SEP start indication 2014-01-14 11:52:59 +01:00
Luiz Augusto von Dentz
4ae4b66c99 audio/A2DP: Add implemention of SEP close indication 2014-01-14 11:52:59 +01:00
Luiz Augusto von Dentz
7f2f807a69 audio/A2DP: Add implemention of SEP open indication 2014-01-14 11:52:59 +01:00
Andrzej Kaczmarek
2ea6eff01a android/a2dp: Fix buffer size calculation for codec caps 2014-01-13 15:10:28 +02:00
Luiz Augusto von Dentz
4830daffa2 audio/A2DP: Add implemention of audio Suspend Stream command 2014-01-13 14:33:16 +02:00
Luiz Augusto von Dentz
712aae3add audio/A2DP: Add implemention of audio Resume Stream command 2014-01-13 14:33:16 +02:00
Luiz Augusto von Dentz
31993b0a0e audio/A2DP: Add implemention of audio Close Stream command 2014-01-13 14:33:16 +02:00
Luiz Augusto von Dentz
a385cf8295 audio/A2DP: Add implemention of audio Open Stream command 2014-01-13 14:33:16 +02:00
Luiz Augusto von Dentz
48449b6632 audio/A2DP: Add implemention of audio Close command 2014-01-13 14:33:16 +02:00
Luiz Augusto von Dentz
bb36b8aa44 audio/A2DP: Add implemention of audio Open command 2014-01-13 14:33:16 +02:00
Jakub Tyszkowski
28429dcd1e android/pics: Add PICS and PIXIT for A2DP
Add PICS/PIXIT for A2DP targeting Android 4.4.
2014-01-13 11:04:26 +01:00
Jakub Tyszkowski
4a88ffb177 android/pics: Add PICS and PIXIT for AVRCP
Add PICS/PIXIT for AVRCP targeting Android 4.4.
2014-01-13 11:04:26 +01:00
Szymon Janc
cd8e325779 android/pan: Generate file path in compile time
This reduce need of using snprintf function and removes need of manual
buffer size calculation.
2014-01-13 10:21:18 +01:00
Marcin Kraglak
9f4ce6e0a5 android-tester: Add possibility to debug mgmt
Print mgmt debug info if debug flag is set in android-tester.
2014-01-13 10:44:45 +02:00
Jakub Tyszkowski
dcb7f311db android/pts: Update PTS results for MAP
Update MAP PTS results for BlueZ stack on Nexus4 (Android 4.4.2).
2014-01-13 10:40:36 +02:00
Andrzej Kaczmarek
bee4fe3c78 android/ipc: Use proper handlers in ipc_handle_msg
ipc_handle_msg() should use handlers passed as function parameter
instead of static one as otherwise Audio IPC will use incorrect
handlers.
2014-01-13 08:57:49 +01:00
Andrzej Kaczmarek
84a8ca8d81 android/ipc: Fix arguments order in DBG 2014-01-13 08:57:49 +01:00
Szymon Janc
da6f8e532c android/bluetooth: Fix compare function when finding devices
Elements on list are struct device not bdaddr_t so make comparing
function use proper types. This was working so far only due to
bdaddr_t being first element in struct device.
2014-01-12 20:43:15 +01:00
Szymon Janc
9b174ddfe2 android/bluetooth: Use helper for finding device 2014-01-12 20:43:07 +01:00
Marcel Holtmann
ce2ecab244 android: Change BREDR into BR/EDR for test case descriptions 2014-01-11 20:19:04 -08:00
Szymon Janc
d45c6df386 android/tester: Update bluetooth tests with DONE status 2014-01-11 17:15:41 +01:00
Szymon Janc
c31615b82b android/bluetooth: Log error for any non-success code
Returning non-SUCCESS code in command reply is considered error and
that includes DONE status.
2014-01-11 17:15:41 +01:00
Szymon Janc
86905a8968 android/bluetooth: Rename labels from failed to reply
This name match better and avoid confusion when setting status to
SUCCESS and then jumping to failed label.
2014-01-11 17:15:41 +01:00
Szymon Janc
b4dac30570 android/bluetooth: Use HAL_STATUS_SUCCESS instead of _DONE in replies
JNI code in Android is mapping returned code to boolean value. Only
SUCCESS status is mapped to true and that value is returned to Java
code. This could result in faultyly triggering error path in Java
when returning DONE in command reply.
2014-01-11 17:15:41 +01:00
Luiz Augusto von Dentz
96375e8ad2 android/audio-msg: Simplify audio_rsp_open_stream
Reuse audio_preset in audio_rsp_open_stream since the data type is the
same.
2014-01-11 11:24:31 +02:00
Marcel Holtmann
883486009f android: Use LinkKeyPinLength instead of LinkKeyPINLength 2014-01-11 01:14:28 -08:00
Marcel Holtmann
93d858bcd2 android: Enable secure connections if supported 2014-01-11 01:13:46 -08:00
Luiz Augusto von Dentz
5e0582451a android: Fix not using AM_CFLAGS in the HAL modules
Both bluetooth.audio.so and audio.a2dp.default.so should use AM_CFLAGS
ortherwise some quite obvious errors that otherwise would break the
build may be pushed upstream.
2014-01-10 17:45:17 +02:00
Lukasz Rymanowski
518f1bdb15 android/audio: Add audio_ipc_cleanup function 2014-01-10 17:45:17 +02:00
Lukasz Rymanowski
7560d1cd76 android/audio: Refactor create_audio_ipc
This patch adds creating listening audio ipc socket in AudioFlinger
context on audio_open() and moves accepting connection to ipc_th.
2014-01-10 17:45:17 +02:00
Lukasz Rymanowski
d0df2eddd0 android: Fix error check from pthread_create
pthread_create() returns 0 on success or errno code which is non negative
number
2014-01-10 17:45:17 +02:00
Lukasz Rymanowski
3ef04d3093 android/audio: Prefix error log with "audio" 2014-01-10 17:45:17 +02:00
Grzegorz Kolodziejczyk
af1744db66 android/tester: Multi property check for test case
This patch allows to check multiple properties for test case. Properties
can be prioritized to allow check if they'll come in right order. Now
properties aren't treated as a "single" callback. In future in one
callback multiple properties can come.
2014-01-10 16:20:05 +01:00
Ravi kumar Veeramally
78d1f1391e android/pan: Remove connected PAN devices on profile unregister call 2014-01-10 16:09:55 +01:00
Ravi kumar Veeramally
7f445ac7d5 android/pan: Implement PAN enable HAL api at daemon side 2014-01-10 16:09:55 +01:00
Ravi kumar Veeramally
423f637179 android/pan: Listen for incoming connections and accept in NAP role
Listen for incoming connections and accept it. Create bnep interface
add it to bridge and notify control and connection state information
through HAL. Remove the device on disconnect request. If android
settings UI does not have bluetooth tethering enabled it immediately
sends disconnect signal.
2014-01-10 16:09:55 +01:00
Ravi kumar Veeramally
a89e3dbdb9 android/pan: Register Network Access Point
Register NAP server and adds bnep bridge. Removes bridge
on destroy call. Bridge mechanism is needed when device acting
as a server and listen for incoming connections.
2014-01-10 16:09:55 +01:00
Luiz Augusto von Dentz
ea873d1a6a android/haltest: Add support for loading Audio HAL
This makes audio.a2dp.default.so to be loaded by haltest.
2014-01-10 15:37:46 +02:00
Luiz Augusto von Dentz
48a962ec6d android: Load bluetooth.default.so as a module
This makes haltest and android-tester to load bluetooth.default.so
instead of linking directly to it.
2014-01-10 15:07:23 +02:00
Luiz Augusto von Dentz
dd0d7e7559 android: Convert libhal-internal to a plugin
This convert the static library libhal-internal.la to
bluetooth.default.la when building with autotools.
2014-01-10 14:05:55 +02:00
Luiz Augusto von Dentz
4cd86000dd android: Convert libaudio-internal to a plugin
This convert the static library libaudio-internal.la to
audio.a2dp.default.so when building with autotools.
2014-01-10 14:05:55 +02:00
Sebastian Chlad
3c0dfcbe4a android/pts: Add PTS test results for L2CAP 2014-01-10 13:01:10 +01:00
Szymon Janc
d51dce6e81 android/tester: Adjust get adapter class test value
Currently CoD is hardcoded so just adjust test value for now.
2014-01-09 20:08:45 +01:00
Grzegorz Kolodziejczyk
69cf70af52 android/tester: Add test case state handling
This patch make test state handling more stable by avoiding errors like
i.e. double free of memory in teardown phase. Double state set is
undesirable for test case and may cause errors. Now after every
condition change, test state is checked if it can set test state to pass.
In some places of test fail, returns are added to avoid furhter code
execution.
2014-01-09 18:39:23 +01:00
Grzegorz Kolodziejczyk
2bc8ca02a0 android/tester: Use common property check function for all test props
This patch makes discovery device found test case to use generic
property check method.
2014-01-09 18:39:16 +01:00
Grzegorz Kolodziejczyk
31b830edb3 android/tester: Remove redundant whitespace 2014-01-09 18:39:11 +01:00
Andrei Emeltchenko
0ffbc7d2c0 android/haltest: Silence static analyzers
This makes code more readable and silence static analyzers which think
that pipe and fd are close two times.
2014-01-09 18:00:50 +01:00
Luiz Augusto von Dentz
da79a4534b android/audio: Fix having declaration before code 2014-01-09 15:25:16 +02:00
Szymon Janc
b6df31f1c8 android/bluetooth: Set major and minor class od device
Currently this is hardcoded to Phone/Smartphone.
2014-01-09 10:30:45 +01:00
Szymon Janc
4c0e55c4df android/bluetooth: Set default adapter name on first start
On first start always set name to default name. Adapter name is
updated on start only if current name is different.
2014-01-09 10:30:45 +01:00
Marcel Holtmann
fbba0f7d5f android: Fix typo in audio plugin file list 2014-01-08 21:33:41 -08:00
Marcel Holtmann
d18e1ad69c shared: Add skeleton for generic IO framework 2014-01-08 19:39:09 -08:00
Marcel Holtmann
eb4d95c560 shared: Use internal queue handling for mgmt interface 2014-01-08 15:01:04 -08:00
Andrzej Kaczmarek
7f5f038626 android: Fix bluetoothd installation path
This patch removes explicit LOCAL_MODULE_PATH definition for bluetoothd
and bluetoothd-snoop modules which caused both binaries to be installed
in /system/xbin instead of /system/bin folder.
2014-01-08 17:55:56 +01:00
Lukasz Rymanowski
a176ce6ce7 android/audio: Add listener thread on the Audio HAL socket
This patch add thread which is reponsible for listen on audio HAL
socket, open a2dp endpoint(s) and maintain socket.
When bluetooth daemon goes down, HAL audio plugin starts to listen on
Audio HAL socket again.
2014-01-08 17:41:14 +02:00
Ravi kumar Veeramally
7f33939401 android-tester: Add HIDHost initial interface setup test 2014-01-08 15:53:34 +01:00
Sebastian Chlad
dc9d935b23 android/pixit: Add PTS version to respective pixit 2014-01-08 15:50:23 +01:00
Lukasz Rymanowski
db1acadfd9 android/audio: Add wrapper struct for struct audio_hw_dev
This patch add wrapping struct for audio_hw_dev too keep additional info
related to a2dp stream.
2014-01-08 16:35:32 +02:00
Sebastian Chlad
2a6fcbc357 android/pics: Update PICS to PTS 5.0
Update PICS settings for HID, L2CAP, OPP, PAN and PBAP
2014-01-08 14:17:09 +01:00
Sebastian Chlad
5361af7d66 android/pics: Update PICS to PTS 5.0 for GAP
Add new PICS settings for the GAP profile in accordance with PTS 5.0
2014-01-08 14:17:09 +01:00
Sebastian Chlad
07660ada4f android/pics: Update PICS to PTS 5.0 for DID
Remove PICS settings which are not applicable in PTS
2014-01-08 14:17:09 +01:00
Lukasz Rymanowski
7bfd06208a android: Send remote devices properties on enable
If there is any bonded device stored then on bluetooth enable we
should send notification with its properties.
2014-01-08 13:13:49 +01:00
Lukasz Rymanowski
3dee7edf88 android: Move get_remote_device_props up in the file
This patch moves up function get_remote_device_props() and all
functions required by this function.
2014-01-08 13:13:49 +01:00
Lukasz Rymanowski
c8aabab889 android: Add wrapper function for get remote dev properties 2014-01-08 13:13:49 +01:00
Szymon Janc
098a8ad4ed android: Cleanup Android.mk
Remove not needed headers file in source list (Android build handles
this), explicitly mark packages as optional and fix bluetooth.default
dependencies (it should not depend on haltest as it is optional debug
package and should not be installed in user build).
2014-01-08 11:15:40 +01:00
Luiz Augusto von Dentz
2149ffefdc android/audio-ipc-api: Fix service id documentation
This follow Bluetooth HAL documentation that doesn't use any string
identifier just the integer value.
2014-01-08 11:37:45 +02:00
Luiz Augusto von Dentz
0d6a62ff24 android/audio-ipc: Fix Open command pdu
The uuid field is 16 bytes long not 16 bits, also make the first preset to
be the codec capability to avoid having 2 fields with variable length.
2014-01-08 11:37:44 +02:00
Luiz Augusto von Dentz
841e96bc65 android/A2DP: Add stream suspend command/response struct
This adds the definitions to stream suspend command and response.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
ba880cc4c4 android/A2DP: Add stream resume command/response struct
This adds the definitions to stream resume command and response.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
2d805557f2 android/A2DP: Add stream close command/response struct
This adds the definitions to stream close command and response.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
62cfe1bc62 android/A2DP: Add stream open command/response struct
This adds the definitions to stream open command and response.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
dfb5f89f63 android/A2DP: Add audio close command/response struct
This adds the definitions to audio close command and response.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
3d2f0eeaf0 android/A2DP: Add audio open command/response struct
This adds the definitions to audio open command and response.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
23893fbe93 android/A2DP: Add initial code to handle audio IPC commands
This adds initial code to handle audio IPC commands.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
193cbd4dd3 android/ipc: Add audio_ipc_send_rsp and audio_ipc_send_rsp_full
These functions can be used to respond to commands recieved over audio
IPC.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
1829216bab android/ipc: Add message handling for audio IPC
This adds audio_ipc_register and audio_ipc_unregister and adapt
ipc_handle_msg to be able to handle audio services messages.
2014-01-07 13:37:53 +02:00
Luiz Augusto von Dentz
294bfb1001 android/ipc: Add initial code for audio IPC
This add initial code for listen and accept connections on the abstract
socket defined for the audio IPC.
2014-01-07 13:37:50 +02:00
Marcel Holtmann
936842f880 monitor: Add initial support for analyzing btsnoop traces 2014-01-06 12:47:55 -08:00
Szymon Janc
26381ed7d8 android/socket: Move logic from HAL to daemon in connect
This reduce logic in HAL to bare minimum e.g. no modifications in
library will be needed to add different socket type support.

Both bdaddr2str and btuuid2str handle NULL pointers so it is safe to
print debug unconditionally.
2014-01-06 21:26:21 +02:00
Szymon Janc
74c65573ce android/socket: Move logic from HAL to daemon in listen
This reduce logic in HAL to bare minimum e.g. no modifications in
library will be needed to add different socket type support.

Both bdaddr2str and btuuid2str handle NULL pointers so it is safe to
print debug unconditionally.
2014-01-06 21:25:59 +02:00
Szymon Janc
e99c1dbd33 android/socket: Make channel int32_t in IPC specification
This match IPC type with type in socket HAL API. This allows to pass
data directly from HAL library and will allow to reduce logic in it.
2014-01-06 21:25:43 +02:00
Anderson Lizardo
3e5e6c7618 android/system-emulator: Remove useless "static" qualifier
The value of SYSTEM_SOCKET_PATH is just copied to another memory
location using memcpy() (on the same function), therefore the static
qualifier is unnecessary.
2014-01-06 21:22:39 +02:00
Anderson Lizardo
37f1b609ae android/client: Fix uninitialized "sock_fd" variable
If EXEC() macro is called with the first pointer argument NULL, sock_fd
will not be initialized. Given that the NULL check is not fatal, it is a
good idea to initialize the variable to -1 so the code has defined
behavior on this situation.

Detected by clang:

android/client/if-sock.c:251:7: error: variable 'sock_fd' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
2014-01-06 21:22:28 +02:00
Anderson Lizardo
7ce750c3e4 android/client: Use memcpy() for getting CMSG_DATA()
This is how it is done in all other places in BlueZ. Also drop
unnecessary "descs" local variable.

Fixes clang error:

android/client/if-sock.c:164:11: error: cast from 'unsigned char *' to
'int *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
2014-01-06 21:22:15 +02:00
Anderson Lizardo
e957c5059e android/client: Remove duplicate "const" specifier
Fixes clang errors like:

android/client/if-hh.c:181:39: error: duplicate 'const' declaration
specifier [-Werror,-Wduplicate-decl-specifier]
2014-01-06 21:22:02 +02:00
Anderson Lizardo
eec27c1cfc android/client: Fix incorrect usage of bt_state_t2str()
Fixes clang error:

android/client/if-bt.c:313:54: error: implicit conversion from
enumeration type 'bt_status_t' to different enumeration type
'bt_state_t' [-Werror,-Wenum-conversion]
2014-01-06 21:21:50 +02:00
Marcel Holtmann
4f72c38007 monitor: Add support for Ellisys HCI Injection 2014-01-03 22:43:05 -08:00
Szymon Janc
8a73184567 android/bluetooth: Fix browse_remote_sdp return value
False was converted to HAL_STATUS_SUCCESS resulting in wrong error
code in case of failure in handle_get_remote_services_cmd.
2014-01-03 22:56:50 +01:00
Andrei Emeltchenko
01d5057d59 android/tester: Fix NULL dereference in socket setup
Add return statement to avoid NULL dereference in socket setup.
2014-01-03 15:47:41 +02:00
Andrei Emeltchenko
8ebfb29e5b android/tester: Fix NULL dereference.
NULL pointer data->if_bluetooth will be dereferenced without return.
2014-01-03 15:47:30 +02:00
Lukasz Rymanowski
6bd69ca560 android/map: Add support for MAP/MAS
Theres no HAL API exposed to application to register different MAS
instances. Android 4.4 does support only MAS SMS. All Instance ID,
supported msg type and rfcomm channel are hardcoded in the stack.
Unfortunatelly we need to do the same way and wait for new HAL API
which is expected.
2014-01-02 15:48:45 +02:00
Grzegorz Kolodziejczyk
54c0afae72 android/tester: Add SCAN_MODE=NONE set prop done test case
This adds SCAN_MODE property set to NONE - done test case.

SCAN_MODE at startup is set to NONE. Bluez return status - done when
requested status is the same as was.
2014-01-01 18:30:56 +02:00
Grzegorz Kolodziejczyk
ae06d36aa1 android/tester: Add BONDED_DEVICES get prop success test case
This adds BONDED_DEVICES get property success test case.

At this time there are no bonded devices. Clear bonded devices list is
expected.
2014-01-01 18:30:47 +02:00
Grzegorz Kolodziejczyk
204fc85115 android/tester: Add UUIDS get prop success test case
This adds UUIDS get property success test case.
2014-01-01 18:30:39 +02:00
Grzegorz Kolodziejczyk
19c7222c47 android/tester: Add DISCOVERY_TIMEOUT get prop success test case
This adds DISCOVERY_TIMEOUT get property success test case.
2014-01-01 18:30:32 +02:00
Grzegorz Kolodziejczyk
cc2352a2fc android/tester: Add SCAN_MODE get prop success test case
This adds SCAN_MODE get property success test case.
2014-01-01 18:30:21 +02:00
Szymon Janc
b057f428da android/build: Fix building HAL library on Linux
PLATFORM_SDK_VERSION was not passed while building HAL library on Linux
host resulting in 4.3+ features not being build.
2014-01-01 18:29:19 +02:00
Szymon Janc
5ea252c446 android/haltest: Implement missing functions from bluetooth HAL
Implement functions added in Android 4.3+ to Bluetooth HAL.
2014-01-01 18:29:03 +02:00
Szymon Janc
475e1c3639 android/haltest: Improve EXEC macro robustness
Print info about method being NULL instead of crashing.
2014-01-01 18:28:56 +02:00
Szymon Janc
c927bb6db3 android/hal-bluetooth: Add debug print to config_hci_snoop_log
Improves debugs and make it consistent with other methods.
2014-01-01 18:28:50 +02:00
Szymon Janc
500007e24f android/system-emulator: Add support for bluetoothd-snoop service
This allows to test bluetoothd-snoop service on Linux host.
2014-01-01 18:28:31 +02:00
Szymon Janc
4758660275 android/hal-bluetooth: Update snoop service name
Match service name with android snoop binary name. It is more common
to use '-' instead of '_' in the code for binaries name.
2014-01-01 18:27:58 +02:00
Szymon Janc
ffde7eee83 android: Add HCI snooping tool
This tool is intended to be run as Android service. It supports
writing HCI snoop data in old btsnoop format only. By default traffic
is stored in /sdcard/btsnoop_hci.log file (can be overridded with
option - mainly for testing on Linux host). Only index 0 is sniffed.
2014-01-01 18:26:47 +02:00
Ravi kumar Veeramally
885cf9d846 android/pan: Add PAN SDP record for NAP role 2013-12-31 15:43:39 +02:00
Szymon Janc
47e30d43c5 android/hidhost: Move set_report parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
2013-12-31 11:34:32 +02:00
Szymon Janc
33c2a480a8 android/hidhost: Move get_report parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
2013-12-31 11:34:30 +02:00
Szymon Janc
af6b7bef23 android/hidhost: Move set_protocol parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
2013-12-31 11:34:28 +02:00
Szymon Janc
81617ffdfc android/hidhost: Move get_protocol parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
2013-12-31 11:34:05 +02:00
Grzegorz Kolodziejczyk
a222b8440f android/tester: Add TYPE_OF_DEVICE get prop success test case
This adds TYPE_OF_DEVICE get property success test case.
2013-12-30 16:24:55 +01:00
Grzegorz Kolodziejczyk
cd59f96561 android/tester: Add CLASS_OF_DEVICE get prop success test case
This adds CLASS_OF_DEVICE get property success test case.
2013-12-30 16:24:55 +01:00
Grzegorz Kolodziejczyk
3b6585276b android/tester: Add BONDED_DEVICES set prop fail test case
This adds BONDED_DEVICES set property fail test case due to only
get possibility.
2013-12-30 16:24:55 +01:00
Grzegorz Kolodziejczyk
f4dfa41d08 android/tester: Add SCAN_MODE=CONNECTABLE set prop success test case
This adds SCAN_MODE property set to CONNECTABLE - success test case.
2013-12-30 16:24:55 +01:00
Grzegorz Kolodziejczyk
e3d0d1ec24 android/tester: Add BDADDR set prop fail test case
This adds BDADDR set property fail test case due to only get
possibility.
2013-12-30 16:24:55 +01:00
Lukasz Rymanowski
89d8dee407 android: Make stream example generic in the API doc
The stream direction should not really matter.
2013-12-30 14:27:20 +02:00
Lukasz Rymanowski
d781d37d07 android: Minor fix to Android Bluetooth Audio protocol API doc
Make picture consistent with example below it.
2013-12-30 14:23:42 +02:00
Lukasz Rymanowski
7b5890f57d android/audio: Fix Makefile.am for libaudio
Use CFLAGS instread of CPPFLAGS
2013-12-30 14:23:42 +02:00
Lukasz Rymanowski
aed795faa3 android/ipc: Remove not needed include 2013-12-30 14:23:42 +02:00
Andrei Emeltchenko
bcdc98b2d7 btmon: Fix build for Android
Android build was really broken with additions of functions hwdb_*

...
external/bluetooth/bluez/android/../monitor/packet.c:406: error:
undefined reference to 'hwdb_get_company'
external/bluetooth/bluez/android/../monitor/packet.c:2487: error:
undefined reference to 'hwdb_get_vendor_model'
collect2: error: ld returned 1 exit status
...
2013-12-29 21:21:41 +02:00
Grzegorz Kolodziejczyk
7d310b0142 android/tester: Refactor HAL callback check
This patch removes ID enum in favour of test cases having their own as
implementation of callbacks checking test conditions.
Now each test case uses it own callback function and within it
test conditions are checked, e.g. with property get test case, property
and if it's properly cb is checked.
Count of expected callback is defined as a number and after calling
proper cb, value is decremented.
This also changes to generic - property check used within HAL cb.
2013-12-23 16:56:05 +01:00
Grzegorz Kolodziejczyk
678b2f5248 android/tester: Correct bdname set test case struc conditions
This patch correct struct elements initialization. Now test name is
declared as variable before test case struct and its size is calculated
using sizeof(), not by hard coded number.
2013-12-23 16:56:05 +01:00
Grzegorz Kolodziejczyk
d9d2a4d828 android/tester: Whitespace and semicolon style correction
This patch adds semicolon to the last element in test case condition
structure. Additional whitespace was removed from function.
2013-12-23 16:56:05 +01:00
Grzegorz Kolodziejczyk
2137559a52 android/tester: Change test data variables placement
This patch moves two test variables to proper place in code - before
test case init structs.
2013-12-23 16:56:05 +01:00
Grzegorz Kolodziejczyk
3757d4198d android/tester: Move BT discovery test cases before Socket Hal
This moves and organize test case data. BT discovery test cases to right
place in code.
2013-12-23 16:56:05 +01:00
Grzegorz Kolodziejczyk
350180d783 android/tester: Seperate Socket HAL cbs from Bluetooth HAL cb
This patch adds seperate callbacks structure for socket HAL test cases.
Is's needed beceause Socket HAL cb have other purpose than Bluetooth HAL
cb. Callbacks are now initialized outside test setup function and
cb struct depends on HAL type.
2013-12-23 16:56:05 +01:00
Szymon Janc
784ef1cd31 android/bluetooth: Print command opcode in DUT mode functions
Print command opcode in handle_le_test_mode_cmd and
handle_dut_mode_send_cmd. This is valuable information on what kind
of HCI command the Java layer tries to send.
2013-12-23 16:42:47 +01:00
Szymon Janc
4257df2c1d android: Add comment why umask() is needed in system-emulator 2013-12-23 16:39:10 +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
Szymon Janc
7c3a06b743 android/bluetooth: Print error on unimplemented functions
Functions, callbacks or properties that are not implemented due to
being bogus or not feasible now prints error messages.
2013-12-23 14:41:41 +02:00
Szymon Janc
385c00cedd android/bluetooth: Add support for DUT mode configure command
This allows to enable and disable DUT mode. This is special mode so
adding more info from related kernel commit:

"The Device Under Test (DUT) mode is useful for doing certification
testing and so expose this as debugfs option.

This mode is actually special since you can only enter it. Restoring
normal operation means that a HCI Reset is required. The current mode
value gets tracked as a new device flag and when disabling it, the
correct command to reset the controller is sent."
2013-12-23 14:41:41 +02:00
Szymon Janc
3330781a20 android/bluetooth: Fix error message in stop_discovery 2013-12-23 12:47:31 +01:00
Johan Hedberg
69b7e11ceb android/README: Fix consistency issues with whitespace 2013-12-23 12:00:19 +02:00
Szymon Janc
9f809c0c99 android: Add shortcommings section to README
This sections lists unimplemented methods, callbacks or properties
with few words of comments why feature is missing.
2013-12-23 11:43:29 +02:00
Szymon Janc
8af14a0ec4 android/bluetooth: Add support for timestamp device property
This allows to handle timestamp property request. Also this will be
usefull for devices info cache (clearing old devices).
2013-12-23 11:41:52 +02: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
Andrei Emeltchenko
daa43c8d56 android/tester: Fix possible NULL dereference
value is checked for NULL and later is dereferenced if we do not return.
2013-12-23 10:51:21 +02:00
Szymon Janc
9bc70e63b1 android/bluetooth: Fix memory leaks in load_devices_info
Groups and key file were not free on function return. This fix
following valgrind reports:

34 (16 direct, 18 indirect) bytes in 1 blocks are definitely lost in
loss record 33 of 77
   at 0x4C2A2DB: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
amd64-linux.so)
   by 0x4E81DD0: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so
.0.3800.1)
   by 0x4E74BF1: g_key_file_get_groups (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x40CDFA: read_info_complete (bluetooth.c:1672)
   by 0x40827C: request_complete (mgmt.c:221)
   by 0x4085E9: received_data (mgmt.c:319)
   by 0x4E7C3B5: g_main_context_dispatch (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E7C707: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
   by 0x4E7CB09: g_main_loop_run (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x403B15: main (main.c:439)

1,633 (72 direct, 1,561 indirect) bytes in 1 blocks are definitely lost
in loss record 75 of 77
   at 0x4C2A2DB: malloc (in /usr/lib/valgrind/
vgpreload_memcheck-amd64-linux.so)
   by 0x4E81DD0: g_malloc (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E9796D: g_slice_alloc (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E97EAD: g_slice_alloc0 (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E746DA: g_key_file_new (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x40CDD4: read_info_complete (bluetooth.c:1667)
   by 0x40827C: request_complete (mgmt.c:221)
   by 0x4085E9: received_data (mgmt.c:319)
   by 0x4E7C3B5: g_main_context_dispatch (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E7C707: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
   by 0x4E7CB09: g_main_loop_run (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x403B15: main (main.c:439)
2013-12-20 15:46:51 +01:00
Jakub Tyszkowski
6ceab6da4c android/tester: Add remote device found success test case
Add checking for remote device being found.
2013-12-20 15:27:17 +02:00
Szymon Janc
c192841088 android/bluetooth: Remove not needed local variable
Both manufacturer and sub_version already have correct type and struct
is marked as packed so there is no need to memcpy to temp variable.
2013-12-20 15:23:54 +02:00
Szymon Janc
b6b3ff89c9 android/bluetooth-hal: Fix using wrong struct for buffer size
Buffer is for hal_cmd_le_test_mode command.
2013-12-20 15:23:43 +02:00
Andrzej Kaczmarek
90bd1a3e84 android: Include btmon and l2test in userdebug builds
This patch changes btmon and l2test module tags from 'eng' to 'debug' so
they are automatically installed also for userdebug variant which is
default for AOSP devices.
2013-12-20 13:57:42 +01:00
Ravi kumar Veeramally
50246bbaf3 bnep: Refactored bnep connect and disconnect calls
Refactored bnep connect and disconnect calls to simplify and
keeping bnep related functionality behind curtains.
bnep_connect calls takes care of bnep_setup until interface up
then connect callback will be called. Set disconnect callback
when connect call succeeds. bnep_disconnect should be
called only when iface is up/connected.
2013-12-20 14:54:47 +02:00
Andrei Emeltchenko
b11f10f814 android/tester: Fix memory leak
Call del_hook() after add_hook(). This fixes valgrind warnings:

...
==15303==
==15303== HEAP SUMMARY:
==15303==     in use at exit: 3,060 bytes in 27 blocks
==15303==   total heap usage: 6,410 allocs, 6,383 frees, 332,477 bytes
allocated
==15303==
==15303== 24 bytes in 1 blocks are definitely lost in loss record 9 of
27
==15303==    at 0x4C2A2DB: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15303==    by 0x406E20: btdev_add_hook (btdev.c:2166)
==15303==    by 0x40BFC2: test_discovery_start_done
(android-tester.c:1401)
==15303==    by 0x409C65: run_callback (tester.c:385)
==15303==    by 0x4E7C3B5: g_main_context_dispatch (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x4E7C707: ??? (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x4E7CB09: g_main_loop_run (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x40A85C: tester_run (tester.c:784)
==15303==    by 0x40368B: main (android-tester.c:1654)
==15303==
==15303== 24 bytes in 1 blocks are definitely lost in loss record 10 of
27
==15303==    at 0x4C2A2DB: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15303==    by 0x406E20: btdev_add_hook (btdev.c:2166)
==15303==    by 0x40BF12: test_discovery_stop_success
(android-tester.c:1386)
==15303==    by 0x409C65: run_callback (tester.c:385)
==15303==    by 0x4E7C3B5: g_main_context_dispatch (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x4E7C707: ??? (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x4E7CB09: g_main_loop_run (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x40A85C: tester_run (tester.c:784)
==15303==    by 0x40368B: main (android-tester.c:1654)
==15303==
...
2013-12-20 14:42:05 +02:00
Andrei Emeltchenko
b3c0a8a339 android/tester: Add test Connect returns valid fd
The case is analog for similar test case with listen().
2013-12-20 14:22:12 +02:00
Andrei Emeltchenko
68f4b78863 android/tester: Make code consistent using < 0 comparison 2013-12-20 14:22:10 +02:00
Andrei Emeltchenko
00929bfb3b android/tester: Add Socket test invalid double listen
Add Socket test making listen two times on the same RFCOMM channel.
2013-12-20 14:22:09 +02:00
Andrei Emeltchenko
d585279aaa android/tester: Fix memory leak using close()
Use device->close() to free device structure. This is the way other
Android devices are closed. Fixes following warnings:

...
==26231== 80 bytes in 1 blocks are definitely lost in loss record 25 of
31
==26231==    at 0x4C2A2DB: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26231==    by 0x40F153: open_bluetooth (hal-bluetooth.c:800)
==26231==    by 0x40C8D8: setup (android-tester.c:835)
==26231==    by 0x40CB20: setup_socket_interface_enabled
(android-tester.c:1166)
==26231==    by 0x409C15: setup_callback (tester.c:373)
==26231==    by 0x4E7C3B5: g_main_context_dispatch (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==26231==    by 0x4E7C707: ??? (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==26231==    by 0x4E7CB09: g_main_loop_run (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==26231==    by 0x40A83C: tester_run (tester.c:784)
==26231==    by 0x40362A: main (android-tester.c:1643)
...
2013-12-20 14:20:26 +02:00
Andrei Emeltchenko
40cef67567 android/hal-bluetooth: Free device on close() 2013-12-20 14:20:25 +02:00
Johan Hedberg
224b6b8088 android: Add clarifying comment to store_device_info() 2013-12-20 14:12:06 +02:00
Szymon Janc
46c2378f00 android: Set umask in system-emulator
This will make sure files are created with proper permissions so
Android daemon doesn't have to handle that. On Android umask is
set by init.
2013-12-20 14:08:43 +02:00
Szymon Janc
5022d5ab42 android/bluetooth: Add support for restoring devices from storage
This adds support to restore bonded devices from storage (including
linkkeys).
2013-12-20 14:08:25 +02:00
Szymon Janc
d3174bdc20 android/bluetooth: Add support for storing link keys
When new linkkey event is received store linkkey in devices info file.
Stored info includes linkkey, linkkey type and pin length.
2013-12-20 14:08:06 +02:00