7 years agoFix D-bus error as adding rfcommservice record. leb-0xdroid 0x7-leb-gingerbread
Matt Hsu [Fri, 29 Oct 2010 12:19:26 +0000 (20:19 +0800)]
Fix D-bus error as adding rfcommservice record.

When D-bus is trying to get arguments in adding rfcommservice record
, it would obtain fault address if the alignment is wrong.
The original bluez in Android (Froyo) has the same implementation
but doesn't suffer this issue. It is probably compiler

This issue is fixed by declare the object as DBUS_TYPE_UINT16.

7 years agoAdd Android.mk file for hidd, dund and pand.
Erin Yueh [Mon, 4 Jan 2010 04:07:58 +0000 (12:07 +0800)]
Add Android.mk file for hidd, dund and pand.

7 years agoAdd service in plugin.
Erin Yueh [Fri, 25 Dec 2009 08:35:04 +0000 (16:35 +0800)]
Add service in plugin.

7 years agoDO NOT MERGE: Ignore pause key released state only if pressed is ignored.
Jaikumar Ganesh [Tue, 11 Jan 2011 20:03:20 +0000 (12:03 -0800)]
DO NOT MERGE: Ignore pause key released state only if pressed is ignored.

Scenario: Music is playing, incoming call - headset sends pause (pressed).
That gets processed but pause release is not and then the headset
and music player get into a weird state.

Bug id: 3143711
Change-Id: I12d70f1380e121c0802c18100776ef498274c2a8

7 years agoMerge "A2dp SDP record: We only support player category." into gingerbread beagle-gingerbread
Jaikumar Ganesh [Thu, 23 Sep 2010 18:46:40 +0000 (11:46 -0700)]
Merge "A2dp SDP record: We only support player category." into gingerbread

7 years agoA2dp SDP record: We only support player category.
Jaikumar Ganesh [Mon, 20 Sep 2010 21:13:13 +0000 (14:13 -0700)]
A2dp SDP record: We only support player category.

Change-Id: I6eaf6b2ad1eb99c0c163d4d1131d851ec6781cb6

7 years agoTemporary workaround for the Play / Pause problem.
Jaikumar Ganesh [Tue, 21 Sep 2010 20:56:25 +0000 (13:56 -0700)]
Temporary workaround for the Play / Pause problem.

In lots of cases as soon as the car kit connects, we start
playing music. This is a bad user experience. We need to separate
key codes for play and pause in the media land - there is an open
bug for this. This will solve the problem but some one button
headsets send pause key when the user wants to start the music
(Sony DRB50), some send play key (Motorola S9, S7, LG, Sony HBH-DS980)
In the former case the user will have to press the key twice, the
latter will work fine. We could always have this code to check for
the class of the device (car vs headset) but thats fragile and
nothing prevents a headset from sending a pause on connection.
   We would need to implement AVRCP 1.3 and the headset would
also have to support this to get it right.
   This, I believe is a much better user experience and then our
current scenario where the music starts playing on connection.

Change-Id: Ibf6d47e32c3d8fa6d23c8913f9558e2fbd8883e6

7 years agoUpdate SDP records for AVRCP TG role.
Jaikumar Ganesh [Wed, 22 Sep 2010 17:19:27 +0000 (10:19 -0700)]
Update SDP records for AVRCP TG role.

Android only supports category 1 keys.

Change-Id: I0760b7a8f49ff9e21dbd28cb3a5ce486209a30c3

7 years agoFix Headset Audio gateway SDP record.
Jaikumar Ganesh [Mon, 20 Sep 2010 21:24:35 +0000 (14:24 -0700)]
Fix Headset Audio gateway SDP record.

Headset Audio Gateway does not have the Supported Features
in the SDP records according to the HSP specification.

8 years agoAdd local C flag for Broadcomm boards.
Jaikumar Ganesh [Wed, 15 Sep 2010 22:21:14 +0000 (15:21 -0700)]
Add local C flag for Broadcomm boards.

This is used to set ACL priorities which allows
for better A2DP streaming.

Change-Id: I8b5f651d3dd3eff400db226c56df42025795ebb8

8 years agoUpdate SDP records for OPP
Jaikumar Ganesh [Mon, 13 Sep 2010 18:50:04 +0000 (11:50 -0700)]
Update SDP records for OPP

Android doesn't support import of iCal, vNote, vMessage, vCal
at this point. So don't advertise these formats.
Based on a report by: hyungseoung.yoo@samsung.com

Change-Id: Ifa14844570b893775c45784a31cfeb24e8fd88b1

