OSDN Git Service

android-x86/system-bt.git
9 years agoGlobal counter API for bluedroid
Chris Manton [Wed, 13 Aug 2014 23:36:50 +0000 (16:36 -0700)]
Global counter API for bluedroid

9 years agoAdded encapulsated iterator to hashmap
Chris Manton [Wed, 13 Aug 2014 23:25:24 +0000 (16:25 -0700)]
Added encapulsated iterator to hashmap

Also added back hash_map_test which seemed
to have been dropped somewhere along the way.

9 years agoModify eager reader to support multi-byte reads
Zach Johnson [Fri, 22 Aug 2014 04:00:43 +0000 (21:00 -0700)]
Modify eager reader to support multi-byte reads

9 years agoH4: -1 -> INVALID_FD; make uart_fd invalid on close
Zach Johnson [Thu, 21 Aug 2014 06:25:36 +0000 (23:25 -0700)]
H4: -1 -> INVALID_FD; make uart_fd invalid on close

9 years agoImplement an HCI HAL for MCT
Zach Johnson [Thu, 21 Aug 2014 06:12:33 +0000 (23:12 -0700)]
Implement an HCI HAL for MCT

Unit tested. Needs verification on actual device (i.e. HDP profile).

9 years agoScope the lock_count variable in the alarm test harness
Zach Johnson [Thu, 21 Aug 2014 01:09:06 +0000 (18:09 -0700)]
Scope the lock_count variable in the alarm test harness

9 years agoUnspecial-case the zero queue in the data dispatcher
Zach Johnson [Thu, 21 Aug 2014 00:51:26 +0000 (17:51 -0700)]
Unspecial-case the zero queue in the data dispatcher

Since hash map supports zero keys now this is no longer necessary.

9 years agoRefactor HCI layer
Zach Johnson [Sat, 16 Aug 2014 00:00:17 +0000 (17:00 -0700)]
Refactor HCI layer

Refactor the HCI layer for better testability.
A future CL will add a HAL implementation for multi channel transport.

Since btsnoop and vendor are modified, it's not easy to incrementally introduce these changes.

9 years agoAdd eager reader
Zach Johnson [Tue, 5 Aug 2014 03:51:06 +0000 (20:51 -0700)]
Add eager reader

9 years agoAdd stub testing macros
Zach Johnson [Fri, 15 Aug 2014 23:50:32 +0000 (16:50 -0700)]
Add stub testing macros

9 years agoRefactor alarm tests to use a test harness
Zach Johnson [Fri, 15 Aug 2014 23:49:15 +0000 (16:49 -0700)]
Refactor alarm tests to use a test harness

This improves the test writing experience for tests that rely on alarm code.

9 years agoAdd some stream skip macros for code clarity
Zach Johnson [Fri, 15 Aug 2014 23:46:59 +0000 (16:46 -0700)]
Add some stream skip macros for code clarity

9 years agoAdd peek + dequeue registratation to fixed queue
Zach Johnson [Fri, 15 Aug 2014 23:44:46 +0000 (16:44 -0700)]
Add peek + dequeue registratation to fixed queue

9 years agoAdd a join function to thread
Zach Johnson [Fri, 15 Aug 2014 23:43:32 +0000 (16:43 -0700)]
Add a join function to thread

9 years agoMake hash map support NULL or 0 keys
Zach Johnson [Fri, 15 Aug 2014 23:41:58 +0000 (16:41 -0700)]
Make hash map support NULL or 0 keys

9 years agoAdd an allocator interface + default malloc allocator
Zach Johnson [Fri, 15 Aug 2014 23:39:33 +0000 (16:39 -0700)]
Add an allocator interface + default malloc allocator

9 years agoSwitch to an epoll-based reactor implementation.
Sharvil Nanavati [Wed, 13 Aug 2014 07:40:49 +0000 (00:40 -0700)]
Switch to an epoll-based reactor implementation.

epoll is a much nicer interface that very closely matches the
reactor interface. It's also thread-safe which makes it a more
suitable choice for bluedroid. As a result of this change,
reactor_register and reactor_unregister are both thread-safe without
introducing any synchronization in user-space.

