OSDN Git Service

android-x86/external-bluetooth-bluez.git
9 years agoemulator/btdev: Fix not disabling le advertising on connection
Jakub Tyszkowski [Mon, 25 Aug 2014 11:08:52 +0000 (13:08 +0200)]
emulator/btdev: Fix not disabling le advertising on connection

Le Advertising should be disabled after the le connection is
established (Core Spec. 4.1 - Part E, Sec. 7.8.9). Not doing so
results in errors while switching advertisement multiple times during
different connection states.

9 years agobuild: Move btgatt-client to list of experimental binaries for now
Marcel Holtmann [Sat, 30 Aug 2014 16:51:43 +0000 (18:51 +0200)]
build: Move btgatt-client to list of experimental binaries for now

9 years agodoc/gatt-api: New API properties and methods for the GATT D-Bus API.
Arman Uguray [Mon, 11 Aug 2014 20:37:07 +0000 (13:37 -0700)]
doc/gatt-api: New API properties and methods for the GATT D-Bus API.

This patch introduces the following new properties to the GattService1
interface:

  Device: A remote-service-only property that contains the D-Bus object
  path of the associated device.

  Primary: Reflects whether or not a services is primary or secondary.

This patch also introduces new methods to GattCharacteristic1 and
GattDescriptor1 for reading and writing the corresponding attribute
values and a new signal for being notified of received notifications and
indications.

The "Value" D-Bus property is removed from both interfaces
and replaced with asynchronous ReadValue and WriteValue functions. This
is due to the fact that DBus.Properties.Get is synchronous and without
an asynchronous way of issuing a GATT value read request, there are
cases where a single read and cache based approach becomes limiting
(e.g. when a characteristic allows reads but no notifications) and
relying on the PropertyChanged signal to retrieve the value of a read
request asynchonously as well as to signal notifications/indications
makes for a vague API.

9 years agobuild: Add btgatt-client binary to .gitignore list
Marcel Holtmann [Sat, 30 Aug 2014 16:46:18 +0000 (18:46 +0200)]
build: Add btgatt-client binary to .gitignore list

9 years agotools/btgatt: Add command argument support.
Arman Uguray [Sat, 30 Aug 2014 16:02:49 +0000 (09:02 -0700)]
tools/btgatt: Add command argument support.

Added support for command arguments and added the -u and -a flags to the
"services" command to filter services by UUID or by start handle.

9 years agotools/btgatt-client: Add "services" command.
Arman Uguray [Sat, 30 Aug 2014 16:02:48 +0000 (09:02 -0700)]
tools/btgatt-client: Add "services" command.

Added the "services" command, which enumerates all discovered services,
characteristics, and descriptors.

9 years agotools/btgatt-client: Add "ready" handler.
Arman Uguray [Sat, 30 Aug 2014 16:02:47 +0000 (09:02 -0700)]
tools/btgatt-client: Add "ready" handler.

Added a ready handler which gets called by bt_gatt_client when the MTU exchange
and service discovery procedures complete. Also added some (bad) coloring for
verbose output.

9 years agotools/btgatt-client: Add command parsing.
Arman Uguray [Sat, 30 Aug 2014 16:02:46 +0000 (09:02 -0700)]
tools/btgatt-client: Add command parsing.

Added basic support for command parsing, including the "help" command. Also
added a call to bt_gatt_client_set_debug.

9 years agotools/btgatt-client: Integrate bt_att and bt_gatt_client.
Arman Uguray [Sat, 30 Aug 2014 16:02:45 +0000 (09:02 -0700)]
tools/btgatt-client: Integrate bt_att and bt_gatt_client.

This patch adds the initial set up of a bt_att and bt_gatt_client around the
connection socket.

9 years agotools/btgatt-client: Added L2CAP LE ATT connection.
Arman Uguray [Sat, 30 Aug 2014 16:02:44 +0000 (09:02 -0700)]
tools/btgatt-client: Added L2CAP LE ATT connection.

This patch adds support for connection establishment with different security
levels. Currently, only LE connections are supported.

9 years agotools/btgatt-client: Introduce tools/btgatt-client
Arman Uguray [Sat, 30 Aug 2014 16:02:43 +0000 (09:02 -0700)]
tools/btgatt-client: Introduce tools/btgatt-client

This is the initial commit for tools/btgatt-client.c, a command line tool to
interactively test and debug shared/gatt-client.

9 years agoandroid/health: Fix incorrect check
Andrei Emeltchenko [Fri, 29 Aug 2014 11:24:21 +0000 (14:24 +0300)]
android/health: Fix incorrect check

"!create_mdl(channel) < 0" is always false since it returns bool