8 years agoAdd APIs for OOB Simple Secure pairing.
Jaikumar Ganesh [Fri, 3 Sep 2010 17:06:13 +0000 (10:06 -0700)]
Add APIs for OOB Simple Secure pairing.

Change-Id: Iddc784ef4d0b6e71d15a91061eca51ccbd8c266e

8 years agomerge -s ours from froyo-release so that upgrading to gingerbread is a git fast-forward
Jean-Baptiste Queru [Tue, 24 Aug 2010 02:07:53 +0000 (19:07 -0700)]
merge -s ours from froyo-release so that upgrading to gingerbread is a git fast-forward

Change-Id: I199d5b50435f5d31038287831521a73a60abbb14

8 years agoFix not unmarking temporary flag when a new key is created
Luiz Augusto von Dentz [Wed, 11 Aug 2010 13:49:27 +0000 (16:49 +0300)]
Fix not unmarking temporary flag when a new key is created

Device may have been marked as temporary so when a new key is generated
that meets the requirements to be stored it should unmark temporary flag
so the device is not removed when disconnected.

8 years agoFix not deleting stored keys when a new one is created
Luiz Augusto von Dentz [Wed, 11 Aug 2010 12:44:26 +0000 (15:44 +0300)]
Fix not deleting stored keys when a new one is created

When a new link key is created but it doesn't match any criteria to be
stored any previouly one should be removed from filesystem.

8 years agoFix version number of input plugin.
Jaikumar Ganesh [Tue, 3 Aug 2010 17:36:53 +0000 (10:36 -0700)]
Fix version number of input plugin.

Change-Id: Ie33521c2b3f0980137d14a7067bc6a72c129c0d4

8 years agoUpdate version in external project meta file.
Jaikumar Ganesh [Fri, 30 Jul 2010 23:29:03 +0000 (16:29 -0700)]
Update version in external project meta file.

Change-Id: Ieab3c0a8273d85cc4cb7223fc43b764083558881

8 years agoFix compilation issues due to upmerge to 4.69.
Jaikumar Ganesh [Fri, 30 Jul 2010 23:28:07 +0000 (16:28 -0700)]
Fix compilation issues due to upmerge to 4.69.

Change-Id: Iecfa8ea7961d35527964176e6bec70499298eec4

8 years agoUpdated header files for merge.
Jaikumar Ganesh [Fri, 30 Jul 2010 23:04:18 +0000 (16:04 -0700)]
Updated header files for merge.

Change-Id: Idf9b1a2559e4560fad84b8d29a22f5a9cec5425f

8 years agoUpdate version number to 4.69
Jaikumar Ganesh [Fri, 30 Jul 2010 22:54:40 +0000 (15:54 -0700)]
Update version number to 4.69

Change-Id: I45be9d9de4dc8b1a164ff4f4cfe1ca8f321d64ca

8 years agoadd meta-files about 3rd party projects
The Android Open Source Project [Fri, 16 Jul 2010 18:41:34 +0000 (11:41 -0700)]
add meta-files about 3rd party projects

Change-Id: I6a78c16cc55c2e76c76d4135ca4abe82b0915197

8 years agoAdd voice dailing feature to the SDP record.
Jaikumar Ganesh [Thu, 27 May 2010 16:41:46 +0000 (09:41 -0700)]
Add voice dailing feature to the SDP record.

Bug: 2719204
Dr No: Eastham / Jsh

Change-Id: I03d8d6761d8b114e2cdf95ed0fab86c7cb61e469

8 years agoFix links between lib and include directories.
Jaikumar Ganesh [Tue, 1 Jun 2010 20:54:43 +0000 (13:54 -0700)]
Fix links between lib and include directories.

The header files are maintained in the lib directory and moved to the include
directory during install. We were maintaining 2 copies which can cause
problems and bugs - the library that is linked is built out of the files
in the lib directory and the include directory is only for including
the header files in other files.

This changes removes the include directory and moves all the header
files to the lib/bluetooth directory. We don't follow upstream
but this is the closest we can get without using sym links.

Change-Id: I6e83b7a5545b4f2674076c74f22ae0ea73a52b7a

8 years agoAdd missing libbluetooth in linker commands for executables using libbluetoothd.
Doug Kwan [Tue, 18 May 2010 16:57:20 +0000 (09:57 -0700)]
Add missing libbluetooth in linker commands for executables using libbluetoothd.

Change-Id: I7b3b94c1262867b997a3c995f55e4ddfe4dfd343

8 years agoChange version Number to 4.64
Jaikumar Ganesh [Mon, 3 May 2010 22:43:50 +0000 (15:43 -0700)]
Change version Number to 4.64

Change-Id: Ia0e40f1a5cd16e2d756ce72565cc8c88bcdc1e2d

