OSDN Git Service

android-x86/external-bluetooth-bluez.git
10 years agoandroid/hal-audio: Fix RTP sequence numbers
Andrzej Kaczmarek [Mon, 3 Feb 2014 16:55:48 +0000 (17:55 +0100)]
android/hal-audio: Fix RTP sequence numbers

10 years agoandroid/hal-audio: Fix audio with large omtu value
Andrzej Kaczmarek [Mon, 3 Feb 2014 16:55:47 +0000 (17:55 +0100)]
android/hal-audio: Fix audio with large omtu value

This patch fixes media packet construction with devices which use large
omtu value. In such cases it's possible that we will try to fit more
than 15 SBC frames in single media packet (which is maximum possible
value as it's encoded using 4 bits) which will cause frame counter to
wrap around and provide incorrect data to SBC encoder.

This behaviour was seen on UPF with one of carkit devices which set
omtu=2688.

10 years agoandroid/hal-audio: Print calculated SBC parameters
Andrzej Kaczmarek [Mon, 3 Feb 2014 16:55:46 +0000 (17:55 +0100)]
android/hal-audio: Print calculated SBC parameters

10 years agoandroid/hal-audio: Be more verbose on SBC errors
Andrzej Kaczmarek [Mon, 3 Feb 2014 16:55:45 +0000 (17:55 +0100)]
android/hal-audio: Be more verbose on SBC errors

10 years agoandroid/hal-audio: Remove unsupported mono channel mode
Andrzej Kaczmarek [Mon, 3 Feb 2014 16:55:44 +0000 (17:55 +0100)]
android/hal-audio: Remove unsupported mono channel mode

AudioFlinger can only provide PCM 16bit Stereo data for A2DP track so
we should not advertise mono channel mode in capabilities since we
can't downmix this internally.

10 years agodoc: Minor whitespace fix in test-coverage.txt
Szymon Janc [Mon, 3 Feb 2014 13:22:52 +0000 (14:22 +0100)]
doc: Minor whitespace fix in test-coverage.txt

10 years agodoc: Add test case numbers from Android IPC unit tests
Szymon Janc [Mon, 3 Feb 2014 13:22:18 +0000 (14:22 +0100)]
doc: Add test case numbers from Android IPC unit tests

10 years agoandroid/unit: Rename tests names to be more descriptive
Szymon Janc [Mon, 3 Feb 2014 12:56:42 +0000 (13:56 +0100)]
android/unit: Rename tests names to be more descriptive

10 years agoandroid/unit: Add /android_ipc/send_cmd_3 test case
Marcin Kraglak [Thu, 16 Jan 2014 10:05:02 +0000 (11:05 +0100)]
android/unit: Add /android_ipc/send_cmd_3 test case

This case will register service, next unregister it and send
command. Expected status is raise SIGTERM.

10 years agoandroid/unit: Add /android_ipc/send_cmd_2 test case
Marcin Kraglak [Thu, 16 Jan 2014 10:05:01 +0000 (11:05 +0100)]
android/unit: Add /android_ipc/send_cmd_2 test case

This will test sending command to previously registered service.

10 years agoandroid/unit: Add /android_ipc/send_cmd_1 test case
Marcin Kraglak [Thu, 16 Jan 2014 10:05:00 +0000 (11:05 +0100)]
android/unit: Add /android_ipc/send_cmd_1 test case

This test case will check if ipc lib will raise SIGTERM
after sending command to not registered service.

10 years agoandroid/ipc: Remove watches on cleanup
Marcin Kraglak [Thu, 16 Jan 2014 10:04:59 +0000 (11:04 +0100)]
android/ipc: Remove watches on cleanup

Remove watches on cleanup. It will avoid receiving
events after cleanup.

10 years agoandroid/unit: Add android IPC unit tests
Marcin Kraglak [Thu, 16 Jan 2014 10:04:58 +0000 (11:04 +0100)]
android/unit: Add android IPC unit tests

It will test ipc library. First test case will check
ipc_init() call.

10 years agoemulator: Fix correct link key type generation
Johan Hedberg [Mon, 3 Feb 2014 05:49:42 +0000 (07:49 +0200)]
emulator: Fix correct link key type generation

10 years agoemulator: Add HCI_Write_SSP_Debug_Mode support
Johan Hedberg [Mon, 3 Feb 2014 05:49:25 +0000 (07:49 +0200)]
emulator: Add HCI_Write_SSP_Debug_Mode support

10 years agotools/smp-tester: Fix expected key distribution to match latest bluetooth-next
Johan Hedberg [Mon, 3 Feb 2014 05:40:43 +0000 (07:40 +0200)]
tools/smp-tester: Fix expected key distribution to match latest bluetooth-next

10 years agogitignore: Add unit/avctp to .gitignore
Andrei Emeltchenko [Thu, 30 Jan 2014 14:34:51 +0000 (16:34 +0200)]
gitignore: Add unit/avctp to .gitignore

10 years agoandroid/avrcp: Close AVRCP channel on error
Andrei Emeltchenko [Thu, 30 Jan 2014 13:23:43 +0000 (15:23 +0200)]
android/avrcp: Close AVRCP channel on error

This fixes resource leak.

10 years agoavrcp: Fix printing order for browsing avrcp header
Andrei Emeltchenko [Fri, 31 Jan 2014 12:36:17 +0000 (14:36 +0200)]
avrcp: Fix printing order for browsing avrcp header

10 years agoavrcp: Fix printing incorrect order for avrcp control header
Andrei Emeltchenko [Fri, 31 Jan 2014 12:36:16 +0000 (14:36 +0200)]
avrcp: Fix printing incorrect order for avrcp control header

10 years agoandroid/hal-audio: Fix style issues
Andrei Emeltchenko [Fri, 31 Jan 2014 14:18:49 +0000 (16:18 +0200)]
android/hal-audio: Fix style issues

10 years agoandroid/hal-audio: Fix memory leak
Andrei Emeltchenko [Fri, 31 Jan 2014 14:18:48 +0000 (16:18 +0200)]
android/hal-audio: Fix memory leak

Free preset if set_blocking() fails.

10 years agoandroid/hal-audio: Do not allocate memory if fd < 0
Andrei Emeltchenko [Fri, 31 Jan 2014 14:18:47 +0000 (16:18 +0200)]
android/hal-audio: Do not allocate memory if fd < 0

Fixes memory leak when returning bad fd we still allocate memory which
is not freed in the caller function audio_open_output_stream().

10 years agoandroid/hal-audio: Check calloc return value
Andrei Emeltchenko [Fri, 31 Jan 2014 14:18:46 +0000 (16:18 +0200)]
android/hal-audio: Check calloc return value

calloc() might return NULL and is usually checked for NULL in BlueZ.

10 years agoaudio/AVRCP: Fix not setting playable flag for folder
Luiz Augusto von Dentz [Thu, 30 Jan 2014 22:30:40 +0000 (14:30 -0800)]
audio/AVRCP: Fix not setting playable flag for folder

When listing items some folders may be set as playable but the code was
ignoring it making it impossible to play any folder.

10 years agoaudio/AVRCP: Fix using the wrong octet for folder type
Luiz Augusto von Dentz [Thu, 30 Jan 2014 22:47:14 +0000 (14:47 -0800)]
audio/AVRCP: Fix using the wrong octet for folder type

Folder type is the 9 octet not the 10.

10 years agoaudio/player: Fix using invalid end index
Luiz Augusto von Dentz [Thu, 30 Jan 2014 22:14:49 +0000 (14:14 -0800)]
audio/player: Fix using invalid end index

When the End index is not set in ListItems the code automatically pick
the number of items as end index but the start index start with 0 so
the correct is to use number of items - 1.

10 years agotools: Add command to btmgmt to enable/disable debug keys setting
Marcel Holtmann [Sun, 2 Feb 2014 08:02:34 +0000 (00:02 -0800)]
tools: Add command to btmgmt to enable/disable debug keys setting

10 years agomonitor: Decode debug-keys mgmt setting information
Marcel Holtmann [Sun, 2 Feb 2014 07:54:32 +0000 (23:54 -0800)]
monitor: Decode debug-keys mgmt setting information

10 years agotools: Decode debug keys feature within btmgmt info command
Marcel Holtmann [Sun, 2 Feb 2014 07:53:42 +0000 (23:53 -0800)]
tools: Decode debug keys feature within btmgmt info command

10 years agolib: Add constants for handling debug keys setting
Marcel Holtmann [Sun, 2 Feb 2014 07:53:19 +0000 (23:53 -0800)]
lib: Add constants for handling debug keys setting

10 years agotools: Remove test for invalid key_type for long term keys
Marcel Holtmann [Sun, 2 Feb 2014 07:08:59 +0000 (23:08 -0800)]
tools: Remove test for invalid key_type for long term keys

10 years agotools: Adjust mgmt-tester to new default supported features
Marcel Holtmann [Sun, 2 Feb 2014 07:06:19 +0000 (23:06 -0800)]
tools: Adjust mgmt-tester to new default supported features

10 years agocore: Rename authentication to key_type in mgmt_ltk_info
Marcel Holtmann [Sat, 1 Feb 2014 02:46:23 +0000 (18:46 -0800)]
core: Rename authentication to key_type in mgmt_ltk_info

10 years agodoc: Describe the new debug keys command and setting
Marcel Holtmann [Fri, 31 Jan 2014 20:19:28 +0000 (12:19 -0800)]
doc: Describe the new debug keys command and setting

10 years agotools: Correct a few typos in mgmt-tester
Marcel Holtmann [Sat, 1 Feb 2014 02:31:23 +0000 (18:31 -0800)]
tools: Correct a few typos in mgmt-tester

10 years agodoc: Change the authentication parameter into key_type parameter
Marcel Holtmann [Sat, 1 Feb 2014 01:43:49 +0000 (17:43 -0800)]
doc: Change the authentication parameter into key_type parameter

10 years agodoc: List the possible key types for link keys
Marcel Holtmann [Sat, 1 Feb 2014 01:41:07 +0000 (17:41 -0800)]
doc: List the possible key types for link keys

10 years agoandroid/pts: Correct typo
Sebastian Chlad [Fri, 31 Jan 2014 16:46:46 +0000 (18:46 +0200)]
android/pts: Correct typo

10 years agoandroid/pts: Add Android version to PTS tests
Sebastian Chlad [Fri, 31 Jan 2014 16:43:22 +0000 (18:43 +0200)]
android/pts: Add Android version to PTS tests

This trivial patch adds Android version to the PTS test results.
It helps tracking tests status.

10 years agoandroid: Add avtest to debug builds
Sebastian Chlad [Fri, 31 Jan 2014 09:31:12 +0000 (11:31 +0200)]
android: Add avtest to debug builds

10 years agoaudio/AVRCP: Fix crash when player target is not initialized
Luiz Augusto von Dentz [Thu, 30 Jan 2014 16:57:44 +0000 (08:57 -0800)]
audio/AVRCP: Fix crash when player target is not initialized

Remote device may not have both roles always which can lead to crash if
it does support trigger commands that would access the player.

10 years agoandroid/pts: PTS test results for PBAP
Sebastian Chlad [Tue, 28 Jan 2014 17:25:31 +0000 (19:25 +0200)]
android/pts: PTS test results for PBAP

10 years agoandroid/pts: PTS test results for OPP
Sebastian Chlad [Tue, 28 Jan 2014 17:59:47 +0000 (19:59 +0200)]
android/pts: PTS test results for OPP

10 years agoandroid/pts: PTS test results for AVCTP
Sebastian Chlad [Wed, 29 Jan 2014 13:27:04 +0000 (15:27 +0200)]
android/pts: PTS test results for AVCTP

10 years agoandroid/pts: PTS test results for L2CAP
Sebastian Chlad [Wed, 29 Jan 2014 10:33:26 +0000 (12:33 +0200)]
android/pts: PTS test results for L2CAP

10 years agomonitor: Add SMP key distribution decoding
Johan Hedberg [Wed, 29 Jan 2014 22:49:16 +0000 (14:49 -0800)]
monitor: Add SMP key distribution decoding

10 years agoaudio/AVRCP: Fix not freeing pending_pdu if session is detroyed
Luiz Augusto von Dentz [Wed, 29 Jan 2014 18:28:01 +0000 (10:28 -0800)]
audio/AVRCP: Fix not freeing pending_pdu if session is detroyed

This fixes possibly leaking pending_pdu if the session is destroyed.

10 years agounit/avctp: Add TP/NFR/BI-01-C test
Andrei Emeltchenko [Wed, 29 Jan 2014 12:41:14 +0000 (14:41 +0200)]
unit/avctp: Add TP/NFR/BI-01-C test

To verify that the IUT (TG) reports to the test system (CT) the
reception of a control message intended for an invalid PID (PID not
registered for reception of messages).

10 years agounit/avctp: Add TP/NFR/BV-02-C test
Andrei Emeltchenko [Wed, 29 Jan 2014 12:41:13 +0000 (14:41 +0200)]
unit/avctp: Add TP/NFR/BV-02-C test

To verify that the IUT (TG) formats correctly the following fields of
the AVCTP response message: “transaction label”, "message type(R)", PID,
“packet type”, IPID and “message information”. Check that AVCTP send
response packet along with other information. Payload is out of scope of
this test (AVC_CTYPE_REJECTED is OK).

10 years agounit/avctp: Add AVCTP unit test skeleton and first test
Andrei Emeltchenko [Wed, 29 Jan 2014 12:41:12 +0000 (14:41 +0200)]
unit/avctp: Add AVCTP unit test skeleton and first test

Adds test TP/NFR/BV-01-C. To verify that the IUT (CT) formats correctly
the following fields of the AVCTP command message: “transaction label”,
"message type(C)", PID, “packet type”, IPID and “message information”.

10 years agoandroid/a2dp: Fix crash on remote disconnection
Szymon Janc [Wed, 29 Jan 2014 15:45:02 +0000 (16:45 +0100)]
android/a2dp: Fix crash on remote disconnection

Remove setups when a2dp device is removed. This fix following:

Invalid read of size 4
   at 0x115E32: bt_stream_close (a2dp.c:1352)
   by 0x111DFB: ipc_handle_msg (ipc.c:95)
   by 0x11234B: audio_watch_cb (audio-ipc.c:67)
   by 0x48BD9C7: ??? (in /system/lib/libglib.so)
 Address 0x4a590f4 is 12 bytes inside a block of size 20 free'd
   at 0x4897E6C: free (in
       /system/lib/valgrind/vgpreload_memcheck-arm-linux.so)
   by 0x48C5E2B: g_free (in /system/lib/libglib.so)

Invalid read of size 4
   at 0x113638: avdtp_close (avdtp.c:3201)
   by 0x115E39: bt_stream_close (a2dp.c:1352)
   by 0x111DFB: ipc_handle_msg (ipc.c:95)
   by 0x11234B: audio_watch_cb (audio-ipc.c:67)
   by 0x48BD9C7: ??? (in /system/lib/libglib.so)
 Address 0x4a594a4 is 28 bytes inside a block of size 1,100 free'd
   at 0x4897E6C: free (in
       /system/lib/valgrind/vgpreload_memcheck-arm-linux.so)
   by 0x48C5E2B: g_free (in /system/lib/libglib.so)

10 years agoandroid/avctp: Move AVC_HEADER_LENGTH from avctp header
Andrei Emeltchenko [Wed, 29 Jan 2014 12:36:06 +0000 (14:36 +0200)]
android/avctp: Move AVC_HEADER_LENGTH from avctp header

There is currently inconsistence in the avctp code with
AVC_HEADER_LENGTH defined in avctp.h but AVCTP_HEADER_LENGTH defined in
avctp.c. Move definition to place it is actually used in consistent way.

10 years agoavctp: Fix wrong error message
Andrei Emeltchenko [Wed, 29 Jan 2014 12:36:05 +0000 (14:36 +0200)]
avctp: Fix wrong error message

10 years agoavctp: Use predefined HEADER_LENGTH instead of sizeof
Andrei Emeltchenko [Wed, 29 Jan 2014 12:36:04 +0000 (14:36 +0200)]
avctp: Use predefined HEADER_LENGTH instead of sizeof

Make code consistent with using HEADER_LENGTH already defined and used
instead of sizeof(). Remove also ugly type conversion.

10 years agoavctp: trivial: Do not break short line
Andrei Emeltchenko [Wed, 29 Jan 2014 12:36:03 +0000 (14:36 +0200)]
avctp: trivial: Do not break short line

10 years agoavctp: Use already calculated avc header
Andrei Emeltchenko [Wed, 29 Jan 2014 12:36:02 +0000 (14:36 +0200)]
avctp: Use already calculated avc header

This removes long (81 characters) line as a side effect.

10 years agoandroid/avctp: Fix wrong error message
Andrei Emeltchenko [Wed, 29 Jan 2014 12:36:01 +0000 (14:36 +0200)]
android/avctp: Fix wrong error message

10 years agoandroid/avctp: Use predefined HEADER_LENGTH instead of sizeof
Andrei Emeltchenko [Wed, 29 Jan 2014 12:36:00 +0000 (14:36 +0200)]
android/avctp: Use predefined HEADER_LENGTH instead of sizeof

Make code consistent with using HEADER_LENGTH defined. Remove also type
conversion.

10 years agoaudio/AVRCP: Fix sending invalid response to GetCapabilities
Luiz Augusto von Dentz [Tue, 28 Jan 2014 19:46:29 +0000 (11:46 -0800)]
audio/AVRCP: Fix sending invalid response to GetCapabilities

The attribute count has to be initialized with 0 since we reuse the same
buffer for both command and responses it may be already be set causing
invalid response to be generated.

10 years agoandroid/bluetooth: Fix unbonding device on auth failure
Szymon Janc [Wed, 29 Jan 2014 16:08:05 +0000 (17:08 +0100)]
android/bluetooth: Fix unbonding device on auth failure

This was causing removal of device info from storage and resulting in
loosing bond after bluetoothd restart.

10 years agoandroid/README: Update with kernel requirements
Szymon Janc [Sun, 26 Jan 2014 16:03:17 +0000 (17:03 +0100)]
android/README: Update with kernel requirements

10 years agoandroid/README: Add information about SBC requirement
Szymon Janc [Sun, 26 Jan 2014 15:40:32 +0000 (16:40 +0100)]
android/README: Add information about SBC requirement

10 years agoandroid/README: Fix typo
Szymon Janc [Sun, 26 Jan 2014 15:40:05 +0000 (16:40 +0100)]
android/README: Fix typo

10 years agodoc: Add the mgmt interface versions and how the map to kernel releases
Marcel Holtmann [Wed, 29 Jan 2014 02:30:53 +0000 (18:30 -0800)]
doc: Add the mgmt interface versions and how the map to kernel releases

10 years agotools/l2cap-tester: Add getpeername test case when not connected
Johan Hedberg [Tue, 28 Jan 2014 23:58:24 +0000 (01:58 +0200)]
tools/l2cap-tester: Add getpeername test case when not connected

10 years agobuild: Fix make check
Luiz Augusto von Dentz [Tue, 28 Jan 2014 23:40:30 +0000 (15:40 -0800)]
build: Fix make check

Fix not checking for ENOTSOCK while setting priority.

10 years agoandroid/hal-audio: Set stream fd to blocking
Luiz Augusto von Dentz [Tue, 28 Jan 2014 17:14:46 +0000 (09:14 -0800)]
android/hal-audio: Set stream fd to blocking

This makes the stream to block on io operation so it does not return
EAGAIN on syscall such as write.

10 years agoandroid/hal-audio: Fix not handling EINTR errors
Luiz Augusto von Dentz [Tue, 28 Jan 2014 17:14:45 +0000 (09:14 -0800)]
android/hal-audio: Fix not handling EINTR errors

If the kernel interrupts us while writting just try again.

10 years agoandroid/AVDTP: Make stream channel priority 5
Luiz Augusto von Dentz [Tue, 28 Jan 2014 17:14:44 +0000 (09:14 -0800)]
android/AVDTP: Make stream channel priority 5

This makes channel priority 5 so it has higher priority than regular
traffic but less than signalling channel.

10 years agoandroid/AVDTP: Make signalling channel priority 6
Luiz Augusto von Dentz [Tue, 28 Jan 2014 17:14:43 +0000 (09:14 -0800)]
android/AVDTP: Make signalling channel priority 6

This makes signalling priority 6 so it can push commands before the
stream channel, without this the stream channel may be schedule
first and cause the signalling commands to timeout while waiting a slot.

10 years agocore: Fix rejecting ATT packets greater than the negotiated MTU
Johan Hedberg [Tue, 28 Jan 2014 18:15:36 +0000 (20:15 +0200)]
core: Fix rejecting ATT packets greater than the negotiated MTU

10 years agoandroid/pts: PTS test results for GAP
Sebastian Chlad [Tue, 28 Jan 2014 12:56:45 +0000 (14:56 +0200)]
android/pts: PTS test results for GAP

10 years agoandroid/pts: PTS test results for DID
Sebastian Chlad [Tue, 28 Jan 2014 13:40:38 +0000 (15:40 +0200)]
android/pts: PTS test results for DID

10 years agoandroid/pts: PTS test results for A2DP
Sebastian Chlad [Tue, 28 Jan 2014 12:11:23 +0000 (14:11 +0200)]
android/pts: PTS test results for A2DP

10 years agoandroid/pts: Add PTS test results for AVRCP
Sebastian Chlad [Tue, 28 Jan 2014 12:25:56 +0000 (14:25 +0200)]
android/pts: Add PTS test results for AVRCP

10 years agoandroid/pan: Handle error case properly in NAP registration
Ravi kumar Veeramally [Thu, 23 Jan 2014 13:39:26 +0000 (15:39 +0200)]
android/pan: Handle error case properly in NAP registration

10 years agoandroid/pan: Fix control state change callback parameters order
Ravi kumar Veeramally [Thu, 23 Jan 2014 13:39:25 +0000 (15:39 +0200)]
android/pan: Fix control state change callback parameters order

Callback declared in bt_pan.h is
'typedef void (*btpan_control_state_callback)
(btpan_control_state_t state, bt_status_t error, int local_role,
const char* ifname);

But PanService.Java defined it wrong way.
private void onControlStateChanged(int local_role, int state,
int error, String ifname).
First and third parameters are misplaced, so sending data according
to PanService.Java, discard this fix if issue fixed in PanService.Java.

10 years agoandroid: Trivial replacement of tabs where spaces are expected
Anderson Lizardo [Sun, 26 Jan 2014 01:44:01 +0000 (21:44 -0400)]
android: Trivial replacement of tabs where spaces are expected

10 years agoandroid: Remove useless extra parenthesis
Anderson Lizardo [Sun, 26 Jan 2014 01:44:00 +0000 (21:44 -0400)]
android: Remove useless extra parenthesis

10 years agoandroid/tester: Fix crash on failure inside setup()
Anderson Lizardo [Sun, 26 Jan 2014 01:43:59 +0000 (21:43 -0400)]
android/tester: Fix crash on failure inside setup()

The various setup_* functions were still continuing even though setup()
failed and did not initialize data->if_bluetooth properly.

Also do a little refactoring by moving tester_setup_failed() calls to
the setup() callers, so they stay close to the other failure points and
not hidden deep into a helper function.

Crash detected by Valgrind:

==4959== Invalid read of size 4
==4959==    at 0x805967A: setup_base (android-tester.c:2029)
==4959==    by 0x8055541: setup_callback (tester.c:373)
==4959==    by 0x408348F: g_idle_dispatch (gmain.c:5250)
==4959==    by 0x4086A75: g_main_context_dispatch (gmain.c:3065)
==4959==    by 0x4086E14: g_main_context_iterate.isra.23 (gmain.c:3712)
==4959==    by 0x40872FA: g_main_loop_run (gmain.c:3906)
==4959==    by 0x41744D2: (below main) (libc-start.c:226)
==4959==  Address 0x4 is not stack'd, malloc'd or (recently) free'd

10 years agocore: Rename adapter_remove_device to btd_adapter_remove_device
Petri Gynther [Sat, 25 Jan 2014 00:55:06 +0000 (16:55 -0800)]
core: Rename adapter_remove_device to btd_adapter_remove_device

Allow this symbol to be exported and usable from external plugins.

10 years agoandroid/avctp: Trivial cleanup code
Andrei Emeltchenko [Mon, 27 Jan 2014 16:01:44 +0000 (18:01 +0200)]
android/avctp: Trivial cleanup code

Avoid extra header calculation and fix wrong line indentation.

10 years agounit/avdtp: trivial: Remove empty line
Andrei Emeltchenko [Mon, 27 Jan 2014 16:01:43 +0000 (18:01 +0200)]
unit/avdtp: trivial: Remove empty line

10 years agounit/ringbuf: Fix memory leak
Andrei Emeltchenko [Mon, 27 Jan 2014 08:36:09 +0000 (10:36 +0200)]
unit/ringbuf: Fix memory leak

free allocated memory before exit

10 years agoemulator: Fix crash if socket(AF_ALG) is not supported by the kernel
Anderson Lizardo [Sun, 26 Jan 2014 01:44:02 +0000 (21:44 -0400)]
emulator: Fix crash if socket(AF_ALG) is not supported by the kernel

In this situation, smp_stop() was being called with NULL pointer.

Crash detected by valgrind:

==7925== Invalid read of size 4
==7925==    at 0x8052F18: smp_stop (smp.c:480)
==7925==    by 0x8052542: bthost_stop (bthost.c:2073)
==7925==    by 0x805521D: hciemu_unref (hciemu.c:372)
==7925==    by 0x8058C65: test_post_teardown (android-tester.c:464)
==7925==    by 0x8055DE7: tester_teardown_complete (tester.c:533)
==7925==    by 0x8055501: teardown_callback (tester.c:312)
==7925==    by 0x408348F: g_idle_dispatch (gmain.c:5250)
==7925==    by 0x4086A75: g_main_context_dispatch (gmain.c:3065)
==7925==    by 0x4086E14: g_main_context_iterate.isra.23 (gmain.c:3712)
==7925==    by 0x40872FA: g_main_loop_run (gmain.c:3906)
==7925==    by 0x41744D2: (below main) (libc-start.c:226)
==7925==  Address 0x8 is not stack'd, malloc'd or (recently) free'd

10 years agoshared: Fix undefined behavior when calculating next power of two
Anderson Lizardo [Sun, 26 Jan 2014 01:34:21 +0000 (21:34 -0400)]
shared: Fix undefined behavior when calculating next power of two

According to GCC documentation, __builtin_clz() is undefined if argument
is zero. The following problem was detected when compiling with -O0:

ERROR:unit/test-ringbuf.c:70:test_power2: assertion failed: (size1 ==
size2)

Also refactor align_power2() so the internal "find last set bit"
operation is in its own fls() function (similar to how kernel does).
fls() checks if argument is zero before calling __builtin_clz().

10 years agounit/test-ringbuf: Fix indentation
Anderson Lizardo [Sun, 26 Jan 2014 01:34:20 +0000 (21:34 -0400)]
unit/test-ringbuf: Fix indentation

10 years agoandroid: Fix typo in configure.ac path
Marcel Holtmann [Mon, 27 Jan 2014 04:04:29 +0000 (20:04 -0800)]
android: Fix typo in configure.ac path

10 years agoandroid: Second attempt to extrac version number for OSX builds
Marcel Holtmann [Mon, 27 Jan 2014 03:40:51 +0000 (19:40 -0800)]
android: Second attempt to extrac version number for OSX builds

10 years agoandroid/AVRCP: Add initial socket handling
Luiz Augusto von Dentz [Thu, 23 Jan 2014 15:58:05 +0000 (17:58 +0200)]
android/AVRCP: Add initial socket handling

This adds the initial socket listening and handling incoming connections.

10 years agoandroid/AVCTP: Add avctp_set_destroy_cb
Luiz Augusto von Dentz [Thu, 23 Jan 2014 15:55:20 +0000 (17:55 +0200)]
android/AVCTP: Add avctp_set_destroy_cb

This adds avctp_set_destroy_cb that can be use to set a callback when
the AVCTP has been disconnected.

10 years agoandroid/AVRCP: Add implementation of SDP record
Luiz Augusto von Dentz [Thu, 23 Jan 2014 13:31:45 +0000 (15:31 +0200)]
android/AVRCP: Add implementation of SDP record

This adds the following record:

Service Name: AVRCP TG
Service RecHandle: 0x10002
Service Class ID List:
  "AV Remote Target" (0x110c)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 23
  "AVCTP" (0x0017)
    uint16: 0x103
Profile Descriptor List:
  "AV Remote" (0x110e)
    Version: 0x0100

10 years agoandroid/haltest: Add init and cleanup calls to rc methods
Luiz Augusto von Dentz [Thu, 23 Jan 2014 14:37:07 +0000 (16:37 +0200)]
android/haltest: Add init and cleanup calls to rc methods

10 years agoandroid: Add initial skeleton for AVRCP in the HAL
Luiz Augusto von Dentz [Thu, 23 Jan 2014 14:30:21 +0000 (16:30 +0200)]
android: Add initial skeleton for AVRCP in the HAL

10 years agoandroid: Add initial skeleton for AVRCP in the daemon
Luiz Augusto von Dentz [Thu, 23 Jan 2014 13:04:12 +0000 (15:04 +0200)]
android: Add initial skeleton for AVRCP in the daemon

10 years agoandroid/AVCTP: Strip dependencies
Luiz Augusto von Dentz [Wed, 22 Jan 2014 11:35:33 +0000 (13:35 +0200)]
android/AVCTP: Strip dependencies

This strips AVCTP code of any dependency of core and btio to make it
transport agnostic.

10 years agoandroid: Add copy of current AVCTP implemention
Luiz Augusto von Dentz [Wed, 22 Jan 2014 09:21:36 +0000 (11:21 +0200)]
android: Add copy of current AVCTP implemention

These files are not added to any makefile on purpose because they still
have external dependencies.

10 years agoandroid: Use sed instead of cpp to extract version number
Marcel Holtmann [Sun, 26 Jan 2014 23:12:22 +0000 (15:12 -0800)]
android: Use sed instead of cpp to extract version number

10 years agoandroid: Fix leftover src/log.h include
Marcel Holtmann [Sun, 26 Jan 2014 08:27:02 +0000 (00:27 -0800)]
android: Fix leftover src/log.h include