9 years agoFix build after enabling assertions: variable reactor is no longer defined.
Sharvil Nanavati [Sat, 9 Aug 2014 01:26:27 +0000 (18:26 -0700)]
Fix build after enabling assertions: variable reactor is no longer defined.

9 years agoAdd a function to check if a string represents a bdaddr
Sharvil Nanavati [Sat, 16 Aug 2014 01:39:16 +0000 (18:39 -0700)]
Add a function to check if a string represents a bdaddr

9 years agoConst-correctness for str2bd.
Sharvil Nanavati [Fri, 15 Aug 2014 23:14:26 +0000 (16:14 -0700)]
Const-correctness for str2bd.

9 years agoAdd a method to create a config object without loading from disk.
Sharvil Nanavati [Fri, 15 Aug 2014 22:04:46 +0000 (15:04 -0700)]
Add a method to create a config object without loading from disk.

9 years agoAdd thread_is_self function
Sharvil Nanavati [Thu, 14 Aug 2014 19:36:39 +0000 (12:36 -0700)]
Add thread_is_self function

This is useful to compare the current thread against another one.

9 years agoAdd a tool to inject HCI commands into bluedroid.
Sharvil Nanavati [Wed, 13 Aug 2014 08:14:49 +0000 (01:14 -0700)]
Add a tool to inject HCI commands into bluedroid.

This tool is very primitive in a number of ways. First, each new
HCI command needs to be carefully crafted. Second, it is entirely
stateless and operates in "fire-and-forget" mode. In other words,
there's no "read-modify-write" capability yet. That being said,
this tool will grow along with the infrastructure in bluedroid.

9 years agobtpan thread signal function workaround
Chris Manton [Tue, 12 Aug 2014 21:11:38 +0000 (14:11 -0700)]
btpan thread signal function workaround

btsock does not provide a reliable teardown
procedure.  Stale file descriptors may continue
to actively invoke signal callbacks from the
btsock thread.  Extra logic to handle gracefully.

9 years agoExtend add/subtract operations to atomics
Chris Manton [Wed, 13 Aug 2014 18:00:17 +0000 (11:00 -0700)]
Extend add/subtract operations to atomics

Going to be used for counters

9 years agoAdd 64 bit atomic types
Chris Manton [Wed, 6 Aug 2014 16:36:17 +0000 (09:36 -0700)]
Add 64 bit atomic types

9 years agoIncrease thread queue size above default
Chris Manton [Tue, 5 Aug 2014 19:16:48 +0000 (12:16 -0700)]
Increase thread queue size above default

The UART enqueues work requests in addition to
the actual work onto the rx_q.  Many small byte
packets received by the UART cause many work requests
which may fill the work queue causing deadlock.

9 years agoAdd fixed queue size option to thread creation
Chris Manton [Tue, 5 Aug 2014 18:10:12 +0000 (11:10 -0700)]
Add fixed queue size option to thread creation

9 years agoExpose fixed queue capacity
Chris Manton [Tue, 5 Aug 2014 18:07:23 +0000 (11:07 -0700)]
Expose fixed queue capacity

9 years agoFix reactor to use prepend, fix reactor tests
Zach Johnson [Tue, 5 Aug 2014 03:49:49 +0000 (20:49 -0700)]
Fix reactor to use prepend, fix reactor tests

9 years agoFix socket to use safe reactor registration
Zach Johnson [Tue, 5 Aug 2014 03:47:52 +0000 (20:47 -0700)]
Fix socket to use safe reactor registration

9 years agoImplement a data dispatcher.
Zach Johnson [Tue, 29 Jul 2014 23:25:02 +0000 (16:25 -0700)]
Implement a data dispatcher.

This will be useful at layer boundaries.

9 years agoHide thread's reactor
Zach Johnson [Tue, 5 Aug 2014 03:45:22 +0000 (20:45 -0700)]
Hide thread's reactor

9 years agoAdd functions on fixed_queue to check empty state
Zach Johnson [Wed, 30 Jul 2014 20:40:09 +0000 (13:40 -0700)]
Add functions on fixed_queue to check empty state