8 years agoAndroid specific path changes to Bluez.
Jaikumar Ganesh [Fri, 30 Apr 2010 17:47:40 +0000 (10:47 -0700)]
Android specific path changes to Bluez.

Update paths, Android make files, merge conflicts for the upmerge to 4.64

Change-Id: Iaf5a304ab029bafbabbcc8bc976a231bde679aeb

8 years agoFix issue 2516842 Device runtime restarts while pairing and connecting A2DP HS.
Eric Laurent [Wed, 7 Apr 2010 12:33:08 +0000 (05:33 -0700)]
Fix issue 2516842  Device runtime restarts while pairing and connecting A2DP HS.

There are several problems in liba2dp.c:

1 There is a bug in bluetooth_parse_capabilities(): the capabilities field pointer increment
in the while loop is wrong and in case the first capabilities field is not the one we need
we end up reading undefined data.
2 In the same while loop there is no protection for infinite looping if the length of the
capabilities field is 0.
3 When start or configure fail, we just reset state to A2DP_STATE_INITIALIZED to force a new
configuration attempt. This is bad as we don't close the connection and configure expects a
closed connection. Subsequent configure attempts will fail reading sbc capabilites.
4 When there is a problem executing a command in a2dp_thread() loop, we do not reset current command
which prevents from executing the same command again.

Here is what happens in this issue:
There is an error in the A2DP start request because the headset has been disconnected and we go back to configure.
Because of problem 3, the connection is still opened when we run configure again and the 1st capabilitites
field lock indicator is set. We try to read next field and because of problems 1 & 2 we end up looping here for ever.
As data->mutex is locked, it cannot be acquired by pthread_cond_timedwait() trying to exit in
wait_for_start() and the timeout mechanism fails. We stay locked here with A2dpAudioInterface::A2dpAudioStreamOut::mLock also
locked as we are in A2dpAudioInterface::A2dpAudioStreamOut:write().
When system_server tries to disable bluetooth A2DP, A2dpAudioInterface::A2dpAudioStreamOut::setBluetoothEnabled()
tries to acquire mLock and system_server is also deadlocked.

Change-Id: I785250fe65651ec6fc2ae01a4250a61f2fd43908

8 years agoAllow configure default link policy in main.conf
Bao Liang [Thu, 4 Mar 2010 02:26:47 +0000 (10:26 +0800)]
Allow configure default link policy in main.conf

Currently BlueZ is hard-coding the default link policy to include
role switch, hold mode, sniff mode and park state. However, some
device will have problem to maintain the connection or setup SCO
if they are in park state. Making these operation modes configurable
in main.conf improves flexibility so any of these four modes can be
disabled if necessary.

Signed-off-by: Bao Liang <tim.bao@motorola.com>
8 years agoIncrease A2DP flush timeout from 120ms to 200ms.
Nick Pelly [Thu, 11 Mar 2010 23:35:41 +0000 (15:35 -0800)]
Increase A2DP flush timeout from 120ms to 200ms.

This is to reduce the chance of skipping on A2DP sinks that have buffers
larger than 120ms. Changed on advice from BCM.

Change-Id: I3d6574b30b362b43e311991eb3cc41776c5f9b52

8 years agoAdd an API to set the link timeout.
Jaikumar Ganesh [Tue, 9 Mar 2010 23:35:00 +0000 (15:35 -0800)]
Add an API to set the link timeout.

Change-Id: I5abd8fc37e20a7916e84e624f883c7a1987b0587

8 years agoAdd an empty CleanSpec.mk
Jean-Baptiste Queru [Tue, 9 Mar 2010 02:04:17 +0000 (18:04 -0800)]
Add an empty CleanSpec.mk

Change-Id: I352eaaa2ba844b7c14bce1589156161c050afe34

8 years agoUpdate Bluetooth configuration path.
Jaikumar Ganesh [Fri, 26 Feb 2010 02:19:58 +0000 (18:19 -0800)]
Update Bluetooth configuration path.

8 years agoAdd option to change sco packet type in scotest.
Nick Pelly [Fri, 19 Feb 2010 00:04:42 +0000 (16:04 -0800)]
Add option to change sco packet type in scotest.

Change-Id: I5afca60a75a318e69c543d231c69e3264e0dff12

8 years agoUpdate userspace headers for SCO/eSCO packet selection in struct sockaddr_sco.
Nick Pelly [Thu, 18 Feb 2010 23:59:16 +0000 (15:59 -0800)]
Update userspace headers for SCO/eSCO packet selection in struct sockaddr_sco.

uint16_t sco_pkt_type is introduced to struct sockaddr_sco. It allows bitwise
selection of SCO/eSCO packet types. Currently those bits are:

