OSDN Git Service

android-x86/system-bt.git
9 years agoWork around clang/llvm compilation problems.
Chih-Hung Hsieh [Mon, 4 May 2015 19:12:39 +0000 (12:12 -0700)]
Work around clang/llvm compilation problems.

These patches will allow us to compile the whole AOSP with clang/llvm
before all the following problems are fixed.
* Suppress warnings on unused variables.
  * Remove unused static variables.
* Use only gcc to compile code that requires gcc atomic functions.
  They should be converted to standard atomic functions later.
* Suppress warnings on redefined typedefs.

BUG: 20765701
Change-Id: I19bc0a256c19502fabcabd1ca158637a8b5741a2

9 years agoMerge "Ensure PAN is initialized before invoking callbacks" into mnc-dev
Andre Eisenbach [Tue, 5 May 2015 19:36:12 +0000 (19:36 +0000)]
Merge "Ensure PAN is initialized before invoking callbacks" into mnc-dev

9 years agoEnsure PAN is initialized before invoking callbacks
Andre Eisenbach [Tue, 5 May 2015 18:39:28 +0000 (11:39 -0700)]
Ensure PAN is initialized before invoking callbacks

Fix minor conditional check and clean up surrounding code.

Bug: 20717705
Change-Id: I581fda37708062327c86cc0548b2665c9811be25

9 years agoFix a memory corruption issue when processing AVRCP packets.
Pavlin Radoslavov [Tue, 5 May 2015 01:28:52 +0000 (18:28 -0700)]
Fix a memory corruption issue when processing AVRCP packets.

As a side effect of the memory corruption, the AVRCP metadata
information was not visible.
Apparently, the bug was in a very old (almost unchanged) code,
and it was triggered because the rest of the code has evolved.

Bug: 20108272
Change-Id: I28466edf6a2fbfc31cfb46d74d03b6c0399f8594

9 years agoUse BTM structures for LE pairink keys and store LTK
Andre Eisenbach [Fri, 1 May 2015 20:14:59 +0000 (13:14 -0700)]
Use BTM structures for LE pairink keys and store LTK

The long term key (LTK) was not assigned to the correct struct element
before saving the key to NVRAM.

Change-Id: Icfce82f5b70518e725875771756edde0b9caeb88

9 years agoStop media task alarm when task is exiting
Nitin Arora [Fri, 1 May 2015 20:11:28 +0000 (13:11 -0700)]
Stop media task alarm when task is exiting

Bug: 20717705
Change-Id: I76e76cf33d7c9f4366f921daf2230e4f681098f7

9 years agoChange "ltk" to "pltk" and "csrk" to "pcsrk"
Andre Eisenbach [Thu, 30 Apr 2015 22:29:57 +0000 (15:29 -0700)]
Change "ltk" to "pltk" and "csrk" to "pcsrk"

To clarify local/peer key deliniation.

Change-Id: I79573015c80456ce3287acfe5551a6881ff581b2

9 years agoFix LE pairing LTK storage issue
Andre Eisenbach [Thu, 30 Apr 2015 05:27:15 +0000 (22:27 -0700)]
Fix LE pairing LTK storage issue

Two separate issues prevented the correct LTK from being storred in
non-volatile storage and thus prevented an LE device from working after
Bluetooth was restarted:

1. tBTM_SEC_BLE_KEYS contained a field "pltk" which stored the LTK, but
   downstream the field "ltk" in the same structure was used to access
   the key.

2. The structure element p_key_value was not deep-copied for
   BTA_DM_BLE_KEY_EVT events, causing data corruption and instabilities.

This patch addresses both issues.

Bug: 20091926
Change-Id: I9f9481a44bfe83cacd351f9e578451e77b573564

9 years agoAdd LE device to device database before adding LE keys
Andre Eisenbach [Wed, 29 Apr 2015 18:25:50 +0000 (11:25 -0700)]
Add LE device to device database before adding LE keys

A small bug in btif_read_le_key() would prevent a paired LE device from
being added back into the internal device database after reboot, causing
the security keys not being loaded.

Also added a debug statement to trace keys being loaded.

Bug: 20091926
Change-Id: Id2d6c69497857edc21e2d4c6a67ad9e8dadabcaa

9 years agoFix PAN initialization
Nitin Shivpure [Tue, 28 Apr 2015 07:19:04 +0000 (12:49 +0530)]
Fix PAN initialization

Change-Id: I32d8975f0f6e1ea18a361a19260ffea7a3ec8467

9 years agoKeep track of pending LE background connections
Andre Eisenbach [Tue, 28 Apr 2015 08:56:38 +0000 (01:56 -0700)]
Keep track of pending LE background connections

In order to only scan for peripherals when we have pending background
connections, we need to keep track of devices that have been added to
the whitelist.

Bug: 20091926
Change-Id: Id7b1861829d984c150d69371ebd13f7d52d3093c

9 years agoCross transport key mapping fixes
Chaojing Sun [Wed, 22 Apr 2015 20:40:21 +0000 (13:40 -0700)]
Cross transport key mapping fixes

Change-Id: I22d97303054eccc876c4a9c7c0a50e369ff4fa62