9 years agoandroid/gatt: Add remove bond handling
Lukasz Rymanowski [Fri, 29 Aug 2014 09:54:00 +0000 (11:54 +0200)]
android/gatt: Add remove bond handling

With this patch GATT is aware about unpaired devices so the local cache
can be cleared

9 years agoandroid/hidhost: Add remove bond handling
Lukasz Rymanowski [Fri, 29 Aug 2014 09:53:59 +0000 (11:53 +0200)]
android/hidhost: Add remove bond handling

With this patch HID/HOG is aware when remote device has been unpaired.

9 years agoandroid/bluetooth: Add unpaired device callback
Lukasz Rymanowski [Fri, 29 Aug 2014 09:53:58 +0000 (11:53 +0200)]
android/bluetooth: Add unpaired device callback

GATT, HID, HOG, might be interested in the fact that some device has
been unpaired in order to clear cache or similar. This patch adds means
to register and unregister callback for unpaired event.

9 years agoandroid/handsfree: Refactor handle_dial()
Andrei Emeltchenko [Tue, 26 Aug 2014 13:43:21 +0000 (16:43 +0300)]
android/handsfree: Refactor handle_dial()

Call callback only once.

9 years agoandroid/client: Fix incorrect memory access
Andrei Emeltchenko [Tue, 26 Aug 2014 13:42:19 +0000 (16:42 +0300)]
android/client: Fix incorrect memory access

In case argc==3 we might access argv[3]. Make code more readable.

9 years agoandroid/avdtp: Cleanup watch id when removing session watch
Szymon Janc [Fri, 29 Aug 2014 08:33:58 +0000 (10:33 +0200)]
android/avdtp: Cleanup watch id when removing session watch

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

9 years agomonitor: Fix warnings when using l2cap_frame_get*
Luiz Augusto von Dentz [Fri, 29 Aug 2014 10:01:11 +0000 (13:01 +0300)]
monitor: Fix warnings when using l2cap_frame_get*

9 years agogobex: Abort if there is no request to cancel
Luiz Augusto von Dentz [Wed, 27 Aug 2014 16:00:24 +0000 (19:00 +0300)]
gobex: Abort if there is no request to cancel

If there is no request to cancel send an abort since otherwise the remote
may hang waiting.

9 years agogobex: Add g_obex_abort
Luiz Augusto von Dentz [Wed, 27 Aug 2014 14:16:06 +0000 (17:16 +0300)]
gobex: Add g_obex_abort

9 years agoobexd/client: Fix crash while disconnecting
Luiz Augusto von Dentz [Wed, 27 Aug 2014 12:39:02 +0000 (15:39 +0300)]
obexd/client: Fix crash while disconnecting

In case the transport is disconnected while disconnect command is pending
the session is freed on disconnect_complete but disconnect callback is
still valid causing the following crash:

Invalid read of size 4
   at 0x42682A: obc_session_ref (session.c:132)
   by 0x42797B: obc_session_shutdown (session.c:580)
   by 0x4139DA: incoming_data (gobex.c:1406)
   by 0x59712A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x5971627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x5971A39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x40D78C: main (main.c:320)
 Address 0x728d814 is 4 bytes inside a block of size 120 free'd
   at 0x4C28577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x5976F7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x4134B9: handle_response (gobex.c:1129)
   by 0x4139BD: incoming_data (gobex.c:1403)
   by 0x59712A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x5971627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x5971A39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x40D78C: main (main.c:320)

9 years agogobex: Fix crash when debug is enabled
Luiz Augusto von Dentz [Wed, 27 Aug 2014 11:07:39 +0000 (14:07 +0300)]
gobex: Fix crash when debug is enabled

GError can be NULL thus causing invalid read when trying to a message
member such as bellow:

Invalid read of size 8
   at 0x41190F: g_obex_send_internal (gobex.c:531)
   by 0x4130A6: g_obex_send_req (gobex.c:756)
   by 0x4268A5: obc_session_unref (session.c:289)
   by 0x41396A: incoming_data (gobex.c:1397)
   by 0x59712A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x5971627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x5971A39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x40D78C: main (main.c:320)
 Address 0x0 is not stack'd, malloc'd or (recently) free'd

9 years agogobex: Fix warning if g_obex_resume is called when disconnected
Luiz Augusto von Dentz [Wed, 27 Aug 2014 10:43:27 +0000 (13:43 +0300)]
gobex: Fix warning if g_obex_resume is called when disconnected

9 years agoobexd/client: Fix not being able to cancel a suspended transfer
Luiz Augusto von Dentz [Tue, 26 Aug 2014 13:23:52 +0000 (16:23 +0300)]
obexd/client: Fix not being able to cancel a suspended transfer