9 years agoReplace magic number used instead of MAX_RFC_CHANNEL number.
Steve Gu [Tue, 5 Aug 2014 19:34:33 +0000 (12:34 -0700)]
Replace magic number used instead of MAX_RFC_CHANNEL number.

9 years agoosi: Support for atomic data types
Chris Manton [Wed, 30 Jul 2014 17:51:07 +0000 (10:51 -0700)]
osi: Support for atomic data types

9 years agoFix build: include osi.h from semaphore to get definition of INVALID_FD
Sharvil Nanavati [Sat, 2 Aug 2014 01:40:15 +0000 (18:40 -0700)]
Fix build: include osi.h from semaphore to get definition of INVALID_FD

9 years agoDefine INVALID_FD to improve readability and reduce likelihood of errors
Sharvil Nanavati [Sat, 2 Aug 2014 00:00:12 +0000 (17:00 -0700)]
Define INVALID_FD to improve readability and reduce likelihood of errors

9 years agoAllow iterating over sections in a config file and writing config to disk.
Sharvil Nanavati [Mon, 28 Jul 2014 04:12:20 +0000 (21:12 -0700)]
Allow iterating over sections in a config file and writing config to disk.

These two additional operations will allow us to replace the existing
XML-based config files and switch to a single file format.

9 years agoSwitch over duplicated timer_create routines to new alarm code.
Sharvil Nanavati [Sat, 26 Jul 2014 05:20:46 +0000 (22:20 -0700)]
Switch over duplicated timer_create routines to new alarm code.

9 years agoAdd a mechanism for debug tools to inject HCI commands into the HCI stream.
Sharvil Nanavati [Fri, 25 Jul 2014 23:03:15 +0000 (16:03 -0700)]
Add a mechanism for debug tools to inject HCI commands into the HCI stream.

9 years agoExpose thread's reactor so we can register new fds with it.
Sharvil Nanavati [Thu, 24 Jul 2014 21:24:27 +0000 (14:24 -0700)]
Expose thread's reactor so we can register new fds with it.

This change allows a thread's reactor loop to manage additional
file descriptors, e.g. sockets and queues, entirely within that
thread's context.

9 years agohci: Renaming of callback functions
Chris Manton [Thu, 31 Jul 2014 16:22:09 +0000 (09:22 -0700)]
hci: Renaming of callback functions

Changing name to conform to *_cb convention already
in place.  Further, current names will be re-used
for osi buffer resource management.

9 years agohash_map header uses standard integral types so it must include stdint.h.
Sharvil Nanavati [Fri, 25 Jul 2014 22:09:51 +0000 (15:09 -0700)]
hash_map header uses standard integral types so it must include stdint.h.

9 years agoWake up reactor whenever a new object is registered/unregistered.
Sharvil Nanavati [Fri, 25 Jul 2014 22:12:36 +0000 (15:12 -0700)]
Wake up reactor whenever a new object is registered/unregistered.

Before this change, if the reactor was blocked waiting for an event
and a new object was registered, it would not wait for events on the
new object until it woke up on its own. This change forces the reactor
to re-evaluate the file descriptor set whenever the object list is
modified.

9 years agoIntroduce a socket class
Sharvil Nanavati [Fri, 25 Jul 2014 22:50:17 +0000 (15:50 -0700)]
Introduce a socket class

This socket implementation is limited to TCP server sockets and
provides no mechanism to connect to a remote host. It's primarily
intended to be used to interface with debugging tools. It's designed
to work seamlessly with the reactor (event-driven) model.

9 years agoRemove some unused code in L2CAP
Zach Johnson [Mon, 28 Jul 2014 20:51:03 +0000 (13:51 -0700)]
Remove some unused code in L2CAP

9 years agoosi: hash map implementation
Chris Manton [Tue, 3 Jun 2014 18:02:38 +0000 (11:02 -0700)]
osi: hash map implementation

9 years agoFix gatt_main.c compile error due to log macro change
Andre Eisenbach [Wed, 18 Feb 2015 00:53:48 +0000 (16:53 -0800)]
Fix gatt_main.c compile error due to log macro change

9 years agorfcomm: Check for null pointers on DLC request
Chris Manton [Tue, 17 Jun 2014 18:17:29 +0000 (11:17 -0700)]
rfcomm: Check for null pointers on DLC request

