Bluetooth:Bluez: Merge bluez changes from froyo to Gingerbread

commit 25f7ad657f5a76f56356d9940819c20edf2991a3
Author: Royston Rodrigues <roystonr@codeaurora.org>
Date:   Fri Dec 10 10:10:18 2010 +0530

    Bluetooth: A2DP reconfigure with BMW Carkit (supporting multi-streams) timeouts

            When stream is closed for reconfiguration, the previously closed stream should
            be reconfigured when the remote device supports mutli-streams.

    Change-Id: I273337798e363c395b7e1be332563e61162909f7
    CRs-fixed: 263242
    (cherry picked from commit 0ba19909b9fbfd1a9790a47d6d0ca4c429a9560f)

commit fbe8b0bba18a39c20e58d31a1cfd7d1ed17cc25d
Author: Ron Shaffer <rshaffer@codeaurora.org>
Date:   Thu Oct 28 08:39:25 2010 -0400

    Bluetooth: Fix bad copyright marking

    Change-Id: Ib4986f65d31e0ce449ab604c4a8e2ee084394fef
    (cherry picked from commit a8f69c132694665209a436c440bca38b61def80b)

commit e5e129748246fb758d44dd4975e169a8386af23c
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 16:45:33 2010 +0530

    Bluetooth: Change default HSP AG version to 1.2 in SDP record for Android

    Change-Id: I01bc4cb14f910cec62e2d2522039f65cccc14123
    CRs-fixed: 260632
    (cherry picked from commit c395a3ea2df7278cb611f6ed9dd6c9be29bc51e2)

    Conflicts:

       tools/sdptool.c

commit 3faf461b950776d2992967cc6d2e7b31156a291e
Author: Inga Stotland <ingas@codeaurora.org>
Date:   Tue Oct 19 11:12:06 2010 -0700

    Bluetooth: Fix out-of-bound memory access

    Correct access to elements of UUID128 array.

    Change-Id: I20d76294e1e472b23e650af1df87476ad6ea7924
    (cherry picked from commit ea5d6e7324d99bc59ab48e36b93250aab1753909)

commit 7fef23019442e8e0c4984333e11b8e515d9efb17
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 16:43:08 2010 +0530

    Bluetooth: Add service UUIDs from EIR to properties in "Device Found" signal.

    If service UUIDs are present in EIR, they are written to
    "device properties" dictionary  when emitting "Device Found" signal.
    This allows peek at available services offered by a remote device
    without establishing SDP connection.

    Change-Id: Ia6ed8f80e9c8b5093f33f8638adc22115d1e552c
    (cherry picked from commit 07182e12fff31c1a0728335ef20c2b9f16e929cf)

    Conflicts:

       src/dbus-hci.c

commit f61585b85304b248a87a2177aefde6e01c5eb895
Author: Inga Stotland <ingas@codeaurora.org>
Date:   Mon Aug 23 14:42:38 2010 -0700

    Bluetooth: Handle arrays in device properties dictionary.

    Change-Id: I4ce8165b6e988955d21f37e53c6a4d5d53e0f793
    (cherry picked from commit 95c0d78297880609e62327ec3fb8f20dbd77a00a)

commit d25d3dee2fe6689a06ef5a14bcd4da62dba0bea4
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 16:39:35 2010 +0530

    Bluetooth: Support for adding UUID128 to extended inquiry response.

    Change-Id: I9deb9e0675b691e03d624d4d77be8cf696740c62
    (cherry picked from commit 4b2402b7621205dfc59c7976a18e016bfc13448a)

    Conflicts:

      src/sdpd-service.c

commit 2b773b7d5b4ccbd989440d8f8838a63db4170039
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 16:32:09 2010 +0530

    Bluetooth: Clean up code that generates extended inquiry response.

    Change-Id: I124b4ed4920c13802f9912adc3fdbe3428ed68a5
    (cherry picked from commit 04f6109efcb98ef65d16384fbefa1394a9c8749a)

    Conflicts:

        src/sdpd-service.c

commit b973f2e26546322c840788e407cf65f9ff236214
Author: Inga Stotland <ingas@codeaurora.org>
Date:   Mon Aug 23 12:02:16 2010 -0700

    Bluetooth: Minor fix when skipping duplicate UUID16 from EIR.

    Change-Id: I8f3abd3e4513830b9d378b7c6da26976075c23f3
    (cherry picked from commit b430070c4bca3b64b8c14dd8e02c6703c81eee17)