If a transfer is suspended it should be resumed before cancelling
otherwise it will timeout.

9 years agoobexd/client: Allow suspending transfer while they are queued
Luiz Augusto von Dentz [Tue, 26 Aug 2014 13:14:12 +0000 (16:14 +0300)]
obexd/client: Allow suspending transfer while they are queued

Transfer may be created by different processes so it make sense to allow
them to be suspended even if they are not active.

9 years agoTODO: shared/gatt-client has been defined and discovery implemented
Arman Uguray [Thu, 28 Aug 2014 21:25:25 +0000 (14:25 -0700)]
TODO: shared/gatt-client has been defined and discovery implemented

9 years agoshared/gatt-client: Implement descriptor discovery.
Arman Uguray [Thu, 28 Aug 2014 21:25:24 +0000 (14:25 -0700)]
shared/gatt-client: Implement descriptor discovery.

This patch implements characteristic descriptor discovery as part of the client
initialization flow.

9 years agoshared/gatt-client: Implement characteristic discovery.
Arman Uguray [Thu, 28 Aug 2014 21:25:23 +0000 (14:25 -0700)]
shared/gatt-client: Implement characteristic discovery.

This patch implements characteristic discovery as part of the client
initialization flow. The characteristics of each service are discovered in
order.

9 years agoshared/gatt-client: Add service iterator functions.
Arman Uguray [Thu, 28 Aug 2014 21:25:22 +0000 (14:25 -0700)]
shared/gatt-client: Add service iterator functions.

This patch introduces high-level structures and functions for iterating through,
and storing, data about the discovered services.

9 years agoshared/gatt-client: Implement initial service discovery.
Arman Uguray [Thu, 28 Aug 2014 21:25:21 +0000 (14:25 -0700)]
shared/gatt-client: Implement initial service discovery.

This code implements the following portion of attribute discovery:

  - Initial MTU exchange.
  - Primary service discovery.

Discovery results aren't stored yet.

9 years agoshared/gatt-client: Add bt_gatt_client_set_debug.
Arman Uguray [Thu, 28 Aug 2014 21:25:20 +0000 (14:25 -0700)]
shared/gatt-client: Add bt_gatt_client_set_debug.

Added the bt_gatt_client_set_debug function, which sets up a callback to be used
internally by util_debug.

9 years agoshared/gatt-helpers: Fixed typo in callback args.
Arman Uguray [Thu, 28 Aug 2014 21:25:19 +0000 (14:25 -0700)]
shared/gatt-helpers: Fixed typo in callback args.

Fixed a small typo in one of the callback arguments.

9 years agoshared/att: Add BT_ATT_DEFAULT_LE_MTU macro.
Arman Uguray [Thu, 28 Aug 2014 21:25:18 +0000 (14:25 -0700)]
shared/att: Add BT_ATT_DEFAULT_LE_MTU macro.

Moved the ATT_DEFAULT_LE_MTU to att-types.h to make it public.

9 years agoshared/att: Support multiple disconnect handlers.
Arman Uguray [Thu, 28 Aug 2014 21:25:17 +0000 (14:25 -0700)]
shared/att: Support multiple disconnect handlers.

This patch adds support for registering multiple disconnect handlers with an
instance of struct bt_att. Unregistering is achieved via a new function AND
through bt_att_unregister_all and all disconnect callbacks get automatically
unregistered after a single disconnect event.

9 years agoshared/gatt-client: Added initial skeleton and simple functions.
Arman Uguray [Thu, 28 Aug 2014 21:25:16 +0000 (14:25 -0700)]
shared/gatt-client: Added initial skeleton and simple functions.

This patch introduces shared/gatt-client, which provides a central/client side
implementation of the Generic Attribute Profile. An instance of bt_gatt_client
will provide a central database of all GATT services, characteristics, and
descriptors that have been discovered on a peripheral and will provide API
functions to obtain information about discovered attributes, registering
handlers for "Service Changed" indications, as well as providing
reference-counted access to "Client Characteristic Configuration" descriptors.

9 years agoshared/gatt-helpers: Added result count functions.
Arman Uguray [Thu, 28 Aug 2014 21:25:15 +0000 (14:25 -0700)]
shared/gatt-helpers: Added result count functions.

Added functions that return the number of services, characteristics, and
descriptors contained in a bt_gatt_result.

9 years agoshared/gatt-helpers: Remove service, characteristic, descriptor structures.
Arman Uguray [Thu, 28 Aug 2014 21:25:14 +0000 (14:25 -0700)]
shared/gatt-helpers: Remove service, characteristic, descriptor structures.