The function to get the port control block from the DLCI
explicitly mentions it will return NULL if there is no
active rfcomm connection for the given DLCI.

9 years agoRelease GATT resources upon teardown
Chris Manton [Fri, 21 Feb 2014 20:36:18 +0000 (12:36 -0800)]
Release GATT resources upon teardown

9 years agoAdd a system property for libbt-vendor.so initialization timeout
Sharvil Nanavati [Tue, 21 Jan 2014 02:20:28 +0000 (18:20 -0800)]
Add a system property for libbt-vendor.so initialization timeout

Use a system property, bluetooth.enable_timeout_ms, to specify in ms
how long to wait for libbt-vendor.so to initialize.

9 years agoam 45085bf6: Merge "Ignore service UUID length if no UUID filter is specified" into...
Justin Harrison [Thu, 19 Feb 2015 04:48:38 +0000 (04:48 +0000)]
am 45085bf6: Merge "Ignore service UUID length if no UUID filter is specified" into lmp-mr1-dev

* commit '45085bf6ed93ea9398047c21bc4b94c8516f9daa':
  Ignore service UUID length if no UUID filter is specified

9 years agoMerge "Ignore service UUID length if no UUID filter is specified" into lmp-mr1-dev
Justin Harrison [Thu, 19 Feb 2015 04:44:12 +0000 (04:44 +0000)]
Merge "Ignore service UUID length if no UUID filter is specified" into lmp-mr1-dev

9 years agoam 114c9ce4: Merge "Increase SDP buffer from 750 bytes to 4096 bytes" into lmp-mr1-dev
Andre Eisenbach [Thu, 19 Feb 2015 02:14:02 +0000 (02:14 +0000)]
am 114c9ce4: Merge "Increase SDP buffer from 750 bytes to 4096 bytes" into lmp-mr1-dev

* commit '114c9ce459e9d9e40d55586da1d18d0d65c45c8d':
  Increase SDP buffer from 750 bytes to 4096 bytes

9 years agoMerge "Increase SDP buffer from 750 bytes to 4096 bytes" into lmp-mr1-dev
Andre Eisenbach [Thu, 19 Feb 2015 01:16:36 +0000 (01:16 +0000)]
Merge "Increase SDP buffer from 750 bytes to 4096 bytes" into lmp-mr1-dev

9 years agoIgnore service UUID length if no UUID filter is specified
Andre Eisenbach [Thu, 19 Feb 2015 00:33:34 +0000 (16:33 -0800)]
Ignore service UUID length if no UUID filter is specified

Bug: 19016326
Change-Id: I6156fee1d6079fec7879f47b6120befe2c4d35cd

9 years agoam dfb3b2f2: Add flag indicating encrypted connections to btif_dm_get_connection_state()
Andre Eisenbach [Tue, 10 Feb 2015 00:27:01 +0000 (00:27 +0000)]
am dfb3b2f2: Add flag indicating encrypted connections to btif_dm_get_connection_state()

* commit 'dfb3b2f2595dc16fe7f576a4b0c2f5e73db0327f':
  Add flag indicating encrypted connections to btif_dm_get_connection_state()

9 years agoAdd flag indicating encrypted connections to btif_dm_get_connection_state()
Andre Eisenbach [Fri, 6 Feb 2015 04:00:45 +0000 (20:00 -0800)]
Add flag indicating encrypted connections to btif_dm_get_connection_state()

Add a check to btif_dm_get_connection_state() to see if the currently
active connection is encrypted.

Bug: 19186961
Change-Id: I27bcc6e296d272ffd17c0bbe97631ffa4df57ccd