commit 9ec6db89c850d1fccfcfdc716ff15973f51a5eb5
Author: Inga Stotland <ingas@codeaurora.org>
Date:   Mon Aug 23 12:00:34 2010 -0700

    Bluetooth: Spec constants for Extended Inquiry Response field types

    Change-Id: I843823aeea9332254793ba4128b0ae8e83314443
    (cherry picked from commit 1c6bd7a52d7f2d49949a93a6c6393cfd4df26d92)

commit 625b3222837834ef399b315bbfebfe741b491a91
Author: Inga Stotland <ingas@codeaurora.org>
Date:   Fri Aug 20 11:31:37 2010 -0700

    Bluetooth: Enable glib for service plugin

    Re-enable linking with glib for sdp service plugin

    Change-Id: I6a17c722925fc31ea9d6ac52b709431c4f3ed239
    (cherry picked from commit e7545794af4865ca300ea36d4e6057ccf8082938)

commit da50433839ea531430493b3264823350fe367f77
Author: Angela Bartholomaus <angelab@codeaurora.org>
Date:   Thu Aug 12 16:46:37 2010 -0700

    Bluetooth: Send an Invalid PDU Size Error Response for Service Attr Req

    Send error code for an SDP SAR request received with an invalid PDU size

    Change-Id: I9b97a35648ce7cac9e98ab86b2b14a3f8256e381
    CRs-fixed: 247766
    (cherry picked from commit 1c44516ef695721833d5890bfb09c25fe3cbfd78)

commit eeadad87094b1afccff557af54ff201274a9d908
Author: Angela Bartholomaus <angelab@codeaurora.org>
Date:   Thu Aug 12 16:38:08 2010 -0700

    Bluetooth: Send an Invalid PDU Size Error Response for Service Search Req

    Send error code for an SDP SSR req received with an invalid PDU Size

    Change-Id: I821a9ff8de797d640dd5a033b9e22e29912638c0
    CRs-fixed: 247767
    (cherry picked from commit 804728bf0e4be2096fc69f80427d197168134630)

commit e8bf50468cd158e01b4b9bc5098db87ef5ead8c2
Author: Angela Bartholomaus <angelab@codeaurora.org>
Date:   Thu Aug 12 16:33:25 2010 -0700

    Bluetooth: Send an Invalid PDU Size Error Response for Service Search Attr Req

    Send error code for an SDP SASR request received with an invalid PDU size.

    Change-Id: I0152af10e5923f17dcb917c67c73c69494dbd4d6
    CRs-fixed: 247761
    (cherry picked from commit 01676f0190ba1385f07d6e90a5932c09fd5294a5)

commit 61a8089bde9065365a7f52c2fbe9a20aa3484d8f
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 16:26:48 2010 +0530

    Bluetooth: Send Invalid Syntax Error if Resp Size will Be Less Than 7 Octets

    Added in error catching, when a badly formed request comes in.

    Change-Id: I9eab5708dfe943bd15e2bf2cd31b897c172384cc
    CRs-fixed: 248006
    (cherry picked from commit 89debbadeefd43d06432626eb93b49887cd4082b)

    Conflicts:

        src/sdpd-request.c

commit 7e945381ca260f58a9244b5e940e214b4d515658
Author: Angela Bartholomaus <angelab@codeaurora.org>
Date:   Tue Jul 27 10:13:35 2010 -0700

    Bluetooth: Added in support for uint16 data types to sdptool cmds

    "16:0x" in front of the "setseq" or "setattr" data for sdptool adds in uint16

    Change-Id: I93de617dc69fc4100ff073ece460f7020c39176f
    CRs-fixed: 247762
    (cherry picked from commit 3715f0594e04678970cd16da7f8300dedfa7064c)

commit 8c236b4a4f01b6e85364c71409bff7ced4bfcada
Author: Angela Bartholomaus <angelab@codeaurora.org>
Date:   Tue Jul 27 09:49:58 2010 -0700

    Bluetooth: Added in support for uint8 data types to sdptool cmds

    "8:0x" in front of the "setseq" or "setattr" data for sdptool adds uint8 type

    Change-Id: I0a5e9853edfba369454f1e272436ad26c8902735
    CRs-fixed: 247762
    (cherry picked from commit b6f63bbf37de0d230b0cac9a5bd5db7f25dba69b)