This patch removes the service, characteristic, and descriptor structures
declared in gatt-helpers.h. These aren't really necessary, especially since
there will be another higher-level version of these for shared/gatt-client.

9 years agoTODO: Add items for tasks involving the new shared ATT/GATT stack
Arman Uguray [Thu, 28 Aug 2014 21:25:13 +0000 (14:25 -0700)]
TODO: Add items for tasks involving the new shared ATT/GATT stack

9 years agoandroid/tester: Add HDP Destroy Sink Streaming Channel test case
Ravi kumar Veeramally [Wed, 27 Aug 2014 12:39:00 +0000 (15:39 +0300)]
android/tester: Add HDP Destroy Sink Streaming Channel test case

9 years agoandroid/tester: Add HDP Connect Sink Streaming Channel test case
Ravi kumar Veeramally [Wed, 27 Aug 2014 12:38:59 +0000 (15:38 +0300)]
android/tester: Add HDP Connect Sink Streaming Channel test case

9 years agoandroid/tester: Add HDP Destroy Source Reliable Channel test case
Ravi kumar Veeramally [Wed, 27 Aug 2014 12:38:58 +0000 (15:38 +0300)]
android/tester: Add HDP Destroy Source Reliable Channel test case

9 years agoandroid/tester: Add HDP Connect Source Reliable Channel test case
Ravi kumar Veeramally [Wed, 27 Aug 2014 12:38:57 +0000 (15:38 +0300)]
android/tester: Add HDP Connect Source Reliable Channel test case

9 years agoandroid/health: Avoid multiple times of sdp search
Ravi kumar Veeramally [Wed, 27 Aug 2014 12:38:56 +0000 (15:38 +0300)]
android/health: Avoid multiple times of sdp search

First it searches for control and data PSMs and then search again
for remote mdep id. It would be better to search remote mdep id
and cache in first time itself. Patch avoids load of sdp search
request for second time.

9 years agoandroid/tester: Add test for incoming bonding
Lukasz Rymanowski [Tue, 26 Aug 2014 20:41:52 +0000 (22:41 +0200)]
android/tester: Add test for incoming bonding

This patch add test for incoming just works bonding

9 years agoandroid/tester: Add function to set io cap to bthost
Lukasz Rymanowski [Tue, 26 Aug 2014 20:41:51 +0000 (22:41 +0200)]
android/tester: Add function to set io cap to bthost

Some tests might need to change default io capabilities of bthost.
This patch adds means to do it.

9 years agoandroid/tester: Add parameter to remote connect function
Lukasz Rymanowski [Tue, 26 Aug 2014 20:41:50 +0000 (22:41 +0200)]
android/tester: Add parameter to remote connect function

This patch extends emu_remote_connect_hci_action function with address
type of device to be connected

9 years agoandroid/tester: Move emu related functions to tester main
Lukasz Rymanowski [Tue, 26 Aug 2014 20:41:49 +0000 (22:41 +0200)]
android/tester: Move emu related functions to tester main

Those function can be used by other tester modules

In addition function emu_remote_disconnect_hci_action has been changed a
bit so it take handle from step data now. It was needed as cid_data was
static in tester_gatt.c

9 years agoandroid/bluetooth: Fix incoming just works bonding
Lukasz Rymanowski [Tue, 26 Aug 2014 20:41:48 +0000 (22:41 +0200)]
android/bluetooth: Fix incoming just works bonding

With this patch Android framework will be notified about bonded device
which initiated bonding and used just works association model.

9 years agoandroid/avdtp: Move PSM definition to AVDTP header
Szymon Janc [Wed, 27 Aug 2014 12:11:00 +0000 (14:11 +0200)]
android/avdtp: Move PSM definition to AVDTP header

9 years agoandroid/avdtp: Constify data in avdtp_service_cap_new
Szymon Janc [Wed, 27 Aug 2014 13:01:19 +0000 (15:01 +0200)]
android/avdtp: Constify data in avdtp_service_cap_new

9 years agoandroid/hid: Force encryption for keyboards
Jakub Tyszkowski [Mon, 25 Aug 2014 12:54:19 +0000 (14:54 +0200)]
android/hid: Force encryption for keyboards

Encryption is mandatory for keyboards. Instead of using hardcoded security
level it's now set per device (with LOW as default) and raised for
keyboards (after the SDP query is done). This level is then used to
establish outgoing connections and raising the security level of the
incomming ones.

9 years agoandroid/hid: Reject connections from unknown devices
Jakub Tyszkowski [Mon, 25 Aug 2014 12:54:18 +0000 (14:54 +0200)]
android/hid: Reject connections from unknown devices