0x0001 HV1 may be used.
0x0002 HV2 may be used.
0x0004 HV3 may be used.
0x0008 EV3 may be used.
0x0010 EV4 may be used.
0x0020 EV5 may be used.
0x0040 2-EV3 may be used.
0x0080 3-EV3 may be used.
0x0100 2-EV5 may be used.
0x0200 3-EV5 may be used.

This is similar to the Packet Type parameter in the HCI Setup Synchronous
Connection Command, except that we are not reversing the logic on the EDR bits.
This makes the use of sco_pkt_tpye forward portable for the use case of
white-listing packet types, which we expect will be the primary use case.

If sco_pkt_type is zero, or userspace uses the old struct sockaddr_sco,
then the default behavior is to allow all packet types.

Packet type selection is just a request made to the Bluetooth chipset, and
it is up to the link manager on the chipset to negiotiate and decide on the
actual packet types used. Furthermore, when a SCO/eSCO connection is eventually
made there is no way for the host stack to determine which packet type was used
(however it is possible to get the link type of SCO or eSCO).

sco_pkt_type is ignored for incoming SCO connections. It is possible
to add this in the future as a parameter to the Accept Synchronous Connection
Command, however its a little trickier because the kernel does not
currently preserve sockaddr_sco data between userspace calls to accept().

The most common use for sco_pkt_type will be to white-list only SCO packets,
which can be done with the hci.h constant SCO_ESCO_MASK.

This patch is motivated by broken Bluetooth carkits such as the Motorola
HF850 (it claims to support eSCO, but will actually reject eSCO connections
after 5 seconds) and the 2007/2008 Infiniti G35/37 (fails to route audio
if a 2-EV5 packet type is negiotiated). With this patch userspace can maintain
a list of compatible packet types to workaround remote devices such as these.

Change-Id: Ie6dc57a6a2d4ec4b42f919070d98d39f225eaf95

8 years agoRevert "Set OPUSH SDP record supported format list to 0xff (any object type)."
Nick Pelly [Thu, 4 Feb 2010 16:52:08 +0000 (08:52 -0800)]
Revert "Set OPUSH SDP record supported format list to 0xff (any object type)."

This reverts commit ee7f17f2e9bc434c04fdfe5bfab84a6c48687b7a.

8 years agobluez: Enable pand in build
San Mehat [Thu, 28 Jan 2010 01:38:15 +0000 (17:38 -0800)]
bluez: Enable pand in build

Signed-off-by: San Mehat <san@google.com>
8 years agobluez: pand: Enable android logging
San Mehat [Thu, 21 Jan 2010 18:35:35 +0000 (10:35 -0800)]
bluez: pand: Enable android logging

Signed-off-by: San Mehat <san@google.com>
8 years agobluez: Add Android.mk for pand (off by default)
San Mehat [Thu, 21 Jan 2010 18:19:39 +0000 (10:19 -0800)]
bluez: Add Android.mk for pand (off by default)

Signed-off-by: San Mehat <san@google.com>
8 years agoUse monotonically increasing clock for A2DP timing.
Nick Pelly [Thu, 17 Dec 2009 11:12:26 +0000 (03:12 -0800)]
Use monotonically increasing clock for A2DP timing.

This is to avoid skips when the system time changes.

8 years agoStop trying to send A2DP packets quickly to catch-up on missed write()'s after
Nick Pelly [Tue, 15 Dec 2009 00:55:17 +0000 (16:55 -0800)]
Stop trying to send A2DP packets quickly to catch-up on missed write()'s after
falling behind by 200ms, or on poll() timeout.

This allows us to recover more quickly from a situation where an A2DP headset
rejects A2DP packets for a short time. We now reset to regular packet metering

8 years agoChanges flush timeout from 60 ms to 120 ms.
Nick Pelly [Thu, 10 Dec 2009 00:20:28 +0000 (16:20 -0800)]
Changes flush timeout from 60 ms to 120 ms.

Less A2DP drop-outs due to unnecessary flushing.

BCM recommend 120-150ms for lazy flushing.

8 years agoFix liba2dp.c compiler warnings.
Nick Pelly [Wed, 9 Dec 2009 09:25:41 +0000 (01:25 -0800)]
Fix liba2dp.c compiler warnings.

8 years agoSet A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic
Nick Pelly [Wed, 9 Dec 2009 09:23:43 +0000 (01:23 -0800)]
Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic
flush timeout.

Remove the (ahead < 0) logic that was designed to skip forwards when streaming
was lagging. This logic was not working properly, and ACL flushing does its