commit 0353e9d40cfe981e340394b3623293ec2ba25417
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 16:20:07 2010 +0530

    Bluetooth: Added in support for adding in url sdp data

    "setattr" sdptool cmd allows adding in url data using "url:" in front of data

    Change-Id: I109450c5d6f921803eec79264556d3c1e7dbb22f
    CRs-fixed: 247760
    (cherry picked from commit 2f4aabd873cceb86cb209f5f835c2d1e2505a4b5)

    Conflicts:

       tools/sdptool.c

commit 473ea9e6a622347d33dc43c01197c58e9228ef97
Author: David Scherba <dscherba@codeaurora.org>
Date:   Wed Jun 9 15:14:10 2010 -0400

    Bluetooth: Expose dynamic control of SCMS-T CP header

    Added a2dp_set_cp_header() API to liba2dp to allow for dynamic, programmatic
    control of the A2DP SCMS-T content protection header.

    When SCMS-T is not being used, calling a2dp_set_cp_header() has no effect on
    the media stream.

    The default SCMS-T setting remains "copy not allowed."

    CRs-fixed: 242514
    Change-Id: Id41983563759f36c9cac50b941915ee02e6f40a9
    (cherry picked from commit 64fec5c690dec84e78d79a2ea5bd42c3625839cf)

commit 37b318ae064666c75b57fe7169709f04bbb88532
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 16:13:37 2010 +0530

    Bluetooth: Fixing runtime SCMS-T content protection support for A2DP

    Fixed the org.bluez.AudioSink.RequireProtection D-Bus method implementation
    to have a void return.

    Moved the compile-time SCMS-T require protection setting to A2DP sink
    initialization instead of A2DP sink connect--the former allows for nicer
    interoperability between compile-time and runtime operation.

    Change-Id: Ib409923ff58b39495273415bf8f5d566531b1aba
    (cherry picked from commit b022ee07cbffc57620480feebb54932a1c802cff)

    Conflicts:

       audio/sink.c

commit 2c2b4f9df4cfd9008a46a00d0d293bbb4962a9c4
Author: Ron Shaffer <rshaffer@quicinc.com>
Date:   Thu Mar 4 09:51:30 2010 -0600

    Bluetooth: Resolve audio and video out of sync when BT A2DP headset disconnects

    Modified avdtp_write to pace sending of sbc frames even after the AVDTP socket
    has been closed to prevent liba2dp from consuming audio frames faster than they
    are played in real time.
    (cherry picked from commit 6398a8a52b8068f87e7258829fcc1b08310c5fdf)

commit 909b6876d685991db874a357e27d93982ff3d5dc
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 16:00:46 2010 +0530

    Bluetooth: Adding SCMS-T content protection support to A2DP

    Default behavior is to neither negotiate, nor support SCMS-T
    content protection capability.
    (cherry picked from commit 565147066190fb97aeec60026fbc3628d8f6b0ef)

    Conflicts:

        audio/a2dp.c
        audio/avdtp.c
        audio/avdtp.h
        audio/ipc.h
        audio/sink.c

    Change-Id: I9bc70003f95a7ab890d83bb6ac39aa2975186ff4

commit b9f77441bf2000bd74b82a60652cfb449355b028
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>
Date:   Mon Dec 20 14:53:33 2010 +0530

    hciattach: add Qualcomm In-Band Sleep support

    This adds two Bluetooth controller types "qualcomm" and "qualcomm-ibs"
    to the supported controller types list and claims HCI UART protocol
    number 5 for "qualcomm-ibs".  This corresponds the kernel tty line
    discipline configured as HCIUART_IBS, which supports Qualcomm's
    Software In-Band Sleep protocol.

    Change-Id: I06db4e4993ac820f14f7c8d8e956295a7e72b90a
    (cherry picked from commit d4d228eb4cee2e12c09aae952fa37736c29794af)

    Conflicts:

       tools/hciattach.c
       tools/hciattach.h

Change-Id: Ie172d3bc20e11712b9c1be8bd783119697ba8e52
Bluetooth: Remove stored link key on auth fail of remote device

Signed-off-by: Rakesh KrishnaMoorthy <rakeshk@codeaurora.org>

Change-Id: I00cdc0899cac9e7a01d5bfcbaf34e190590ec8f0

CRs-Fixed: 271285
Bluetooth: Disconnect temporary device if connected

The fix handles the disconnect of a temporary device, if the
temporary device is connected to the DUT when user initiates
a remove bond from Bluetooth settings