Don't accept input from not bonded devices.

9 years agoandroid/client: Factor out hex string verification
Szymon Janc [Tue, 26 Aug 2014 12:47:36 +0000 (14:47 +0200)]
android/client: Factor out hex string verification

Use common macro for hex string verification and convertion.

9 years agoandroid/pts: Update PTS GATT test results
Marcin Kraglak [Tue, 26 Aug 2014 10:20:54 +0000 (12:20 +0200)]
android/pts: Update PTS GATT test results

9 years agoandroid/client: Fix incorrect data parsing
Marcin Kraglak [Tue, 26 Aug 2014 10:20:53 +0000 (12:20 +0200)]
android/client: Fix incorrect data parsing

Use fill_buffer function in processing write_characteristic
and send_indication functions.

9 years agoandroid/README: Update not implemented status
Szymon Janc [Tue, 26 Aug 2014 10:49:26 +0000 (12:49 +0200)]
android/README: Update not implemented status

get_remote_service_record is now implemented. Despite not being used
by Android Framework it turned out to be usefull for qualification.

9 years agomonitor: Make l2cap_frame_get* function to return bool
Luiz Augusto von Dentz [Mon, 25 Aug 2014 14:22:52 +0000 (17:22 +0300)]
monitor: Make l2cap_frame_get* function to return bool

9 years agomonitor/avctp: Fix parsing of Company ID capability
Luiz Augusto von Dentz [Mon, 25 Aug 2014 14:14:09 +0000 (17:14 +0300)]
monitor/avctp: Fix parsing of Company ID capability

9 years agomonitor/avctp: Make use of l2cap_frame_get*
Luiz Augusto von Dentz [Mon, 25 Aug 2014 14:12:39 +0000 (17:12 +0300)]
monitor/avctp: Make use of l2cap_frame_get*

9 years agomonitor: Add AVRCP ListPlayerApplicationSettingValues support
Vikrampal Yadav [Mon, 25 Aug 2014 11:16:22 +0000 (16:46 +0530)]
monitor: Add AVRCP ListPlayerApplicationSettingValues support

Support for decoding AVRCP ListPlayerApplicationSettingValues
added in Bluetooth monitor.

9 years agoandroid/pts: Update PICS/PIXIT for GATT
Marcin Kraglak [Tue, 26 Aug 2014 05:37:47 +0000 (07:37 +0200)]
android/pts: Update PICS/PIXIT for GATT

9 years agoandroid/pts: HDP regression tests
Sebastian Chlad [Tue, 26 Aug 2014 09:07:56 +0000 (11:07 +0200)]
android/pts: HDP regression tests

Regression round for HDP against PTS 5.2 and Android 4.4.4

9 years agoandroid/doc: Update repository for Intel device build
Andrei Emeltchenko [Tue, 26 Aug 2014 07:43:10 +0000 (10:43 +0300)]
android/doc: Update repository for Intel device build

Use repositories from github/01org/

9 years agoandroid/health: Shutdown MDL socket when freeing channel
Szymon Janc [Mon, 25 Aug 2014 13:59:51 +0000 (15:59 +0200)]
android/health: Shutdown MDL socket when freeing channel

PTS expects to close all data channels before sending delete
confirmation to peer. FD is passed over IPC to Android Bluetooth
application so it needs to be shutdown while freeing channel to
avoid races.

9 years agoandroid/health: Call MDL shutdown after mdl_deleted_cb callback
Ravi kumar Veeramally [Fri, 22 Aug 2014 09:10:06 +0000 (12:10 +0300)]
android/health: Call MDL shutdown after mdl_deleted_cb callback

Shutdown_mdl shutdown io channels and unrefs it. After that related
callbacks will shutdown or close and free its data. Due to timing
issue process_md_delete_mdl_req send delete confirmation response to
peer before properly shutting down all opened data channels.

9 years agoandroid/health: Remove mcl instance on mcl_disconnected call back
Ravi kumar Veeramally [Fri, 22 Aug 2014 09:10:05 +0000 (12:10 +0300)]
android/health: Remove mcl instance on mcl_disconnected call back

MCAP library is maintaining two sets of mcl list. On mcl_disconnected
call mcl instance is removed from regular mcl list and cached in
mcl_cache list. health.c doesn't maintain any cached mcls list. So
mcl_conn variable doesn't make any sense of not being connected on
mcl_disconnected call back. So unref mcl on mcl_disconnected and don't
do anything in mcl_unached callback.

9 years agoandroid/tester: Force remotes ACL disconnection
Marcin Kraglak [Fri, 22 Aug 2014 12:40:48 +0000 (14:40 +0200)]
android/tester: Force remotes ACL disconnection