8 years agoAdd L2CAP_LM_FLUSHABLE to Bluez header.
Nick Pelly [Wed, 9 Dec 2009 09:18:22 +0000 (01:18 -0800)]
Add L2CAP_LM_FLUSHABLE to Bluez header.

8 years agoAdd ACL flow control state (MTU, packets available, packets total) for debug.
Nick Pelly [Wed, 9 Dec 2009 09:09:36 +0000 (01:09 -0800)]
Add ACL flow control state (MTU, packets available, packets total) for debug.

Accessed with the debug tool 'hcitool con'

8 years agoSend SBC frames if output buffer is nearly full.
Yu Kang Ku [Thu, 5 Nov 2009 18:49:48 +0000 (10:49 -0800)]
Send SBC frames if output buffer is nearly full.

This is to address an A2DP issue seen with the Mazda carkit, where A2DP audio
cannot be played. The MTU size (8200) requested by this carkit is much greater
than the output buffer size (2048) allocated by the Bluez A2DP profile. The
output buffer being full is giving an SBC encode error. This patch checks for
the buffer full condition.

Change-Id: Idded504d085c760baef15cd3cef84fcf57165e4f
Signed-off-by: Yu Kang Ku <kang.ku@motorola.com>
Signed-off-by: Nick Pelly <npelly@google.com>
8 years agoAdd support for sending Broadcom coexistance setup commands for A2DP links.
Nick Pelly [Sat, 31 Oct 2009 01:18:33 +0000 (18:18 -0700)]
Add support for sending Broadcom coexistance setup commands for A2DP links.

Enabled on platforms with BOARD_HAVE_BLUETOOTH_BCM.

Change-Id: Ic223955ac3580e5a9430f96e069f686a7afdbef8

8 years agoBluetooth A2DP suspend-resume improvements.
Eric Laurent [Fri, 16 Oct 2009 16:22:50 +0000 (09:22 -0700)]
Bluetooth A2DP suspend-resume improvements.

This change will reduce the occurence rate of A2DP sink suspend resume failures observed in issues 2184627, 2181005 and possibly 2189628.

Avoid lockups in case of BT device disconnection during the A2DP start process by using a timeout when reading from bluetooth command socket.
Correct a typo causing potential deadlock in wait_for_start().

8 years agoAdd DBUS interfaces AddRfcommServiceRecord() and RemoveServiceRecord().
Nick Pelly [Thu, 1 Oct 2009 02:09:58 +0000 (19:09 -0700)]
Add DBUS interfaces AddRfcommServiceRecord() and RemoveServiceRecord().

org.bluez.Adapter.AddRfcommServiceRecord takes a name, uuid and channel
and creates a record like:

Service Name: MyApplication
Service RecHandle: 0x10009
Service Class ID List:
  UUID 128: 42999bc0-ac5e-11de-8a39-0800200c9a66
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 26

It returns the integer Record Handle, that can be used with
org.bluez.Adapter.RemoveServiceRecord to remove that record.

Bug: 2158900
DrNo: eastham

Change-Id: Ie375d5ccd24b5faf067a26b8a04a1449b3f56ce2

8 years agoRemove redundant call to bluetooth_init().
Nick Pelly [Wed, 30 Sep 2009 18:35:21 +0000 (11:35 -0700)]
Remove redundant call to bluetooth_init().

This is a cleanup to Ian Kent's preceeding patchset.

Change-Id: I8ff00530fdd337873ff898b7fd9009b0fc13f0b4

8 years agoAdd Bluetooth A2DP suspend/resume to DBUS API.
Zhu Lan [Tue, 23 Jun 2009 08:04:09 +0000 (16:04 +0800)]
Add Bluetooth A2DP suspend/resume to DBUS API.

Change-Id: Icef1729957ed55e491e63d74d14a2c0c93984c4d

8 years agobluez a2dp - use a sensible write timeout
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - use a sensible write timeout

The 500 msec write timeout is extremely optimistic, a 1000 msec
timeout is closer to reality.

8 years agobluez a2dp - fix wait_for_start() spurious wakeup
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - fix wait_for_start() spurious wakeup

When waiting on a condition is is possble to receive spurious
wake ups. Deal with this in wait_for_start().

Change-Id: I678e9d7831333d9b8baa31e9b0ec2597ca9263cd

8 years agobluez a2dp - fix wait_for_start() synchronization
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - fix wait_for_start() synchronization

On entry to wait_for_start() it's possible we are in state
A2DP_STATE_NONE if a2dp_thread() has not completed bluetooth_init().
Also, we call the pthread_mutex_*() functions more frequently than
we really need to.