Change-Id: I26b28c673cd07a9aab47953c5f8ddd06a931cc49
Signed-off-by: Rakesh KrishnaMoorthy <rakeshk@codeaurora.org>

CRs-Fixed: 269555
Merge "Bluetooth: Disconnect temporary device if connected" into gingerbread
Bluetooth: Add SDP request timeout

This handles the case when bluez doesn't gets the response of SDP
request sent from device_browse. Timeout is currently set to 30sec

CRs-Fixed: 270207
Change-Id: Ifda062a51af799e6589fd30bb47e29c3fdebc057
Signed-off-by: Ankit Verma <ankitv@codeaurora.org>
Bluetooth : Add MAP service records into SDP tool

Change-Id: I17b1155128fe6b24d910ba22d25d9c1c45654309
Merge commit 'android-2.3.3_r1' into gingerbread
Bluetooth: Initialize session variables to NULL

when session structure is initialized,  session->pending_open
is not initialized to NULL. This results in null check failure
while setting the avdtp connection and stack crashes. Hence
initializing this variable to NULL

Change-Id: I8e61c6beeac8f48b6e1648eb7c1a36f17d76c72a
CRs-Fixed: 274708
Merge "Bluetooth: Initialize session variables to NULL" into gingerbread
Merge "Merge commit 'android-2.3.3_r1' into gingerbread" into gingerbread
Bluetooth : Change of MasInstance type in SDP for Bluetooth MAP Profile

Change-Id: I5235ada12ea626b732204c05a9da4cd9729a7500
CRs-fixed: 277602
BT3.0+HS feature development.

Adds handling for AMP HCI devices, extended window size, AMP socket
option, and ERTM updates.

Change-Id: Ifd4e423d1f3dae909e408fc58392343984377515
Bluetooth: Updating kernel about linkkey auth info.

Kernel is not aware about level of security that a
link-key provides when userspace responds to the
link key request. Adding a function call to update
the kernel space auth_key's level of security as soon
as userspace responds to the link key request.

CRs-fixed: 264601
Change-Id: I6cb4dfc81f504febd354d09ecc7c82b2cc04
Signed-off-by: NaveenKumar <naveenr@codeaurora.org>
Fixes for x86 compilation.

Change-Id: I49c2405b1b28e2dac85da63ebab8e60354814398
Bluetooth: Update the BT_AMP_POLICY L2CAP protocol option

The change updates the BT_AMP_POLICY protocol option to be
compatible with the protocol option ID part of kernel bluetooth
headers. The Proto ID 8 is used by a new protocol option provided
by Google in the latest updates for BlueZ 4.69

Change-Id: Ibe1dc35577c4a9dded07e0a57777e30ae8059ea1
Bluetooth: Changes to reject category-2,3,4 AVRCP commands

Android-Bluez supports only AVRCP category-1 as Target. But Bluez
accepts all category commands even though there is no action performed.
This change make sure that Bluez rejects category-2,3,4 AVRCP commands.

Change-Id: I91be79e4a4752c5a06184466247b63030ca8f1c7
CRs-fixed: 280756
Bluetooth: Fix and enhancement for SDP

Fix for losing secondary service class ID
Add for getting additional Protocol Description List api for SDP
Add for getting document formats api for SDP

Change-Id: I5dab1e2445b29d1fdffbed5d761f1058e1674884
Bluetooth: Fix to include service plugin

Need to include descriptor for service plugin.

(cherry picked from commit 082a80f44ab793b3666b4b90e2be5302d15ad7eb)

Change-Id: I4503664f69f546a10e6a05a03e9bdf216103d295
Use 'dev->legacy' instead of 'legacy' when updating existing device info.

This error was introduced when merging QuIC froyo change to gingerbread.
When building on x86, the compiler flagged an uninitialized variable
warning on the use of 'legacy' here.  On reviewing the commit history,
'dev->legacy' is the correct variable to use.

Change-Id: I837989bb8c5cb71ffb9508a625ab240188a1bb76
Fix compiler warnings and build errors identified on x86.

No functional changes.  Several x86 compiler warnings were fixed,
including unused variables, labels, type qualifiers, an unused
function, and a missing declaration.  "#ifdef ANDROID" was also added
around some Android-only code, and the Makefile (not used in Android)
was adjusted to account for current header file locations.

Change-Id: I38d60b1b270a95e1d2e95845b9864d2c85324105