9 years agoam d6f2fa93: (-s ours) am d6419cd6: am 0a8c803a: am 7f34538a: (-s ours) am 65aec3a3...
Andre Eisenbach [Thu, 5 Feb 2015 05:02:29 +0000 (05:02 +0000)]
am d6f2fa93: (-s ours) am d6419cd6: am 0a8c803a: am 7f34538a: (-s ours) am 65aec3a3: am 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit 'd6f2fa93052c1d9bdf6035ace6b32345013516db':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam e791f732: (-s ours) am ae9d174b: am 408dec19: am 977acabd: (-s ours) am eebc8ab9...
Andre Eisenbach [Thu, 5 Feb 2015 04:52:37 +0000 (04:52 +0000)]
am e791f732: (-s ours) am ae9d174b: am 408dec19: am 977acabd: (-s ours) am eebc8ab9: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit 'e791f73202a2832b4d20dbc1ecd4b520adbb75d3':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam 0ad6cfde: (-s ours) am ce5ae4ab: am a708936d: DO NOT MERGE Change pairing_cb to...
Andre Eisenbach [Thu, 5 Feb 2015 04:52:25 +0000 (04:52 +0000)]
am 0ad6cfde: (-s ours) am ce5ae4ab: am a708936d: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit '0ad6cfdee8857a7bc54d4c3eb98bf1cdc82dc9a7':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam d6419cd6: am 0a8c803a: am 7f34538a: (-s ours) am 65aec3a3: am 6d429d9d: (-s ours...
Andre Eisenbach [Thu, 5 Feb 2015 04:38:21 +0000 (04:38 +0000)]
am d6419cd6: am 0a8c803a: am 7f34538a: (-s ours) am 65aec3a3: am 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit 'd6419cd6309bd20a2ab095c783bb6ad1f208bf4f':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam 0a8c803a: am 7f34538a: (-s ours) am 65aec3a3: am 6d429d9d: (-s ours) am 3efb9e2e...
Andre Eisenbach [Thu, 5 Feb 2015 04:32:54 +0000 (04:32 +0000)]
am 0a8c803a: am 7f34538a: (-s ours) am 65aec3a3: am 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit '0a8c803a48fe5afa71d1f8660539012e9b1f9642':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam 7f34538a: (-s ours) am 65aec3a3: am 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE...
Andre Eisenbach [Thu, 5 Feb 2015 04:25:27 +0000 (04:25 +0000)]
am 7f34538a: (-s ours) am 65aec3a3: am 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit '7f34538ac0e447a88d1f54ff819c28b3574f0aa4':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam 65aec3a3: am 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE Change pairing_cb to...
Andre Eisenbach [Thu, 5 Feb 2015 04:21:04 +0000 (04:21 +0000)]
am 65aec3a3: am 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit '65aec3a3f62c004d7073470f18330007b7ecf230':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam ae9d174b: am 408dec19: am 977acabd: (-s ours) am eebc8ab9: DO NOT MERGE Change...
Andre Eisenbach [Thu, 5 Feb 2015 04:07:04 +0000 (04:07 +0000)]
am ae9d174b: am 408dec19: am 977acabd: (-s ours) am eebc8ab9: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit 'ae9d174bc0afe0a7ed0bb4fb82836338fbb6adb1':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam 408dec19: am 977acabd: (-s ours) am eebc8ab9: DO NOT MERGE Change pairing_cb to...
Andre Eisenbach [Thu, 5 Feb 2015 04:01:12 +0000 (04:01 +0000)]
am 408dec19: am 977acabd: (-s ours) am eebc8ab9: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit '408dec1991255be919b1605e5cfe983b7f7154e9':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam 977acabd: (-s ours) am eebc8ab9: DO NOT MERGE Change pairing_cb to assume temporar...
Andre Eisenbach [Thu, 5 Feb 2015 03:54:01 +0000 (03:54 +0000)]
am 977acabd: (-s ours) am eebc8ab9: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit '977acabd3744a3308057b1485c7ac8658698e96b':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporar...
Andre Eisenbach [Thu, 5 Feb 2015 03:51:51 +0000 (03:51 +0000)]
am 6d429d9d: (-s ours) am 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit '6d429d9d0a1b537600c652dda2bc98d4c4ebd783':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam eebc8ab9: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 03:38:43 +0000 (03:38 +0000)]
am eebc8ab9: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit 'eebc8ab9c5e362d721f8f606f0a564ca9aff89d9':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 03:26:29 +0000 (03:26 +0000)]
am 3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit '3efb9e2e11471a67329ad17d48ffa79118ea76c6':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam ce5ae4ab: am a708936d: DO NOT MERGE Change pairing_cb to assume temporary pairing...
Andre Eisenbach [Thu, 5 Feb 2015 02:24:38 +0000 (02:24 +0000)]
am ce5ae4ab: am a708936d: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit 'ce5ae4abddaab8865bb44c83d2d44e14b0d7536b':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoam a708936d: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 02:11:12 +0000 (02:11 +0000)]
am a708936d: DO NOT MERGE Change pairing_cb to assume temporary pairing by default