Move the mutex locking outside the loop and let condition wait
take care of the locking. Also move the A2DP_STATE_NONE check
below the condition wait so we can be sure the state machine
has been poked before we test it.

Change-Id: I020bea365a623e88cb1a5f7e5fccd8f8aa948518

8 years agobluez a2dp - destroy thread attr after thread create
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - destroy thread attr after thread create

Pthread resources may be used by the thread attributes object.
We should destroy this after thread creation.

8 years agobluez a2dp - destroy thread resources at exit
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - destroy thread resources at exit

The dynamically created pthread mutex and condition variables
consume pthread resources. They should be destroyed prior to
freeing the structure containing them.

8 years agobluez a2dp - fix a2dp_thread() spurious wakeup
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - fix a2dp_thread() spurious wakeup

When waiting on a condition is is possble to receive spurious
wake ups. Use the fact that when we poke the state machine the
command must have changed to deal with this.

Change-Id: I0ed2f2a15c15dea30cb1d5cf3b67c8549d6802d4

8 years agobluez a2dp - fix state machine synchronization
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - fix state machine synchronization

Using a worker thread implementation for A2DP means that if we don't
have some way to syncroniize state transitions we can get overlap of
requested command functions or lost signals. In order for the A2DP
state machine to function each command operation must complete before
the next is initiated or we will get errors caused by these out of
sequence commands. And if we signal the thread when it is not waiting
on the condition the signal will be missed.

This could be partly resolved by implementing a queue but then there
is an overhead with also implementing a wait mechamism for state
transitions. It's much easier and simpler to just hold the mutex
during command processing which also deals with the lost signals issue.
This may well not achieve the original goal of the worker thread
implementation but neither would a queue implementation. It looks
like this is just the way things are!

8 years agobluez a2dp - syncronize worker thread start
Ian Kent [Mon, 28 Sep 2009 15:47:43 +0000 (23:47 +0800)]
bluez a2dp - syncronize worker thread start

There is an order of execution assumption made when starting the
a2dp worker thread. Add an additional condition variable to allow
us to make sure we have reached the thread_wait condition wait
before returning from a2dp_init().

8 years agoFix agent_free call due to the picking up of upmerge fixes.
Jaikumar Ganesh [Tue, 29 Sep 2009 01:05:23 +0000 (18:05 -0700)]
Fix agent_free call due to the picking up of upmerge fixes.

Change-Id: Ia0a12ec45dd498572e4a4f2354d383ba5ea436ce

8 years agoAdd new Agent API : RequestPairingConsent.
Jaikumar Ganesh [Fri, 4 Sep 2009 20:26:40 +0000 (13:26 -0700)]
Add new Agent API : RequestPairingConsent.

This callback will be called for incoming pairing requests for 2.1
devices only when the remote IO capabilities are NoInputNoOutput
or DisplayOnly and the local IO capability is DisplayYesNo.
Currently, we were silently auto accepting.

8 years agoDo not advertise Voice Recognition support in HF AG SDP record.
Nick Pelly [Tue, 1 Sep 2009 17:20:07 +0000 (10:20 -0700)]
Do not advertise Voice Recognition support in HF AG SDP record.

8 years agoChange UART speed before Bluetooth firmware download.
James Luan [Fri, 28 Aug 2009 18:23:33 +0000 (13:23 -0500)]
Change UART speed before Bluetooth firmware download.

8 years agoDon't bail out if Discovery is in progress when getting the rfcomm channel.
Jaikumar Ganesh [Tue, 25 Aug 2009 20:47:59 +0000 (13:47 -0700)]
Don't bail out if Discovery is in progress when getting the rfcomm channel.

We should be having the SDP record in the cache. In the very rare
case, that the remote device's SDP records have changed and if a discovery
is in progress, we would have already updated the cache or if we have not
queried the device yet, we are going to fail anyways.

8 years agoChange version number to 4.47.
Jaikumar Ganesh [Wed, 19 Aug 2009 23:21:57 +0000 (16:21 -0700)]
Change version number to 4.47.

8 years agoDon't advertise AVRCP Controller support in SDP records.
Nick Pelly [Tue, 18 Aug 2009 23:43:31 +0000 (16:43 -0700)]
Don't advertise AVRCP Controller support in SDP records.

We are a AVRCP 1.0 target, not a controller.

This is identical to the change we applied to Bluez 3.x

8 years agosbc: Enable neon optimizations.
Mike Lockwood [Thu, 16 Jul 2009 00:27:50 +0000 (20:27 -0400)]
sbc: Enable neon optimizations.

Signed-off-by: Mike Lockwood <lockwood@android.com>
8 years agodisable neon extras until they build properly
Mike Reed [Tue, 14 Jul 2009 15:33:18 +0000 (11:33 -0400)]
disable neon extras until they build properly