9 years agoMerge commit '1c00656' into merge2
Etan Cohen [Fri, 24 Apr 2015 20:42:20 +0000 (13:42 -0700)]
Merge commit '1c00656' into merge2

9 years agoMerge commit '00e8f5e' into merge2
Etan Cohen [Fri, 24 Apr 2015 20:41:56 +0000 (13:41 -0700)]
Merge commit '00e8f5e' into merge2

Change-Id: Ifa83bd342458eba33fdd11a9db38d2f9e818b759

9 years agoMerge commit '3aa5187' into merge2
Etan Cohen [Fri, 24 Apr 2015 20:40:29 +0000 (13:40 -0700)]
Merge commit '3aa5187' into merge2

9 years agoMerge commit 'd9bb94c' into merge2
Etan Cohen [Fri, 24 Apr 2015 20:40:15 +0000 (13:40 -0700)]
Merge commit 'd9bb94c' into merge2

Change-Id: Ib7b05e8907497cf3e2f06a94ff25686ccba43a81

9 years agoMerge commit 'ca8e356' into merge2
Etan Cohen [Fri, 24 Apr 2015 20:36:09 +0000 (13:36 -0700)]
Merge commit 'ca8e356' into merge2

9 years agoFix LE pairing on hosts with privacy disabled
Andre Eisenbach [Fri, 24 Apr 2015 05:19:59 +0000 (22:19 -0700)]
Fix LE pairing on hosts with privacy disabled

When privacy is disabled, the local BDA is not set correctly when ACL
connections are created. This leads to SMP pairing challenges to be sent
with the wrong local BDA (00:00:00:00:00:00).

Bug: 20091926
Change-Id: I554245a3a3cbed72d79aa6c1261c813999019e2b

9 years agoAdd missing __func__ in btif_hf init()
Andre Eisenbach [Thu, 23 Apr 2015 17:54:10 +0000 (10:54 -0700)]
Add missing __func__ in btif_hf init()

Change-Id: I0fe4ea75c6448f43f1638614a9a6519fa58962de

9 years agoFix possible race conditoi in hands-free initialization
Andre Eisenbach [Thu, 23 Apr 2015 02:21:03 +0000 (19:21 -0700)]
Fix possible race conditoi in  hands-free initialization

With the LE-only mode changes in place, there is a potential race
condition between the audio-gateway (AG) registration and the hands-free
service initialization as the core stack is now initialized before the
hands-free service starts.

Modified from patch submitted by Nitin Arora <niarora@codeaurora.org>.

Bug: 20481584
Change-Id: I78d62329aa5e4113c72fac2d40efa671442bae2d

9 years agoReduce log spam on TX queue congestion
Andre Eisenbach [Wed, 22 Apr 2015 22:38:21 +0000 (15:38 -0700)]
Reduce log spam on TX queue congestion

Bug: 19544388
Change-Id: Ib16878c08345983b3f72b484f2d5e4eb4791f2f9