* commit 'a708936da347b32f2a0811b5f33d9068c2b0de6f':
  DO NOT MERGE Change pairing_cb to assume temporary pairing by default

9 years agoIncrease SDP buffer from 750 bytes to 4096 bytes
Prerepa Viswanadham [Wed, 10 Dec 2014 23:34:48 +0000 (15:34 -0800)]
Increase SDP buffer from 750 bytes to 4096 bytes

Bug 18670169

Change-Id: Ida1a6a57dcce94339a190974af4565f14157cdc2

9 years agoDO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Mon, 26 Jan 2015 21:49:36 +0000 (13:49 -0800)]
DO NOT MERGE Change pairing_cb to assume temporary pairing by default

When pairing takes place, the pairing_cb.is_temp flag indicates whether
a pairing is temporary or permanent. Link keys are not stored for
temporary pairings. Since this is a "positive" flag, resetting the
pairing_cb control block (ex. memset to 0), it will assume persistent
pairing by default. Under certain circumstances, this can lead to a link
key being stored for temporarily secured connection.

This patch reverses the flag to be a "negative" flag. Renamed to
"persistent_bond", the default 0 meaning is now used to indicate a
temporary bond. If the lag is not properly set now, it will default to a
temporary bond and will not save the link key erronously.

Bug: 18345373
Change-Id: I06b1ba9331a70ebc29f4437bf836164658dec5ae

9 years agoDO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Mon, 26 Jan 2015 21:49:36 +0000 (13:49 -0800)]
DO NOT MERGE Change pairing_cb to assume temporary pairing by default

When pairing takes place, the pairing_cb.is_temp flag indicates whether
a pairing is temporary or permanent. Link keys are not stored for
temporary pairings. Since this is a "positive" flag, resetting the
pairing_cb control block (ex. memset to 0), it will assume persistent
pairing by default. Under certain circumstances, this can lead to a link
key being stored for temporarily secured connection.

This patch reverses the flag to be a "negative" flag. Renamed to
"persistent_bond", the default 0 meaning is now used to indicate a
temporary bond. If the lag is not properly set now, it will default to a
temporary bond and will not save the link key erronously.

Bug: 18345373
Change-Id: I8558abc9eace609b1ba02485b0ff775fb6f3c6af

9 years agoDO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Mon, 26 Jan 2015 21:49:36 +0000 (13:49 -0800)]
DO NOT MERGE Change pairing_cb to assume temporary pairing by default

When pairing takes place, the pairing_cb.is_temp flag indicates whether
a pairing is temporary or permanent. Link keys are not stored for
temporary pairings. Since this is a "positive" flag, resetting the
pairing_cb control block (ex. memset to 0), it will assume persistent
pairing by default. Under certain circumstances, this can lead to a link
key being stored for temporarily secured connection.

This patch reverses the flag to be a "negative" flag. Renamed to
"persistent_bond", the default 0 meaning is now used to indicate a
temporary bond. If the lag is not properly set now, it will default to a
temporary bond and will not save the link key erronously.

Bug: 18345373
Change-Id: Ifb61e7a23db07888a625db9ab851548600183136

9 years agoMerge "bta_dm_search_cancel sends dm_search state machine complete events" into lmp...
Prem Kumar [Fri, 30 Jan 2015 01:00:49 +0000 (01:00 +0000)]
Merge "bta_dm_search_cancel sends dm_search state machine complete events" into lmp-mr1-dev

9 years agobta_dm_search_cancel sends dm_search state machine complete events
Matthew Xie [Thu, 29 Jan 2015 01:30:13 +0000 (17:30 -0800)]
bta_dm_search_cancel sends dm_search state machine complete events

bta_dm_search_cancel moves dm_search state from active search to
search_canceling state. The function is also responsible of moving
the state out of canceling state.
Bug: 19017339