8 years agoAdd A2DP_INIT command and state.
Jaikumar Ganesh [Fri, 10 Jul 2009 02:05:12 +0000 (19:05 -0700)]
Add A2DP_INIT command and state.

In bluez4, when a device is unpaired the socket end is freed and
so we will get a EPIPE when we write to it, this causes us to call
bluetooth_close. On the next write, we don't call bluetooth_init.

The logic here is thati, if the state is A2DP_STATE_NONE and we
are waiting for BLUETOOTH_START state, we need to call bluetooth_init.
The ENODEV case is where the other end, doesn't exist, and we are
trying to write repeatedly, which means the problem is elsewhere.
When we start initially (i.e the first time) when a2dp_set_sink is called,
we used to directly set the command to configure and the a2dp_thread used to
call bluetooth_init. This fix makes this a separate state and step.
  1. A2DP music playing, turn BT off. Turn BT open, A2DP should work.
  2. A2DP music playing, disconnect. On reconnection, it should work.
  3. A2DP music playing, cause a crash in bluetoothd. On restart, it should
  4. A2DP music playing, remote end powers down. On power up, it should work.
  5. A2DP music playing, disconnect and unpair. On repair and reconnect,
     it should work.
Tested with 2 headsets and with the troublesome HBH-DS790.

8 years agoliba2dp: Fix timeout computation in wait_for_start()
Mike Lockwood [Fri, 19 Jun 2009 17:11:33 +0000 (13:11 -0400)]
liba2dp: Fix timeout computation in wait_for_start()

Also increase a2dp_write timeout from 100ms to 500 ms
to avoid losing the first fraction of a second of a song
when streaming starts.

This is a manual integration of commit cb75ad7a5a708a6a1f593cddb745f1c0460676c6
from donut.

Signed-off-by: Mike Lockwood <lockwood@android.com>
8 years agoRead the error code separately in a recv call.
Jaikumar Ganesh [Thu, 18 Jun 2009 18:41:53 +0000 (11:41 -0700)]
Read the error code separately in a recv call.

Read the error code in a new recv call. Trying to read more data
than required to cover the error scenario was causing problems
when a NEW STREAM was being started.

8 years agoCorrect the buggy return instruction.
Jing Yu [Thu, 18 Jun 2009 07:23:02 +0000 (00:23 -0700)]
Correct the buggy return instruction.

8 years agoChange sdp socket path to be compatible for Android.
Jaikumar Ganesh [Wed, 17 Jun 2009 21:09:08 +0000 (14:09 -0700)]
Change sdp socket path to be compatible for Android.

8 years agoRead BT_SUGGESTED_BUFFER_SIZE bytes in recv call.
Jaikumar Ganesh [Mon, 15 Jun 2009 23:58:50 +0000 (16:58 -0700)]
Read BT_SUGGESTED_BUFFER_SIZE bytes in recv call.

In Bluez4, the error code has been moved out of the response
structure into a new structure bt_audio_error_t. We were only
reading sizeof(bt_audio_msg_header_t) and hence the 1 extra bytes
gets read on the next call and our state machine gets screwed up.
Fixed some tab / spaces issue.

8 years agoAdd capabilities to bluetoothd.
Jaikumar Ganesh [Thu, 11 Jun 2009 20:37:55 +0000 (13:37 -0700)]
Add capabilities to bluetoothd.

As android init.rc doesn't support applying linux capabilities,
add them after starting the bluetooth daemon as root.

8 years agoAdd Android system properties to set the device name, set sampling frequency.
Jaikumar Ganesh [Wed, 10 Jun 2009 21:11:07 +0000 (14:11 -0700)]
Add Android system properties to set the device name, set sampling frequency.

1)Add support for ro.produce.model/brand/name system properties.
2)Set SBC frequency to 44100.

8 years agoDisable btiotest and hciemu to reduce space.
Jaikumar Ganesh [Wed, 10 Jun 2009 01:43:38 +0000 (18:43 -0700)]
Disable btiotest and hciemu to reduce space.

8 years agoMake android specific changes to bluez4.
Jaikumar Ganesh [Fri, 5 Jun 2009 00:52:15 +0000 (17:52 -0700)]
Make android specific changes to bluez4.

a) Add Android.mk files
b) Change conf files
c) Add liba2dp.c
d) Some tweaks to get it to build.

8 years agoRelease 4.69
Marcel Holtmann [Tue, 13 Jul 2010 20:55:47 +0000 (17:55 -0300)]
Release 4.69