This is needed or else we would need to extend the timeout for a single
test case in tester framework and wait two more seconds for ACL to
disconnect.

9 years agoemulator/bthost: Add hci disconnect
Marcin Kraglak [Fri, 22 Aug 2014 12:40:47 +0000 (14:40 +0200)]
emulator/bthost: Add hci disconnect

9 years agoandroid/tester: Wait for ACL disconnection before reconnect
Jakub Tyszkowski [Fri, 22 Aug 2014 12:40:46 +0000 (14:40 +0200)]
android/tester: Wait for ACL disconnection before reconnect

We need the remote to drop its ACL before it tries to connect again.

9 years agomonitor/sdp: Make use of l2cap_frame_get*
Luiz Augusto von Dentz [Mon, 25 Aug 2014 08:33:51 +0000 (11:33 +0300)]
monitor/sdp: Make use of l2cap_frame_get*

9 years agomonitor: Add helper functions to get data from L2CAP frames
Luiz Augusto von Dentz [Fri, 22 Aug 2014 10:23:03 +0000 (13:23 +0300)]
monitor: Add helper functions to get data from L2CAP frames

9 years agoandroid: Don't depend on libcap when building for Linux
Szymon Janc [Fri, 22 Aug 2014 09:56:39 +0000 (11:56 +0200)]
android: Don't depend on libcap when building for Linux

Those are used only when building for Android target.

9 years agoandroid/pts: Update MPS test result
Lukasz Rymanowski [Thu, 21 Aug 2014 13:10:19 +0000 (15:10 +0200)]
android/pts: Update MPS test result

Test TC_SRC_TG_HFAV_CLH_MD_BV_04_I pass when Music application triggers
music play/pause after it gets both: Button Pushed and Button
Released events.

Note that AOSP Music player triggers play/pause just after it gets
Button Pushed

9 years agoandroid/pts: Update GAP PTS test results
Marcin Kraglak [Thu, 21 Aug 2014 10:23:15 +0000 (12:23 +0200)]
android/pts: Update GAP PTS test results

9 years agoandroid/handsfree: Fix alignment
Andrei Emeltchenko [Wed, 20 Aug 2014 13:05:59 +0000 (16:05 +0300)]
android/handsfree: Fix alignment

9 years agoandroid: Fix header include
Andrei Emeltchenko [Wed, 20 Aug 2014 13:06:47 +0000 (16:06 +0300)]
android: Fix header include