Change-Id: Idea0cb0e2987892a5fc0f66db8eed19f57c68b89

9 years agoChange pairing_cb to assume temporary pairing by default
Andre Eisenbach [Mon, 26 Jan 2015 21:49:36 +0000 (13:49 -0800)]
Change pairing_cb to assume temporary pairing by default

When pairing takes place, the pairing_cb.is_temp flag indicates whether
a pairing is temporary or permanent. Link keys are not stored for
temporary pairings. Since this is a "positive" flag, resetting the
pairing_cb control block (ex. memset to 0), it will assume persistent
pairing by default. Under certain circumstances, this can lead to a link
key being stored for temporarily secured connection.

This patch reverses the flag to be a "negative" flag. Renamed to
"persistent_bond", the default 0 meaning is now used to indicate a
temporary bond. If the lag is not properly set now, it will default to a
temporary bond and will not save the link key erronously.

Bug: 18345373
Change-Id: I6e821595877ff30d64dc6e33602ac049cab3dd1e

9 years agoMerge "Relax max PCM frames per tick a bit" into lmp-mr1-dev
Andre Eisenbach [Thu, 15 Jan 2015 23:37:10 +0000 (23:37 +0000)]
Merge "Relax max PCM frames per tick a bit" into lmp-mr1-dev

9 years agoLE: Add error status to failed write operation
Andre Eisenbach [Mon, 12 Jan 2015 21:34:01 +0000 (13:34 -0800)]
LE: Add error status to failed write operation

Bug: 18833375
Change-Id: Ib91c8e92658a276d813954264897b02863f1148b

9 years agoRelax max PCM frames per tick a bit
Andre Eisenbach [Wed, 7 Jan 2015 22:30:28 +0000 (14:30 -0800)]
Relax max PCM frames per tick a bit

Also made the value overwrite-able in bt_target.h.

Bug: 18913091
Change-Id: I64bbe453b35fdce6f127b3c23c0552b14d4ac49b

9 years agoAdded check if the device address is random
Tobias Melin [Wed, 17 Dec 2014 10:24:31 +0000 (11:24 +0100)]
Added check if the device address is random

A check if the device address is random is needed since in a
public device address the two most significatant bits can also be
equal to 01 (see Bluetooth specification Core_v4.1.pdf, page 2021
and page 2500).

Bug: 18784040
Change-Id: I4f967a426ebb825731461e202c0741ae0540ef6a

9 years agoAllow connection parameters updates by slave
Andre Eisenbach [Wed, 17 Dec 2014 00:18:10 +0000 (16:18 -0800)]
Allow connection parameters updates by slave

GATT service discovery in the slave role does not update to fast connection
parameters when connected. Accordin to the 4.0 spec, the connection
parameter disable/enable call is used for only by the masster role.
The 4.1 and later spec allows the slave role to control the connection
parameter update so that a slave role GATT client can perform the service
discovery using fast connection parameters.

Also switched to requestiong 7.5ms connection interval by default during
service discovery.

Bug: 18266904
Change-Id: Ie6300587306be3d694937e3888069e252592be42

9 years agoMerge "LE: Register for service change indication" into lmp-mr1-dev
Andre Eisenbach [Tue, 9 Dec 2014 23:16:09 +0000 (23:16 +0000)]
Merge "LE: Register for service change indication" into lmp-mr1-dev

9 years agoDo not log LE encryption keys or passkey
Andre Eisenbach [Tue, 9 Dec 2014 22:08:58 +0000 (14:08 -0800)]
Do not log LE encryption keys or passkey

Bug: 18687167
Change-Id: I2a2a7113e6bc7cfb22a6bd6f16d16ce2b7c84cff

9 years agoLE: Register for service change indication
Chaojing Sun [Sat, 6 Dec 2014 01:12:36 +0000 (17:12 -0800)]
LE: Register for service change indication

Some bonded remote devices require the client to register for service
change indication and actually set the client configuration descriptor
before service change indications can be removed.

This change add an additional step after device bonding has occured to
register for service change indication if possible.

Bug: 18173911
Change-Id: I25386faec0d58834ee2b0a9d1db2d2e052311264