8 years agoAdd ledc command to hcitool
Vinicius Costa Gomes [Tue, 13 Jul 2010 20:28:20 +0000 (17:28 -0300)]
Add ledc command to hcitool

This command allows for low-level LE connections to be disconnected
by handle.

8 years agoFix missing whitespace in telephony-maemo6
Johan Hedberg [Tue, 13 Jul 2010 20:31:06 +0000 (17:31 -0300)]
Fix missing whitespace in telephony-maemo6

8 years agotelephony-maemo6: add ClearLastNumber method
Luiz Augusto von Dentz [Tue, 13 Jul 2010 13:22:16 +0000 (16:22 +0300)]
telephony-maemo6: add ClearLastNumber method

ClearLastNumber can be called to indicate the driver to clear the last
dialed number

8 years agoMake FindAdapter() accept lower-case hex addresses
Elvis Pfützenreuter [Tue, 13 Jul 2010 18:46:22 +0000 (15:46 -0300)]
Make FindAdapter() accept lower-case hex addresses

8 years agoRefuse connections if no NAP server is registered
Marcel Holtmann [Tue, 13 Jul 2010 14:21:26 +0000 (11:21 -0300)]
Refuse connections if no NAP server is registered

8 years agoHandle network server application disconnects
Marcel Holtmann [Tue, 13 Jul 2010 13:50:18 +0000 (10:50 -0300)]
Handle network server application disconnects

8 years agoUse "Network service" for network SDP record description
Marcel Holtmann [Tue, 13 Jul 2010 13:40:55 +0000 (10:40 -0300)]
Use "Network service" for network SDP record description

8 years agoAdd support for starting/stopping network NAP server
Marcel Holtmann [Tue, 13 Jul 2010 13:30:36 +0000 (10:30 -0300)]
Add support for starting/stopping network NAP server

8 years agoRemove last crufts of overbloated network configuration
Marcel Holtmann [Tue, 13 Jul 2010 12:57:25 +0000 (09:57 -0300)]
Remove last crufts of overbloated network configuration

8 years agoRemove unused network configuration disable checking
Marcel Holtmann [Tue, 13 Jul 2010 12:54:50 +0000 (09:54 -0300)]
Remove unused network configuration disable checking

8 years agoAdd test script for testing NAP network server
Marcel Holtmann [Tue, 13 Jul 2010 03:13:03 +0000 (00:13 -0300)]
Add test script for testing NAP network server

8 years agoAdd a few more comments for network server and BNEP + SDP relations
Marcel Holtmann [Tue, 13 Jul 2010 03:05:43 +0000 (00:05 -0300)]
Add a few more comments for network server and BNEP + SDP relations

8 years agoDon't show an error if network.conf is not available
Marcel Holtmann [Tue, 13 Jul 2010 03:00:44 +0000 (00:00 -0300)]
Don't show an error if network.conf is not available

8 years agoRemove double g_option_context_free() call
Marcel Holtmann [Tue, 13 Jul 2010 02:59:34 +0000 (23:59 -0300)]
Remove double g_option_context_free() call

8 years agoProvide only new network server D-Bus API
Marcel Holtmann [Tue, 13 Jul 2010 02:56:49 +0000 (23:56 -0300)]
Provide only new network server D-Bus API

8 years agoRemove the crufty old attempt for network server API
Marcel Holtmann [Tue, 13 Jul 2010 02:50:22 +0000 (23:50 -0300)]
Remove the crufty old attempt for network server API

8 years agoRemove unused options from network example configuration
Marcel Holtmann [Tue, 13 Jul 2010 02:46:49 +0000 (23:46 -0300)]
Remove unused options from network example configuration

8 years agoRemove some outdated server code from network plugin
Marcel Holtmann [Tue, 13 Jul 2010 02:46:09 +0000 (23:46 -0300)]
Remove some outdated server code from network plugin

8 years agoAdd API description for network server interface
Marcel Holtmann [Tue, 13 Jul 2010 02:08:19 +0000 (23:08 -0300)]
Add API description for network server interface

8 years agoAdd handle and timeout parameters to hci_le_create_conn
Vinicius Costa Gomes [Fri, 9 Jul 2010 22:33:49 +0000 (19:33 -0300)]
Add handle and timeout parameters to hci_le_create_conn

Now hci_le_create_conn is more consistent with hci_create_conn, both
have a handle out parameter and a timeout.

8 years agoFix naming inconsistency for LTK Reply command
Vinicius Costa Gomes [Mon, 12 Jul 2010 22:37:54 +0000 (19:37 -0300)]
Fix naming inconsistency for LTK Reply command

For simplicity sake, the "request" part of the name was dropped,
for it is already implied by its cause.