9 years agomerge in m-wireless-internal-release history after reset to 00e8f5ed49bc05c3f8b673e4a...
The Android Automerger [Wed, 22 Apr 2015 13:45:28 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to 00e8f5ed49bc05c3f8b673e4af5e5c650a0ead18

9 years agoMerge "Initialize white list size after stack reset"
Andre Eisenbach [Wed, 22 Apr 2015 04:27:38 +0000 (04:27 +0000)]
Merge "Initialize white list size after stack reset"

9 years agoFix A2DP source double initialization problem
Andre Eisenbach [Tue, 21 Apr 2015 04:46:37 +0000 (21:46 -0700)]
Fix A2DP source double initialization problem

Fixed a problem where A2DP source was initialized twice. Once before
btif was properly initialize and then a second time when the JNI
requests A2DP to be initialized, which would then fail.

Change-Id: Ia5f10a5bda344fe3bd66818a302b6b3f9db32a20

9 years agomerge in m-wireless-internal-release history after reset to 00e8f5ed49bc05c3f8b673e4a...
The Android Automerger [Tue, 21 Apr 2015 13:45:55 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to 00e8f5ed49bc05c3f8b673e4af5e5c650a0ead18

9 years agoInitialize white list size after stack reset
Priti Aghera [Sat, 18 Apr 2015 01:11:24 +0000 (18:11 -0700)]
Initialize white list size after stack reset

The white list size is not currently set correctly, preventing devices
from being added to the LE whitelist, thus completely breaking
re-connects.

This fixes the white list management and propagates the correct reason
code for HID close events to make sure a device is re-added to the white
list if necessary.

Bug: 20290744
Change-Id: I46d7254ff3568c9964688cb192b9deb6b7d3062d

9 years agomerge in m-wireless-internal-release history after reset to 00e8f5ed49bc05c3f8b673e4a...
The Android Automerger [Mon, 20 Apr 2015 13:51:05 +0000 (06:51 -0700)]
merge in m-wireless-internal-release history after reset to 00e8f5ed49bc05c3f8b673e4af5e5c650a0ead18

9 years agoMerge "Fix missing includes under glibc on new code." into m-wireless-dev
Ian Coolidge [Fri, 17 Apr 2015 06:09:29 +0000 (06:09 +0000)]
Merge "Fix missing includes under glibc on new code." into m-wireless-dev

9 years agoMerge "Make unused tagging consistent, using the portable macro." into m-wireless-dev
Ian Coolidge [Fri, 17 Apr 2015 06:09:12 +0000 (06:09 +0000)]
Merge "Make unused tagging consistent, using the portable macro." into m-wireless-dev

9 years agoMerge "Make inline functions static also." into m-wireless-dev
Ian Coolidge [Fri, 17 Apr 2015 06:08:43 +0000 (06:08 +0000)]
Merge "Make inline functions static also." into m-wireless-dev

9 years agoFix missing includes under glibc on new code.
Ian Coolidge [Thu, 16 Apr 2015 20:50:46 +0000 (13:50 -0700)]
Fix missing includes under glibc on new code.

Change-Id: I2451f782ce3f51147ebaddc559c616eac0a2b7d9

9 years agoMake unused tagging consistent, using the portable macro.
Ian Coolidge [Fri, 17 Apr 2015 00:36:02 +0000 (17:36 -0700)]
Make unused tagging consistent, using the portable macro.

Change-Id: Id3b68bd32edfce13a847eef55ae81cd47e8fc112

9 years agoMake inline functions static also.
Ian Coolidge [Thu, 16 Apr 2015 21:07:25 +0000 (14:07 -0700)]
Make inline functions static also.

inline is a hint, visibility should be limited in case
these are not inlined.

Change-Id: I07e66fd02d33ff58ebb50d226ff9b36c562445c8

9 years agoFix compilation when BLE_PRIVACY_SPT is false.
Ian Coolidge [Thu, 16 Apr 2015 22:43:36 +0000 (15:43 -0700)]
Fix compilation when BLE_PRIVACY_SPT is false.

Change-Id: I3cd3eb11e479dd00ab98dc7c72bc7fd15c009e4f

9 years agobluedroid: compile error hammerhead-userdebug_clang
Mark Salyzyn [Thu, 16 Apr 2015 18:13:39 +0000 (11:13 -0700)]
bluedroid: compile error hammerhead-userdebug_clang

- This was a clang complaint, not a gcc complaint
- memset event to be portable to all compile environments
- error as follows:

external/bluetooth/bluedroid/osi/./src/reactor.c:90:34:
    error: missing field data initializer [-Werror,-Wmissing-field-initializers]
  struct epoll_event event = { 0 };
                                 ^
external/bluetooth/bluedroid/osi/./src/reactor.c:151:34:
    error: missing field data initializer [-Werror,-Wmissing-field-initializers]
  struct epoll_event event = { 0 };
                                 ^
external/bluetooth/bluedroid/osi/./src/reactor.c:174:34:
    error: missing field data initializer [-Werror,-Wmissing-field-initializers]
  struct epoll_event event = { 0 };
                                 ^
3 errors generated.
make: *** [out/target/product/hammerhead/obj/STATIC_LIBRARIES/libosi_intermediates/./src/reactor.o] Error 1

Change-Id: I14b884cf1665c68aff1e5afd3df65ac10af474d2

9 years agomerge in m-wireless-internal-release history after reset to ca8e356bebe608310ce50d0cb...
The Android Automerger [Thu, 16 Apr 2015 13:45:36 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to ca8e356bebe608310ce50d0cbc5c821a694554a9

9 years agoFix LE pairing
Andre Eisenbach [Thu, 16 Apr 2015 00:56:03 +0000 (17:56 -0700)]
Fix LE pairing

Change-Id: Ie4ecab207f83d8ec27c5922c0c794f8bd824255f

9 years agoLE Data Packet Extension support
Priti Aghera [Thu, 18 Dec 2014 21:55:48 +0000 (13:55 -0800)]
LE Data Packet Extension support

Included support for LE data packet extension feature according
to BT 4.2 spec. This patch checks if the controller supports LE
packet extension and provides functions to set the PDU length.

Bug: 20013956
Change-Id: I6a92970fede2f793ad48c9fa2e0247ad00297533

9 years agoAdd support for Bluetooth Sim Access Profile (1/4)
Casper Bonde [Tue, 7 Apr 2015 09:05:07 +0000 (11:05 +0200)]
Add support for Bluetooth Sim Access Profile (1/4)

Change-Id: Ie1dd95ee00976255f74b6747a1d3fc3ed59152f3

9 years agoAdd a section in style guide: __func__ should be used over __FUNCTION__.
Sharvil Nanavati [Tue, 14 Apr 2015 19:01:55 +0000 (12:01 -0700)]
Add a section in style guide: __func__ should be used over __FUNCTION__.

Change-Id: I93eb3e512b6030818b06a63f13999bd45dcfec4e

9 years agoFix compilation error with privacy disabled
Andre Eisenbach [Thu, 16 Apr 2015 05:16:47 +0000 (22:16 -0700)]
Fix compilation error with privacy disabled

Change-Id: I06d1322789fbd547080a6bd64e9c7153ddb6d70e

9 years agoFix LE pairing
Andre Eisenbach [Thu, 16 Apr 2015 00:56:03 +0000 (17:56 -0700)]
Fix LE pairing

Change-Id: Ie4ecab207f83d8ec27c5922c0c794f8bd824255f

9 years agoFix build issues after the merge
Vinit Deshpande [Wed, 15 Apr 2015 20:02:58 +0000 (13:02 -0700)]
Fix build issues after the merge

Change-Id: Ia856311187a0b2168cb859bd8b2300ff59df6569

9 years agoLE Data Packet Extension support
Priti Aghera [Thu, 18 Dec 2014 21:55:48 +0000 (13:55 -0800)]
LE Data Packet Extension support

Included support for LE data packet extension feature according
to BT 4.2 spec. This patch checks if the controller supports LE
packet extension and provides functions to set the PDU length.

Bug: 20013956
Change-Id: I6a92970fede2f793ad48c9fa2e0247ad00297533

9 years agoAdd support for Bluetooth Sim Access Profile (1/4)
Casper Bonde [Tue, 7 Apr 2015 09:05:07 +0000 (11:05 +0200)]
Add support for Bluetooth Sim Access Profile (1/4)

Change-Id: Ie1dd95ee00976255f74b6747a1d3fc3ed59152f3

9 years agomerge in m-wireless-internal-release history after reset to 3676653d4d6ba02235d092b07...
The Android Automerger [Wed, 15 Apr 2015 13:45:34 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to 3676653d4d6ba02235d092b07dafcc3c97126d8a

9 years agoam f29a2fb..e07ad10 from mirror-m-wireless-internal-release
Vinit Deshpande [Tue, 14 Apr 2015 23:00:10 +0000 (16:00 -0700)]
am f29a2fb..e07ad10 from mirror-m-wireless-internal-release

e07ad10 merge in m-wireless-internal-release history after reset to d232721ae5e5b6949a5249f0d116408b8a3c5f1d
d232721 L2CAP socket - fix merge errors
899b771 BR/EDR secure connections support
7fb0da6 Support numeric comparison in SMP
aa351f2 merge in m-wireless-internal-release history after reset to 399e89150b3df87172bdf92d54712b379324b149
399e891 Fix for AVRCP CTRL stops sending pass through command
daddea9 Free Avrcp Controller callbacks on Cleanup
764babe Protect reset of out stream with mutex
444a8da LE Privacy 1.2 and LE secure connections
8372aa5 L2CAP and SDP Search API for BT profiles (2/2)
fd422a7 Update Service Availability.
2a0652a merge in m-wireless-internal-release history after reset to 0b47e0a35c16f5b7d77c30ec1c095ed92ff4fd74
78d0f4c merge in m-wireless-internal-release history after reset to m-wireless-internal-dev
0b47e0a Avoid duplicate disconnection callbacks for fixed channel connections
5646973 Add a section on assertions to the style guide.
d768767 Merge "Avoid null-pointer dereference in l2c_release_lcb()" into m-wireless-dev
ef92b53 Avoid null-pointer dereference in l2c_release_lcb()
4bf68bf merge in m-wireless-internal-release history after reset to f538707fe64c62b1dbb8e4210e4a1bfa0bab2b56
de6ac86 Add a 'Bluedroid conventions' section to the style guide.
1b80439 Add a section to the style guide on variable declarations.
485f19e merge in m-wireless-internal-release history after reset to 4540f59bc447dc2b7b31a3e974b74a60b2417e7d
bef8940 merge in m-wireless-internal-release history after reset to 841c9103cad1898ceca87b734acd4d4537f9f452
ab4c38c merge in m-wireless-internal-release history after reset to a7e698f5a9e062f62e21bc435643975c30bab846
2807a74 merge in m-wireless-internal-release history after reset to a7e698f5a9e062f62e21bc435643975c30bab846
99dbe9a merge in m-wireless-internal-release history after reset to 78c0b060f29b7b7014adddb2f98bf6ae9755c488
f7f8399 merge in m-wireless-internal-release history after reset to a5371c238b4e874d8313ac56a23451e7345ff541
3aa60d7 Make A2DP audio HAL a shared library again
3256a31 Move unused include file out of hci_audio.h
b866b69 Add option for schedule_next_instance to force rescheduling
4ae5e3e Ensure alarms are called back when they expire in the past
a7bd03e Rewrite alarms to use a single posix timer instance
88e7b15 Resolved hardware error observed during SCO Connection setup

Change-Id: Ib9a0a2ffca1d4811a9a9e56674bf43275d8b2205

9 years agoAdd a section in style guide: __func__ should be used over __FUNCTION__.
Sharvil Nanavati [Tue, 14 Apr 2015 19:01:55 +0000 (12:01 -0700)]
Add a section in style guide: __func__ should be used over __FUNCTION__.

Change-Id: I93eb3e512b6030818b06a63f13999bd45dcfec4e

9 years agomerge in m-wireless-internal-release history after reset to d232721ae5e5b6949a5249f0d...
The Android Automerger [Tue, 14 Apr 2015 13:46:03 +0000 (06:46 -0700)]
merge in m-wireless-internal-release history after reset to d232721ae5e5b6949a5249f0d116408b8a3c5f1d

9 years agoL2CAP socket - fix merge errors
Casper Bonde [Mon, 13 Apr 2015 19:58:56 +0000 (21:58 +0200)]
L2CAP socket - fix merge errors

This fixes a few changes that was reverted by mistake,
causing uninitialized data to be used as instance data
in GAP and no buffers allocated to the L2CAP sockets.

Change-Id: I060c5faf602c1dedcc34b4acd1417949820a4da4

9 years agoBR/EDR secure connections support
Mudumba Ananth [Fri, 30 Jan 2015 10:33:02 +0000 (02:33 -0800)]
BR/EDR secure connections support

As a part of BT 4.1 stack upgrade, added host support for BR/EDR
secure connections to be able to interact with controllers that
support secure connections and upgrade the SSP mechanism to use
secure connection rules.

This change checks for controller support in the extended_features
(LMP page 2) and then declares the host support (extended_features
LMP page 1) using WRITE SECURE CONNECTIONS HOST SUPPORT.
If both the sides support secure connections, the simple pairing
process utilizes the link key generated using P-256 elliptic curve
(in the controller) and both the sides will be
in a secure connection.

Bug: 19289699
Change-Id: Idb3c41f439973bea137f5a4a69468c1f55aecbd7

9 years agoSupport numeric comparison in SMP
Satya Calloji [Fri, 30 Jan 2015 04:40:17 +0000 (20:40 -0800)]
Support numeric comparison in SMP

Enable support for numeric comparison in SMP when LE Secure connection
is supported. The change will distinguish between passkey confirmation
in case of Security grant and Passkey confirm.

Original author: Priti Aghera <paghera@broadcom.com>

Bug: 19816438
Change-Id: Id1fd072d1e567a80b020b4ba217486c3308ad39d

9 years agomerge in m-wireless-internal-release history after reset to 399e89150b3df87172bdf92d5...
The Android Automerger [Mon, 13 Apr 2015 13:45:29 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to 399e89150b3df87172bdf92d54712b379324b149

9 years agoFix for AVRCP CTRL stops sending pass through command
Anubhav Gupta [Fri, 5 Sep 2014 22:45:36 +0000 (15:45 -0700)]
Fix for AVRCP CTRL stops sending pass through command

Issue is due to BTA_AV_REMOTE_RSP_EVT is not handled in btif_av
handler. Swtich case added to handle remote response event in
btif_av_opened_handler and btif_av_started_handler.

Change-Id: I58a7bd8bfe5b07a7339d93d2b66928131836d431

9 years agoFree Avrcp Controller callbacks on Cleanup
Anubhav Gupta [Mon, 8 Sep 2014 10:30:22 +0000 (16:00 +0530)]
Free Avrcp Controller callbacks on Cleanup

Free AVRCP Controller callbacks on cleanup so that callbacks
are initialized properly on next initialization.

Change-Id: Ieaf4c1989a7c40c591adfb7cb47912532ceee46e

9 years agoProtect reset of out stream with mutex
Nitin Srivastava [Mon, 22 Dec 2014 14:24:09 +0000 (19:54 +0530)]
Protect reset of out stream with mutex

Protect reset of out stream with mutex so that the access
of the same is properly synchronized in multi-threaded environment.

Change-Id: I6dd81d8c7fa219ee8d1e4d82aa1e7ec52dcecec8

9 years agoLE Privacy 1.2 and LE secure connections
Satya Calloji [Fri, 6 Mar 2015 18:38:22 +0000 (10:38 -0800)]
LE Privacy 1.2 and LE secure connections

Bug: 19816438
Original author: Chaojing Sun <cjsun@broadcom.com>
Change-Id: I5951f4d4e038f8348a62aa6d19b2111bae0b3ecc

9 years agoL2CAP and SDP Search API for BT profiles (2/2)
Kim Schulz [Wed, 25 Mar 2015 09:39:40 +0000 (10:39 +0100)]
L2CAP and SDP Search API for BT profiles (2/2)

Added support for exposing L2CAP to Java such that OBEX over L2CAP
is made possible.

Added support to create SDP records as a seperate step.(as opposed to
creating a SDP record when a BluetoothSocket is created).
This allows both a RFCOMM channel and a L2CAP PSM to be included in a
SDP record. (Additionally the content of the SDP record is set by the
profile in Java, in stead of beeing hardcoded in the socket layer.)
This completes the L2CAP channel exposure to Java.

Change-Id: Iaf68a07d910145cdd33e940d73cd680f79164100

9 years agoMerge commit '4bf68bf020c7fd1aabcdc4b5d8f5fbb8bacdec9d' into merge_work
Prerepa Viswanadham [Fri, 10 Apr 2015 20:48:17 +0000 (13:48 -0700)]
Merge commit '4bf68bf020c7fd1aabcdc4b5d8f5fbb8bacdec9d' into merge_work

Change-Id: Ibc6d6e691b7f97611d16f96220346dfd6ffbbf52

9 years agoUpdate Service Availability.
Mallikarjuna GB [Wed, 5 Nov 2014 09:48:50 +0000 (15:18 +0530)]
Update Service Availability.

 - service availability is updated on CIND response
   during SLC set-up.
 - update current service availability on +CIEV response from
   remote device.

Change-Id: I57643a6ac3aad5339d686cf941902a8bf88d99fb

9 years agomerge in m-wireless-internal-release history after reset to 0b47e0a35c16f5b7d77c30ec1...
The Android Automerger [Thu, 9 Apr 2015 13:45:28 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to 0b47e0a35c16f5b7d77c30ec1c095ed92ff4fd74

9 years agoam dd6401d1: am c685480e: Don\'t truncate the top 16 bits of the LE advertisement...
Ian Coolidge [Thu, 9 Apr 2015 11:19:41 +0000 (11:19 +0000)]
am dd6401d1: am c685480e: Don\'t truncate the top 16 bits of the LE advertisement data mask.

* commit 'dd6401d136fe50e0934147c1dacd9f0d89c03ede':
  Don't truncate the top 16 bits of the LE advertisement data mask.

9 years agoam c685480e: Don\'t truncate the top 16 bits of the LE advertisement data mask.
Ian Coolidge [Thu, 9 Apr 2015 11:01:05 +0000 (11:01 +0000)]
am c685480e: Don\'t truncate the top 16 bits of the LE advertisement data mask.

* commit 'c685480ede429b016d4f5fcfbf91a621c400bfc9':
  Don't truncate the top 16 bits of the LE advertisement data mask.

9 years agoDon't truncate the top 16 bits of the LE advertisement data mask.
Ian Coolidge [Wed, 4 Mar 2015 01:00:17 +0000 (17:00 -0800)]
Don't truncate the top 16 bits of the LE advertisement data mask.

This is stored elsewhere as unsigned 32-bit integer.
It should be stored the same way here.

Bug: 19592970
Change-Id: I34136ca76e56f9a5cd896138c947c46e7912d40a
(cherry picked from commit 91f6987ecca884b0995b77fea014046b8a56385a)

9 years agomerge in m-wireless-internal-release history after reset to m-wireless-internal-dev
The Android Automerger [Thu, 9 Apr 2015 06:54:18 +0000 (23:54 -0700)]
merge in m-wireless-internal-release history after reset to m-wireless-internal-dev

9 years agoAvoid duplicate disconnection callbacks for fixed channel connections
Satya Calloji [Tue, 17 Mar 2015 20:12:01 +0000 (13:12 -0700)]
Avoid duplicate disconnection callbacks for fixed channel connections

Fixed channel connections are getting a disconnect callback when the
HCI command is issued and when the HCI disconnect completes. This
causes problems if the upper layer trying to reconnect at link
disconnecting state.
Triggering the disconnect callback only once solves this problem.

Original author: Chaojing Sun <cjsun@broadcom.com>

Bug: 19816438
Change-Id: Ib661c968e586975a7fc7244e2d0745f71d52e3e9

9 years agoAdd a section on assertions to the style guide.
Sharvil Nanavati [Wed, 8 Apr 2015 06:22:08 +0000 (23:22 -0700)]
Add a section on assertions to the style guide.

Change-Id: I5627b5b2d6b25f0472c53b8150b14bab79b200c3

9 years agoMerge "Fix init sequence for BT AV sink."
Andre Eisenbach [Wed, 8 Apr 2015 21:00:18 +0000 (21:00 +0000)]
Merge "Fix init sequence for BT AV sink."

9 years agoFix init sequence for BT AV sink.
Rakesh Iyer [Wed, 8 Apr 2015 19:25:37 +0000 (12:25 -0700)]
Fix init sequence for BT AV sink.

BTA_AvEnable_Sink() was being called to early causing
a crash loop when the BT AV_SINK was included. This patch
changes up the init sequence to match that of the av
source. Also, rename a few constants for clarity.

Change-Id: I3e6a7e22a2643eeceb4afc082979d1d9967b0b99

9 years agoMerge "Avoid null-pointer dereference in l2c_release_lcb()" into m-wireless-dev
Andre Eisenbach [Wed, 8 Apr 2015 18:11:54 +0000 (18:11 +0000)]
Merge "Avoid null-pointer dereference in l2c_release_lcb()" into m-wireless-dev

9 years agoAvoid null-pointer dereference in l2c_release_lcb()
Andre Eisenbach [Wed, 8 Apr 2015 17:01:56 +0000 (10:01 -0700)]
Avoid null-pointer dereference in l2c_release_lcb()

Change-Id: Id46d678e45797c4d3d3c8e024f42cfd06b1d2da2

9 years agomerge in m-wireless-internal-release history after reset to f538707fe64c62b1dbb8e4210...
The Android Automerger [Wed, 8 Apr 2015 13:45:23 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to f538707fe64c62b1dbb8e4210e4a1bfa0bab2b56

9 years agoAdd a 'Bluedroid conventions' section to the style guide.
Sharvil Nanavati [Wed, 8 Apr 2015 06:10:59 +0000 (23:10 -0700)]
Add a 'Bluedroid conventions' section to the style guide.

Also introduce a memory management section underneath 'Bluedroid
conventions' that describes common ownership semantics.

Change-Id: I9f1f148437fe21788618bcdc884b2eea5cbff141

9 years agoAdd a section to the style guide on variable declarations.
Sharvil Nanavati [Wed, 8 Apr 2015 05:45:21 +0000 (22:45 -0700)]
Add a section to the style guide on variable declarations.

Change-Id: I0eaa435378b56953c1c228c795d0b4bf9bd8ce6c

9 years agoMinor cleanup of formatting in style guide.
Sharvil Nanavati [Wed, 8 Apr 2015 05:41:01 +0000 (22:41 -0700)]
Minor cleanup of formatting in style guide.

Remove trailing whitespace on a line and add inline code quotations.

Change-Id: I2f85ddf95f0dcfb0d9fdb1e6663315be15efeb62

9 years agoam d3b1780c: resolved conflicts for merge of 47965ddb to lmp-mr1-dev-plus-aosp
Chris Elliott [Wed, 8 Apr 2015 01:59:21 +0000 (01:59 +0000)]
am d3b1780c: resolved conflicts for merge of 47965ddb to lmp-mr1-dev-plus-aosp

* commit 'd3b1780c45e6a7cf621e7df97203759d08a9c52c':
  Fix BlueDroid signed/unsigned failed test for MIPS build.

9 years agoresolved conflicts for merge of 47965ddb to lmp-mr1-dev-plus-aosp
Chris Elliott [Wed, 8 Apr 2015 01:23:36 +0000 (18:23 -0700)]
resolved conflicts for merge of 47965ddb to lmp-mr1-dev-plus-aosp

Change-Id: Ibed75bf21cd7aacabec41fc620824141cb865b88

9 years agoOnFound/OnLost feature changes based on Google spec v0.90
Satya Calloji [Tue, 10 Feb 2015 01:40:52 +0000 (17:40 -0800)]
OnFound/OnLost feature changes based on Google spec v0.90

Bug: 19609671
Change-Id: If9e61b405a141cb77fb65741d08227284cb22ccd

9 years agoFix BlueDroid signed/unsigned failed test for MIPS build.
Chris Elliott [Tue, 7 Apr 2015 01:47:28 +0000 (18:47 -0700)]
Fix BlueDroid signed/unsigned failed test for MIPS build.

Change-Id: I56cca343e07df83999b0ef0fb672dc8bcfae4bc4

9 years agomerge in m-wireless-internal-release history after reset to 4540f59bc447dc2b7b31a3e97...
The Android Automerger [Tue, 7 Apr 2015 13:45:42 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to 4540f59bc447dc2b7b31a3e974b74a60b2417e7d

9 years agoStatic code analysis cleanups and minor bug fixes
VenkatRaghavan VijayaRaghavan [Thu, 5 Feb 2015 12:40:47 +0000 (04:40 -0800)]
Static code analysis cleanups and minor bug fixes

- Fix for initializing all the un-initialized variables
- Handling system call failure like socket,fcntl etc...
- In btpan_tap_close validate tap_if_down and close the socket.
- Invalid memset size, which could have potential memory issue
- Change -1 to INVALID_FD where appropriate

Bug: 19417758
Change-Id: Id31832f8678b2d72c80740c29b946a94e7ae0197

9 years agoSet dual-mode bits correctly in multi-adv instance flags
Satya Calloji [Thu, 5 Feb 2015 21:12:15 +0000 (13:12 -0800)]
Set dual-mode bits correctly in multi-adv instance flags

Bug: 19369962
Change-Id: I081f9db56d52e85cff50f668752322b8ab8adf42

9 years agomerge in m-wireless-internal-release history after reset to 841c9103cad1898ceca87b734...
The Android Automerger [Mon, 6 Apr 2015 13:45:40 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to 841c9103cad1898ceca87b734acd4d4537f9f452

9 years agoam 3f7ec12b: am dc69e2d5: GAP: Reset cont_offset in start frame of SDP
Simon Wilson [Sat, 4 Apr 2015 00:24:41 +0000 (00:24 +0000)]
am 3f7ec12b: am dc69e2d5: GAP: Reset cont_offset in start frame of SDP

* commit '3f7ec12b23f9288d15e1392b67c30482f7db3afc':
  GAP: Reset cont_offset in start frame of SDP

9 years agoam dc69e2d5: GAP: Reset cont_offset in start frame of SDP
Simon Wilson [Sat, 4 Apr 2015 00:05:02 +0000 (00:05 +0000)]
am dc69e2d5: GAP: Reset cont_offset in start frame of SDP

* commit 'dc69e2d5348de2ef64ac7f335a503a63c7cca0e6':
  GAP: Reset cont_offset in start frame of SDP

9 years agoMove HCI command response check to individual command handlers
Andre Eisenbach [Fri, 3 Apr 2015 20:58:43 +0000 (13:58 -0700)]
Move HCI command response check to individual command handlers

On some controllers, reading extended local feature pages can fail,
leading to an assertion and subsequent stack crash. To work around this
issue, the HCI command response status checked has been moved to
individual HCI command handlers, where the same assert is raised. Only
for extended local feature responses do we simply ignore any failure
(for now).

Bug: 20057316
Change-Id: I8601ecbdef07921edfe13d42d1f24110bc8ba535

9 years agoGAP: Reset cont_offset in start frame of SDP
Simon Wilson [Thu, 2 Apr 2015 22:17:08 +0000 (15:17 -0700)]
GAP: Reset cont_offset in start frame of SDP

If cont_offset of ccb is not reset in start frame, it's
appending previous SDP service search offset also to
current offset. Service search goes in a loop and
leads to crash on array index out of bounds.

Bug: 19810285
Change-Id: Ifee174555593f4df669977b74ce3725c75c9b426

9 years agoMerge "Fix pthread_t confusion." into m-wireless-dev
Ian Coolidge [Fri, 3 Apr 2015 06:02:48 +0000 (06:02 +0000)]
Merge "Fix pthread_t confusion." into m-wireless-dev

9 years agoDon't truncate the top 16 bits of the LE advertisement data mask.
Ian Coolidge [Wed, 4 Mar 2015 01:00:17 +0000 (17:00 -0800)]
Don't truncate the top 16 bits of the LE advertisement data mask.

This is stored elsewhere as unsigned 32-bit integer.
It should be stored the same way here.

Bug: 19592970
(cherry picked from commit 91f6987ecca884b0995b77fea014046b8a56385a)

Change-Id: I21dbe07e4a1095e3e8b38a56b9673a1cebb32b08

9 years agoFix pthread_t confusion.
Ian Coolidge [Tue, 3 Feb 2015 04:41:11 +0000 (20:41 -0800)]
Fix pthread_t confusion.

Don't assign pthread_t to pid_t or UINT32.
Just use pthread_t throughout.

(cherry picked from commit df3459935a4c12744a9a78812157890b60ccb77d)

Change-Id: I1ab086a547a731358003471be867cfb189f61c56

9 years agoPrevent slave link block removal at cancel connect
Nitin Arora [Wed, 19 Nov 2014 22:24:08 +0000 (14:24 -0800)]
Prevent slave link block removal at cancel connect

This change prevents the cancellation of direct LE connection
from removing the lcb, if there is already an LE connection up
with DUT as peripheral

Change-Id: If11759e40d19f428959b28025dde2d65b6ed7cd6

9 years agoFix build in BT AV_SINK.
Rakesh Iyer [Thu, 2 Apr 2015 22:52:44 +0000 (15:52 -0700)]
Fix build in BT AV_SINK.

Change-Id: Ie20165ee69597e3287283322d14773ac3699c323

9 years agoosi: add compat code for glibc
Scott James Remnant [Thu, 2 Apr 2015 22:22:29 +0000 (15:22 -0700)]
osi: add compat code for glibc

glibc doesn't declare strlcpy(), strlcat() or gettid(). Add a header
of compatibility routines that only get included when compiling on this.

Change-Id: I889ac7f1d22cf7056757890fcff0403107488d62

9 years agofixed missing {} around if scope
Kim Schulz [Mon, 30 Sep 2013 07:52:55 +0000 (09:52 +0200)]
fixed missing {} around if scope

a range of lines was supposed to be part of an if-true scope, but was not (due to missing {})

Bug: 10905622
Change-Id: I7adad37216cc78403f2d187d3404565f527d67c1

9 years agoAdd missing header for APPL_TRACE_EVENT
Scott James Remnant [Thu, 2 Apr 2015 22:22:27 +0000 (15:22 -0700)]
Add missing header for APPL_TRACE_EVENT

Change-Id: Iebe9d899dc73867549c40a569094ff9b5c340808

9 years agoUse int64_t instead of non-standard __int64
Scott James Remnant [Thu, 2 Apr 2015 22:22:25 +0000 (15:22 -0700)]
Use int64_t instead of non-standard __int64

Change-Id: I482b861364531d27ef89aab6f5617a060176de83

9 years agoMake atomic functions static, as well as inline
Scott James Remnant [Thu, 2 Apr 2015 22:22:22 +0000 (15:22 -0700)]
Make atomic functions static, as well as inline

'inline' is only a hint for the compiler, and if ignored this results
in extern functions being created. Add 'static' so that the resulting
functions are also only local to the compilation unit.

Change-Id: I947201b8170c8c73f15e7ccdd68cfc7f07cde1e9

9 years agoFix non-standard pthread mutex interactions.
Scott James Remnant [Thu, 2 Apr 2015 22:23:22 +0000 (15:23 -0700)]
Fix non-standard pthread mutex interactions.

pthread_mutex_t is intended to be opaque.
pthread_attr_t is intended to be opaque.

Change-Id: Ie0f5558a96f8e5fc8b2f59763acbfe5340fa81a4

9 years agobtif_pan: Grab interface declarations from net/if.h only.
Scott James Remnant [Thu, 2 Apr 2015 22:23:16 +0000 (15:23 -0700)]
btif_pan: Grab interface declarations from net/if.h only.

This is the libc interface file.
Using linux/if.h produces definition collisions on glibc.

Change-Id: I8744258ba0c4698d8f9f5b1215bb3cb1d86618fe

9 years agoFix missing #includes needed for glibc
Scott James Remnant [Thu, 2 Apr 2015 22:22:14 +0000 (15:22 -0700)]
Fix missing #includes needed for glibc

Some standard library functions are used while relying on bionic headers
including the headers the functions were actually declared on. Add those
missing #includes so that bluetooth.default.so will compile on glibc.

Change-Id: Ied9f89ce5a05911fca63f6bfe1b8cc8196ab3b1c