9 years agoLE: Ignore non-volatile GATT service cache for non-bonded devices
Andre Eisenbach [Thu, 4 Dec 2014 23:04:23 +0000 (15:04 -0800)]
LE: Ignore non-volatile GATT service cache for non-bonded devices

If a device is not bonded, the non-volatile GATT service cache should
not be used. Only bonded devices have the capability to invalidate the
cache using the service changed indication.

Bug: 18571592
Change-Id: Ia75aa14f1c862a18237e78d24b63c22cf1dc82a8

9 years agoam cf7f6a15: Prevent Java call for acquiring already held wakelock
Andre Eisenbach [Thu, 4 Dec 2014 21:37:25 +0000 (21:37 +0000)]
am cf7f6a15: Prevent Java call for acquiring already held wakelock

* commit 'cf7f6a154aed48659260d391994dc59151be937b':
  Prevent Java call for acquiring already held wakelock

9 years agoMerge "Remove unnecessary check of multiple advertise instance count." into lmp-mr1-dev
Wei Wang [Thu, 4 Dec 2014 01:42:56 +0000 (01:42 +0000)]
Merge "Remove unnecessary check of multiple advertise instance count." into lmp-mr1-dev

9 years agoPrevent Java call for acquiring already held wakelock
Andre Eisenbach [Wed, 3 Dec 2014 18:35:53 +0000 (10:35 -0800)]
Prevent Java call for acquiring already held wakelock

Change-Id: Icf455b6aa7c0c1bf7abf7ea9700cfde17f6c7c2b

9 years agoMerge "PAN TAP fd is not monitored in all cases" into lmp-mr1-dev
Matthew Xie [Wed, 3 Dec 2014 22:15:11 +0000 (22:15 +0000)]
Merge "PAN TAP fd is not monitored in all cases" into lmp-mr1-dev

9 years agoMerge "Make GKI_TIMER_INTERVAL_FOR_WAKELOCK configurable for different target" into...
Matthew Xie [Wed, 3 Dec 2014 04:18:03 +0000 (04:18 +0000)]
Merge "Make GKI_TIMER_INTERVAL_FOR_WAKELOCK configurable for different target" into lmp-mr1-dev

9 years agoMake GKI_TIMER_INTERVAL_FOR_WAKELOCK configurable for different target
Matthew Xie [Wed, 3 Dec 2014 01:06:03 +0000 (17:06 -0800)]
Make GKI_TIMER_INTERVAL_FOR_WAKELOCK configurable for different target

Set the default value as 3000 ms
Bug: 18549150

Change-Id: I1d5b4fca627c22fdd8a32a41d5beac6837b6dff4

9 years agoAdd server-side callback for change in MTU (2/4)
Andre Eisenbach [Wed, 26 Nov 2014 20:56:55 +0000 (12:56 -0800)]
Add server-side callback for change in MTU (2/4)

When a client requests to update the LE transport MTU, the server
currently does not get notified and can therefor not properly size
notifications appropriate to the current MTU.

Bug: 18388114
Change-Id: Ice355f8919d4f69876574df1d90ce7d31f42bc4f

9 years agoRemove unnecessary check of multiple advertise instance count.
Wei Wang [Wed, 26 Nov 2014 20:47:49 +0000 (12:47 -0800)]
Remove unnecessary check of multiple advertise instance count.

Bug:18539121
Change-Id: I841e4323ed4995bd9f8117681a759f52995d071f

9 years agoPAN TAP fd is not monitored in all cases
Zhenye Zhu [Tue, 25 Nov 2014 23:51:07 +0000 (15:51 -0800)]
PAN TAP fd is not monitored in all cases

Bug: 18271987
Change-Id: I348f3851a955b5277e7cdf0102583eaaef2ef0f3

9 years agoam 254b5ba2: gki_buffer: add missing mutex unlock
Simon Wilson [Wed, 26 Nov 2014 00:59:38 +0000 (00:59 +0000)]
am 254b5ba2: gki_buffer: add missing mutex unlock

* commit '254b5ba2e3f4c44b82a0369579b66bafcd0d6aa2':
  gki_buffer: add missing mutex unlock