Since Android KitKat we can use sys/prctl.h and sys/capability.h
as specified in the manual page. Fixes also build warnings:
...
warning: implicit declaration of function 'prctl'
[-Wimplicit-function-declaration]
  if (prctl(PR_SET_KEEPCAPS, 1) < 0) {
  ^
...

10 years agoaudio/avdtp: Fix invalid reference counting
Vinicius Costa Gomes [Wed, 20 Aug 2014 14:06:52 +0000 (11:06 -0300)]
audio/avdtp: Fix invalid reference counting

If the AVDTP session is terminated via any other mean than
'connection_lost()' (the only place that btd_device_unref() was called),
there was a dangling reference to the device.

This can be easily reproduced by suspending the host while using an A2DP
speaker. It has the very misleading effect of being unable to create the
device when the system resumes.

10 years agomonitor: Fix AVRCP rejected packet handling error
Vikrampal Yadav [Wed, 20 Aug 2014 09:24:07 +0000 (14:54 +0530)]
monitor: Fix AVRCP rejected packet handling error

Rectified the handling of AVRCP rejected packets in btmon.

10 years agoandroid/avrcp: Register CT record
Luiz Augusto von Dentz [Wed, 20 Aug 2014 08:19:47 +0000 (11:19 +0300)]
android/avrcp: Register CT record

This fixes TC_SDAS_BV_03_I which requires CT record.

10 years agotools: fix headers for bcm43xx
Natanael Copa [Wed, 20 Aug 2014 09:06:21 +0000 (11:06 +0200)]
tools: fix headers for bcm43xx

PATH_MAX is defined in limits.h so include it explicitly.

This fixes the following compile error on musl libc (Alpine Linux):
tools/hciattach_bcm43xx.c: In function 'bcm43xx_locate_patch':
tools/hciattach_bcm43xx.c:313:14: error: 'PATH_MAX' undeclared (first use in this function)
    char path[PATH_MAX];
                  ^

10 years agoshared: include limits.h for PATH_MAX
Natanael Copa [Wed, 20 Aug 2014 09:17:47 +0000 (11:17 +0200)]
shared: include limits.h for PATH_MAX

PATH_MAX is defined in limits.h so include it explicitly.

This fixes the following compile error on musl libc (Alpine Linux):
src/shared/util.c: In function 'util_get_dt':
src/shared/util.c:99:16: error: 'PATH_MAX' undeclared (first use in this function)
  char filename[PATH_MAX];
                ^

10 years agoandroid/bluetooth: Add debug log to select_device_bearer
Lukasz Rymanowski [Wed, 20 Aug 2014 08:10:24 +0000 (10:10 +0200)]
android/bluetooth: Add debug log to select_device_bearer

This patch refactor a bit select_device_bearer function so we can get
debug log out of it. This log might be very useful in dual mode devices
scenarios

10 years agoandroid/bluetooth: Fix bdaddr_type in pairing scenario
Lukasz Rymanowski [Wed, 20 Aug 2014 08:10:23 +0000 (10:10 +0200)]
android/bluetooth: Fix bdaddr_type in pairing scenario

With this patch correct bdaddr type is used in ssp pairing scenario

10 years agoandroid/health: Fix NULL dereference
Andrei Emeltchenko [Wed, 20 Aug 2014 07:02:03 +0000 (10:02 +0300)]
android/health: Fix NULL dereference

In a case get_app(), get_device(), get_channel() fail prevent
dereference of NULL pointer. Fixes clang warnings:
...
android/health.c:1980:15: warning: Access to field 'dev' results in a
dereference of a null pointer (loaded from variable 'channel')
        queue_remove(channel->dev->channels, channel);
                     ^~~~~~~~~~~~
1 warning generated.
...

10 years agoandroid/bluetooth: Update pairing status on pair complete event
Lukasz Rymanowski [Thu, 7 Aug 2014 08:39:00 +0000 (10:39 +0200)]
android/bluetooth: Update pairing status on pair complete event

So far BfA updates android bond state after link key(s) are
distributed. With LE pairing it might happen that no keys are
distributed e.g remote device has Initiator Key Distribution and
Responder Key Distribution set to 0. In such case link is encrypted
with STK and after its disconnected, pairing needs to be done again.

With this patch Android will get update about pairing complete just
after BfA gets pairing complete from the kernel. It solve issue withnot
updated Android settings application, which is hanging on "Pairing", in
case when no keys are distributed.

However, bacause Android does not see the difference between bonded /
paired devices and because Android does not allow to update its bond
state if FSM it is not in 'pending' state, BfA updates Android with
BONDED state on pair_complete with success. This is how we are doing
so far for bonding and non-bonding pairing.

Note: BfA will update its bonded state after link key(s) are
distribiuted.

10 years agogdbus: Fix crash when watch is toggled or disconnected
Luiz Augusto von Dentz [Tue, 12 Aug 2014 12:31:24 +0000 (15:31 +0300)]
gdbus: Fix crash when watch is toggled or disconnected

This partially reverts 510b32b7156625b9df737c916b7a7a5c6fb285b9 since it
still necessary to take a reference before calling dbus_watch_handle
since internally it can call watch_info_free as in the following trace:

 Invalid read of size 8
   at 0x121085: watch_func (mainloop.c:105)
   by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
   by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
   by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
   by 0x120541: main (main.c:551)
 Address 0x5bbcd90 is 16 bytes inside a block of size 24 free'd
   at 0x4A079AE: free (vg_replace_malloc.c:427)
   by 0x4C7837E: g_free (gmem.c:252)
   by 0x4F708BF: dbus_watch_set_data (dbus-watch.c:614)
   by 0x4F70938: _dbus_watch_unref (dbus-watch.c:132)
   by 0x4F6E9A7: _dbus_transport_handle_watch (dbus-transport.c:884)
   by 0x4F59AFB: _dbus_connection_handle_watch (dbus-connection.c:1497)
   by 0x4F70AF9: dbus_watch_handle (dbus-watch.c:683)
   by 0x121084: watch_func (mainloop.c:103)
   by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
   by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
   by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
   by 0x120541: main (main.c:551)

10 years agogdbus: Fix crash when calling g_dbus_add_service_watch
Luiz Augusto von Dentz [Tue, 12 Aug 2014 12:11:29 +0000 (15:11 +0300)]
gdbus: Fix crash when calling g_dbus_add_service_watch

If g_dbus_add_service_watch is called for service which bus name is
already known the following crash can happen:

invalid read of size 1
  at 0x4C2A2F2: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x4E97722: g_strdup (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x405B0C: update_name_cache (watch.c:435)
  by 0x405C37: update_service (watch.c:593)
  by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4038EA: client_ready (test-gdbus-client.c:1014)
  by 0x4E9E5E0: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E9E7A5: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E9EB1A: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x403614: main (test-gdbus-client.c:1058)
Address 0x5dbe5d0 is 0 bytes inside a block of size 7 free'd
  at 0x4C28577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x4E7FF7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x405B04: update_name_cache (watch.c:434)
  by 0x405C37: update_service (watch.c:593)
  by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4038EA: client_ready (test-gdbus-client.c:1014)
  by 0x4E9E5E0: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E9E7A5: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E9EB1A: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x403614: main (test-gdbus-client.c:1058)

10 years agoinput: Fix crash when receiving event from uHID
Luiz Augusto von Dentz [Mon, 18 Aug 2014 08:09:13 +0000 (11:09 +0300)]
input: Fix crash when receiving event from uHID

uHID device is created only once so it is possible that the kernel send
events when there is no connection causing the following crash:

Invalid read of size 4
   at 0x4EBC650: g_io_channel_unix_get_fd (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x42C56A: hidp_send_message (device.c:160)
   by 0x46EF1C: queue_foreach (queue.c:206)
   by 0x42E3B0: uhid_read_handler (uhid.c:98)
   by 0x46E82C: read_callback (io-glib.c:168)
   by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
   by 0x40A972: main (main.c:607)
 Address 0x70 is not stack'd, malloc'd or (recently) free'd

10 years agodoc: Update Android tests coverage
Szymon Janc [Tue, 19 Aug 2014 17:38:37 +0000 (19:38 +0200)]
doc: Update Android tests coverage

10 years agoandroid/pts: Update PAN PICS and tests results
Szymon Janc [Mon, 18 Aug 2014 12:21:13 +0000 (14:21 +0200)]
android/pts: Update PAN PICS and tests results

Specification Errata #3558 makes LLMNR support optional as LLMNR Draft
was never adopted by IETF. AOSP doesn't support LLMNR.

10 years agoandroid/pts: Updated GAP test result
Lukasz Rymanowski [Tue, 19 Aug 2014 08:12:24 +0000 (10:12 +0200)]
android/pts: Updated GAP test result

Updated test result and instruction for TC_BOND_BON_BV_04_C

10 years agoandroid/pts: Update GAP result for handling directed advertising
Jakub Tyszkowski [Tue, 19 Aug 2014 09:32:07 +0000 (11:32 +0200)]
android/pts: Update GAP result for handling directed advertising

Previously used connection procedure was to slow for remotes preforming
directed advertising. This issue is no longer valid on the latest kernel
and auto connection support added recently to the daemon.

10 years agoandroid/pts: Update PTS files for L2CAP
Sebastian Chlad [Tue, 19 Aug 2014 08:32:34 +0000 (10:32 +0200)]
android/pts: Update PTS files for L2CAP

PICS and PIXITs checked against PTS 5.2. Regression round on PTS
5.2 against Android 4.4.4. Interim results.

10 years agoandroid/pts: Update GAP PTS test results
Marcin Kraglak [Tue, 19 Aug 2014 07:50:55 +0000 (09:50 +0200)]
android/pts: Update GAP PTS test results

10 years agoandroid/bluetooth: Fix device found notification
Lukasz Rymanowski [Tue, 19 Aug 2014 13:45:29 +0000 (15:45 +0200)]
android/bluetooth: Fix device found notification

If device is dual mode and can be seen on both LE and BREDR, then
bdaddr_type in device struct keeps LE address type of that device.

During discovery, we should take current bdaddr_type to decide about
passing that device up to application or not. Using dev->braddr_type might
be misleading

This patch fix scenario when remote device is known as LE device and
recently has been found on inquiry seesion as DUAL mode device. In such
case, based on braddr_type and eir flags we could incorectly skip
new device notification for Android framework.

10 years agoandroid/health: Simplify search_cb failure case
Ravi kumar Veeramally [Mon, 18 Aug 2014 09:07:02 +0000 (12:07 +0300)]
android/health: Simplify search_cb failure case

10 years agoandroid/health: Add some information messages
Ravi kumar Veeramally [Mon, 18 Aug 2014 09:07:01 +0000 (12:07 +0300)]
android/health: Add some information messages

10 years agoandroid/health: Fix connect channel failure case
Ravi kumar Veeramally [Mon, 18 Aug 2014 09:06:59 +0000 (12:06 +0300)]
android/health: Fix connect channel failure case

There is a possibilty of created channel is being added to queue,
but on failure case it does channel free but not removed from queue.

10 years agosmp-tester: Fix invalid data test to expect a disconnect
Johan Hedberg [Mon, 18 Aug 2014 10:58:27 +0000 (13:58 +0300)]
smp-tester: Fix invalid data test to expect a disconnect