OSDN Git Service

android-x86/system-bt.git
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 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 "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 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 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

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

9 years agoSimultanious LE Central/Peripheral operation not possible
Kim Schulz [Wed, 25 Mar 2015 08:08:01 +0000 (09:08 +0100)]
Simultanious LE Central/Peripheral operation not possible

Bug: 18925497
Change-Id: I5a20e38ffebce4b251e4728944fce73db50e18f8

9 years agoBT: fix possible out of bounds read
kschulz [Wed, 11 Feb 2015 13:41:51 +0000 (14:41 +0100)]
BT: fix possible out of bounds read

In btm_ble_bgconn.c, function btm_update_bg_conn_list() if the last element in
"p_cb->bg_dev_list" is removed, the line:

"p_next = p_bg_dev + 1;"

will get "p_next" to point at an entry outside the bounds of the array.
There check for "p_next->in_use" may render a TRUE result depending on what
data exist in the memory pointed to by "p_next", which is unknown.
If the check passes, the sentence:

" memcpy(p_cur, p_next, sizeof(tBTM_LE_BG_CONN_DEV));"

will copy random data into the entry pointed at by "p_cur".
This can potentially corrupt the white list filling it with entries that
contain garbage and not allowing to add new valid devices to the list.

Bug: 18748601
Change-Id: I98b4be4e9f4568ea77f89146eae1e38f19fa1ee3

9 years agoSDP parameter checks too loose
Kim Schulz [Tue, 24 Sep 2013 07:52:52 +0000 (09:52 +0200)]
SDP parameter checks too loose

SDP Server's client req handler currently only check that the parameter length field does not indicate the parameters to excite the packet length. Sending SDP PDUs with
- fixed sdp_server_client_req to also check for length filed

If an invalid SDP Service Search Request Packet has the continuation info length field set to SDP_CONTINUATION_LEN, but does not contain any continuation information, the SDP server should answer with SDP_INVALID_CONT_STATE.
- fixed process_service_search so the length field is correctly checked
- fixed possible access to 2 bytes of memory outside the packet boundry

Bug: 10904535
Change-Id: I41fd021327fbf4f810ee4319bc95fa0dba0b48df

9 years agoInclude log library to make bdtool
Nitin Arora [Mon, 30 Mar 2015 19:22:30 +0000 (12:22 -0700)]
Include log library to make bdtool

This change adds the liblog library in the
make file for bdtool to provide for separate
compilation of the tool without causing link
errors while importing libosi

Change-Id: I87752ef7e1026080bd56fb377c73b457775f12a3

9 years agoRemove BLE_PERIPHERAL_ADV_NAME flag.
Wei Wang [Fri, 27 Mar 2015 18:28:54 +0000 (11:28 -0700)]
Remove BLE_PERIPHERAL_ADV_NAME flag.

BLE_PERIPHERAL_ADV_NAME forces inclusion of device name
in advertise data. Since setIncludeDeviceName is already
available in advertise API to control the presence of
device name the flag should be removed.

Change-Id: I8637529b2d809bb9829783f60bd7e9889784c8b7

9 years agoUsing generic format specifier for logging pointers
Nitin Arora [Wed, 25 Mar 2015 00:15:50 +0000 (17:15 -0700)]
Using generic format specifier for logging pointers

This change uses generic format specifier for logging the
pointers which can be 64 bit or 32 bit depending upon the
system used for compilation.
Also address of operator is used before casting a int variable
to void pointer.

Change-Id: Ie9dec408f3a5f674079f77c047d8192f65a004ca

9 years agoFix compile error on Fugu
Andre Eisenbach [Thu, 2 Apr 2015 08:01:34 +0000 (01:01 -0700)]
Fix compile error on Fugu

Change-Id: I389acc5c5034e1b232da0307f77577b939af68ac

9 years agoFix compile error on sprout
Andre Eisenbach [Thu, 2 Apr 2015 07:40:38 +0000 (00:40 -0700)]
Fix compile error on sprout

Change-Id: I65e03f18921ab0f2938797fd68429eae7b3a1c73

9 years agoFix dlsym change/failure by hard-coding internal module references.
Etan Cohen [Wed, 1 Apr 2015 22:00:27 +0000 (15:00 -0700)]
Fix dlsym change/failure by hard-coding internal module references.

Should be reverted once permanent solution for dlsym change merged.

Change-Id: I2c0843875f88c8c56899b60246907af12d29fb0c

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

9 years agoFix build issues in bluedroid on master
Etan Cohen [Wed, 1 Apr 2015 00:15:53 +0000 (17:15 -0700)]
Fix build issues in bluedroid on master

Change-Id: I0d3e93ea61dd03505fe9db902ed90bdd4141cab2

9 years agoMerge "Simultanious LE Central/Peripheral operation not possible" into m-wireless-dev
Andre Eisenbach [Tue, 31 Mar 2015 22:29:40 +0000 (22:29 +0000)]
Merge "Simultanious LE Central/Peripheral operation not possible" into m-wireless-dev

9 years agoBT: fix possible out of bounds read
kschulz [Wed, 11 Feb 2015 13:41:51 +0000 (14:41 +0100)]
BT: fix possible out of bounds read

In btm_ble_bgconn.c, function btm_update_bg_conn_list() if the last element in
"p_cb->bg_dev_list" is removed, the line:

"p_next = p_bg_dev + 1;"

will get "p_next" to point at an entry outside the bounds of the array.
There check for "p_next->in_use" may render a TRUE result depending on what
data exist in the memory pointed to by "p_next", which is unknown.
If the check passes, the sentence:

" memcpy(p_cur, p_next, sizeof(tBTM_LE_BG_CONN_DEV));"

will copy random data into the entry pointed at by "p_cur".
This can potentially corrupt the white list filling it with entries that
contain garbage and not allowing to add new valid devices to the list.

Bug: 18748601
Change-Id: I98b4be4e9f4568ea77f89146eae1e38f19fa1ee3

9 years agoSDP parameter checks too loose
Kim Schulz [Tue, 24 Sep 2013 07:52:52 +0000 (09:52 +0200)]
SDP parameter checks too loose

SDP Server's client req handler currently only check that the parameter length field does not indicate the parameters to excite the packet length. Sending SDP PDUs with
- fixed sdp_server_client_req to also check for length filed

If an invalid SDP Service Search Request Packet has the continuation info length field set to SDP_CONTINUATION_LEN, but does not contain any continuation information, the SDP server should answer with SDP_INVALID_CONT_STATE.
- fixed process_service_search so the length field is correctly checked
- fixed possible access to 2 bytes of memory outside the packet boundry

Bug: 10904535
Change-Id: I41fd021327fbf4f810ee4319bc95fa0dba0b48df

9 years agoMerge commit 'f7f839985b3931682363d2ef3b7c5cae55a842ee' into merge
Etan Cohen [Tue, 31 Mar 2015 17:41:53 +0000 (10:41 -0700)]
Merge commit 'f7f839985b3931682363d2ef3b7c5cae55a842ee' into merge

Change-Id: Iaaec1ea0bf3009b7e32a9a60f697631a3f56e889

9 years agomerge in m-wireless-internal-release history after reset to 78c0b060f29b7b7014adddb2f...
The Android Automerger [Tue, 31 Mar 2015 13:46:15 +0000 (06:46 -0700)]
merge in m-wireless-internal-release history after reset to 78c0b060f29b7b7014adddb2f98bf6ae9755c488

9 years agoInclude log library to make bdtool
Nitin Arora [Mon, 30 Mar 2015 19:22:30 +0000 (12:22 -0700)]
Include log library to make bdtool

This change adds the liblog library in the
make file for bdtool to provide for separate
compilation of the tool without causing link
errors while importing libosi

Change-Id: I87752ef7e1026080bd56fb377c73b457775f12a3

9 years agoUsing generic format specifier for logging pointers
Nitin Arora [Wed, 25 Mar 2015 00:15:50 +0000 (17:15 -0700)]
Using generic format specifier for logging pointers

This change uses generic format specifier for logging the
pointers which can be 64 bit or 32 bit depending upon the
system used for compilation.
Also address of operator is used before casting a int variable
to void pointer.

Change-Id: Ie9dec408f3a5f674079f77c047d8192f65a004ca

9 years agoRemove BLE_PERIPHERAL_ADV_NAME flag.
Wei Wang [Fri, 27 Mar 2015 18:28:54 +0000 (11:28 -0700)]
Remove BLE_PERIPHERAL_ADV_NAME flag.

BLE_PERIPHERAL_ADV_NAME forces inclusion of device name
in advertise data. Since setIncludeDeviceName is already
available in advertise API to control the presence of
device name the flag should be removed.

Change-Id: I8637529b2d809bb9829783f60bd7e9889784c8b7

9 years agomerge in m-wireless-internal-release history after reset to a5371c238b4e874d8313ac56a...
The Android Automerger [Mon, 30 Mar 2015 13:45:23 +0000 (06:45 -0700)]
merge in m-wireless-internal-release history after reset to a5371c238b4e874d8313ac56a23451e7345ff541

9 years agoMake A2DP audio HAL a shared library again
Andre Eisenbach [Sat, 28 Mar 2015 00:12:19 +0000 (17:12 -0700)]
Make A2DP audio HAL a shared library again

The audio HAL is loaded separately from the Bluetooth stack and thus
needs to stay separate.

Change-Id: I8d8601a6e753099f4f058dc0192b93c53be2ffb1

9 years agoMake A2DP audio HAL a shared library again
Andre Eisenbach [Sat, 28 Mar 2015 00:12:19 +0000 (17:12 -0700)]
Make A2DP audio HAL a shared library again

The audio HAL is loaded separately from the Bluetooth stack and thus
needs to stay separate.

Change-Id: I8d8601a6e753099f4f058dc0192b93c53be2ffb1

9 years agoMove unused include file out of hci_audio.h
Andre Eisenbach [Thu, 26 Mar 2015 21:14:40 +0000 (14:14 -0700)]
Move unused include file out of hci_audio.h

This fixes include path issues for libbt.

Change-Id: I416f563c0056216e86898d8e9cc111b600c73ce0

9 years agoAdd option for schedule_next_instance to force rescheduling
Zach Johnson [Thu, 26 Mar 2015 22:07:43 +0000 (15:07 -0700)]
Add option for schedule_next_instance to force rescheduling

If we're rescheduling a periodic timer in the context of an alarm
expiration we want to force rescheduling to happen.

The alarm at the front of the list after scheduling the next
instance may be a different alarm. The old code would assume it was
already scheduled correctly, meaning nothing would ever get scheduled
after that.

Change-Id: I8accf5d004e69dfd6477ab7ec529eea42b3a88f8

9 years agoEnsure alarms are called back when they expire in the past
Zach Johnson [Thu, 26 Mar 2015 06:32:11 +0000 (23:32 -0700)]
Ensure alarms are called back when they expire in the past

Turns out the posix timers we're dealing with aren't well behaved.

If the timer is TIMER_ABSTIME the following is supposed to be true:
"If the specified time has already passed, the function shall succeed
and the expiration notification shall be made."

But alas, this is not the case. If the expiration time happens to be
in the past (e.g. very short timer which gets hit with a context switch
before the timer can be set) the timer decides to disarm itself. This
means no more callbacks happen, and no more alarms are processed ever.

sadness.

But thankfully, we can use timer_gettime to check the state of the timer
after timer_settime. If timer_gettime tells us the timer is disarmed
right after we armed it, we want to perform the alarm callback
ourselves.

Put all timer callbacks on the same thread (as would be the case in the
underlying timer implementation already) and used a sempahore to signal
when an alarm expires in the normal posix timer callback and also in the
timer didn't set case.

Change-Id: I39854b241369b2da52afbaaba0c01d3167a47e32

9 years agoRewrite alarms to use a single posix timer instance
Zach Johnson [Tue, 24 Mar 2015 01:07:46 +0000 (18:07 -0700)]
Rewrite alarms to use a single posix timer instance

This means we lose the ability to send the intended alarm
as context with the posix timer, but this can be handled
gracefully enough by making sure we actually have an
expired alarm at the front of the list when the timer
callback occurs.

Change-Id: I909195b5c3155075096328c529655eeb5b7d80d0

9 years agoResolved hardware error observed during SCO Connection setup
Mudumba Ananth [Wed, 25 Mar 2015 12:20:02 +0000 (05:20 -0700)]
Resolved hardware error observed during SCO Connection setup

Hardware error was caused due to a faulty HCI command formed in the
process of vendor specific pre-SCO setup in the stack(set_audio_state)

Fixed the above problem and also added back the vendor (interface)
mapping for the set_audio_state functionality to facilitate the
sending of the pre-SCO vendor specific commands.

Made common vendor library audio setting by moving to hci subsystem.

General cleanup around this functionality.

Bug: 19923226
Change-Id: I4a743f6725459f360bd2a90e0a46f08fcca2292d

9 years agoMerge "Fix macro for maximum allowed HOGP devices" into m-wireless-dev
Andre Eisenbach [Fri, 27 Mar 2015 01:01:34 +0000 (01:01 +0000)]
Merge "Fix macro for maximum allowed HOGP devices" into m-wireless-dev

9 years agoFix macro for maximum allowed HOGP devices
Nitin Arora [Mon, 10 Mar 2014 20:25:27 +0000 (13:25 -0700)]
Fix macro for maximum allowed HOGP devices

This checks HOGP dev handle count less than or equal to maximum
allowed HOGP devices.

Change-Id: I63e6c3bc64a8c305b739b5eade0e846315e1ad1d

9 years agoAdd option for schedule_next_instance to force rescheduling
Zach Johnson [Thu, 26 Mar 2015 22:07:43 +0000 (15:07 -0700)]
Add option for schedule_next_instance to force rescheduling

If we're rescheduling a periodic timer in the context of an alarm
expiration we want to force rescheduling to happen.

The alarm at the front of the list after scheduling the next
instance may be a different alarm. The old code would assume it was
already scheduled correctly, meaning nothing would ever get scheduled
after that.

Change-Id: I8accf5d004e69dfd6477ab7ec529eea42b3a88f8

9 years agoDemote bta_av_link_role_ok error level to info
Chris Manton [Thu, 26 Mar 2015 21:49:25 +0000 (14:49 -0700)]
Demote bta_av_link_role_ok error level to info

Change-Id: I4399432c9071614fc610d9de084028e48aeaf8fd

9 years agoRemove unused file hci/include/bt_hci_lib.h
Chris Manton [Thu, 26 Mar 2015 21:08:38 +0000 (14:08 -0700)]
Remove unused file hci/include/bt_hci_lib.h

Change-Id: I60d87da42fa28dd57d50384396e30504103d1ae5

9 years agoEnsure alarms are called back when they expire in the past
Zach Johnson [Thu, 26 Mar 2015 06:32:11 +0000 (23:32 -0700)]
Ensure alarms are called back when they expire in the past

Turns out the posix timers we're dealing with aren't well behaved.

If the timer is TIMER_ABSTIME the following is supposed to be true:
"If the specified time has already passed, the function shall succeed
and the expiration notification shall be made."

But alas, this is not the case. If the expiration time happens to be
in the past (e.g. very short timer which gets hit with a context switch
before the timer can be set) the timer decides to disarm itself. This
means no more callbacks happen, and no more alarms are processed ever.

sadness.

But thankfully, we can use timer_gettime to check the state of the timer
after timer_settime. If timer_gettime tells us the timer is disarmed
right after we armed it, we want to perform the alarm callback
ourselves.

Put all timer callbacks on the same thread (as would be the case in the
underlying timer implementation already) and used a sempahore to signal
when an alarm expires in the normal posix timer callback and also in the
timer didn't set case.

Change-Id: I39854b241369b2da52afbaaba0c01d3167a47e32

9 years agoRewrite alarms to use a single posix timer instance
Zach Johnson [Tue, 24 Mar 2015 01:07:46 +0000 (18:07 -0700)]
Rewrite alarms to use a single posix timer instance

This means we lose the ability to send the intended alarm
as context with the posix timer, but this can be handled
gracefully enough by making sure we actually have an
expired alarm at the front of the list when the timer
callback occurs.

Change-Id: I909195b5c3155075096328c529655eeb5b7d80d0

9 years agoChange logtag to conform to rest of module
Chris Manton [Thu, 26 Mar 2015 20:28:51 +0000 (13:28 -0700)]
Change logtag to conform to rest of module

Change-Id: I9b99111f50dc4f1c581ef96e78b36d14b51a6866

9 years agoMove unused include file out of hci_audio.h
Andre Eisenbach [Thu, 26 Mar 2015 21:14:40 +0000 (14:14 -0700)]
Move unused include file out of hci_audio.h

This fixes include path issues for libbt.

Change-Id: I416f563c0056216e86898d8e9cc111b600c73ce0

9 years agoResolved hardware error observed during SCO Connection setup
Mudumba Ananth [Wed, 25 Mar 2015 12:20:02 +0000 (05:20 -0700)]
Resolved hardware error observed during SCO Connection setup

Hardware error was caused due to a faulty HCI command formed in the
process of vendor specific pre-SCO setup in the stack(set_audio_state)

Fixed the above problem and also added back the vendor (interface)
mapping for the set_audio_state functionality to facilitate the
sending of the pre-SCO vendor specific commands.

Made common vendor library audio setting by moving to hci subsystem.

General cleanup around this functionality.

Bug: 19923226
Change-Id: I4a743f6725459f360bd2a90e0a46f08fcca2292d

9 years agoRandom address does not get written properly
Satya Calloji [Tue, 3 Feb 2015 22:41:49 +0000 (14:41 -0800)]
Random address does not get written properly

The random address not getting written with correct
instance ID, as per Google spec.

Bug: 19370739
Change-Id: I7e5fc8d274bad5f127bd791469a46e2f257eaddd

9 years agoBuilds server with service, characteristic, and descriptor UUIDs. Then starts and...
Steve Gu [Thu, 6 Nov 2014 19:16:41 +0000 (11:16 -0800)]
Builds server with service, characteristic, and descriptor UUIDs. Then starts and stops the server.

Change-Id: I22e269010c5e4d96d9562155e03903c3ea957c97

9 years agoAdds tests for BLE advertising and BLE server register. Also fixes random seed.
Steve Gu [Wed, 29 Oct 2014 01:38:30 +0000 (18:38 -0700)]
Adds tests for BLE advertising and BLE server register. Also fixes random seed.

Change-Id: Ic15360baefb133b761ff077d27946c0ea7fa3edb

9 years agoAdds BLE tests to bdtest.
Steve Gu [Mon, 27 Oct 2014 19:59:02 +0000 (12:59 -0700)]
Adds BLE tests to bdtest.

Change-Id: Idcdc01339f0e8a14b6fedf27545566e7efdf53c2

9 years agoMerge "Add section on booleans and bitfields to the style guide" into m-wireless-dev
Andre Eisenbach [Thu, 26 Mar 2015 00:04:14 +0000 (00:04 +0000)]
Merge "Add section on booleans and bitfields to the style guide" into m-wireless-dev

9 years agoAdd section on booleans and bitfields to the style guide
Zach Johnson [Tue, 24 Mar 2015 17:05:15 +0000 (10:05 -0700)]
Add section on booleans and bitfields to the style guide

Change-Id: I75df8b638d71bfe2ba1dc98d3eb148d8a61f5b9c

9 years agoRectify allocation of GATT control block
Nitin Arora [Fri, 20 Mar 2015 00:00:35 +0000 (17:00 -0700)]
Rectify allocation of GATT control block

This change ensures that a valid value is returned while
requesting available control block or allocating memory
for a new control block for saving GATT discovery handles.
The bug if not fixed causes memory corruption and thus
modifying some callback handles.

Change-Id: I148ee82d2ea9fe77bebd34fd345b4fb6a6eee3cd

9 years agoRevert "Resolved hardware error observed during SCO Connection setup"
Chris Manton [Wed, 25 Mar 2015 18:01:11 +0000 (18:01 +0000)]
Revert "Resolved hardware error observed during SCO Connection setup"

This reverts commit 4d8ac4ff015ff87c4e985ac0d9a5f3c2a6b0d9fa.

Change-Id: Ie1433c82014b6ddce78c5363100ab109ae0fecde

9 years agoResolved hardware error observed during SCO Connection setup
Mudumba Ananth [Wed, 25 Mar 2015 12:20:02 +0000 (05:20 -0700)]
Resolved hardware error observed during SCO Connection setup

Hardware error was caused due to a faulty HCI command formed in the
process of vendor specific pre-SCO setup in the stack(set_audio_state)

Fixed the above problem and also added back the vendor (interface)
mapping for the set_audio_state functionality to facilitate the
sending of the pre-SCO vendor specific commands.

Bug: 19923226
Change-Id: I03c6a1c048c21549b7326a783b70588686283eb3

9 years agoSimultanious LE Central/Peripheral operation not possible
Kim Schulz [Wed, 25 Mar 2015 08:08:01 +0000 (09:08 +0100)]
Simultanious LE Central/Peripheral operation not possible

Bug: 18925497
Change-Id: I5a20e38ffebce4b251e4728944fce73db50e18f8

9 years agoam 80349eb4: am 0d65d4cd: AVRCP: Proper handling of Fragmented AVCTP packet
Mallikarjuna GB [Wed, 25 Mar 2015 00:14:37 +0000 (00:14 +0000)]
am 80349eb4: am 0d65d4cd: AVRCP: Proper handling of Fragmented AVCTP packet

* commit '80349eb4a14e74b6e28dac7829dcf2a199bd1de5':
  AVRCP: Proper handling of Fragmented AVCTP packet

9 years agoAllow dual-mode devices to be processed by BR/EDR scan
Nitin Arora [Wed, 22 Jan 2014 18:33:26 +0000 (10:33 -0800)]
Allow dual-mode devices to be processed by BR/EDR scan

This change lets a Dual mode device which is already processed
as LE device for the current inquiry, to be also processed as
a BR/EDR device in case an extended inquiry result is recvd.
This helps setting the cod correctly.

Change-Id: I0a0c598ebdafe2b6153015c3cda5dde8f7a15873

9 years agoam 0d65d4cd: AVRCP: Proper handling of Fragmented AVCTP packet
Mallikarjuna GB [Tue, 24 Mar 2015 22:39:10 +0000 (22:39 +0000)]
am 0d65d4cd: AVRCP: Proper handling of Fragmented AVCTP packet

* commit '0d65d4cdafc165484dfc8d1c5af4ac1cb7453fd7':
  AVRCP: Proper handling of Fragmented AVCTP packet

9 years agoAVRCP: Proper handling of Fragmented AVCTP packet
Mallikarjuna GB [Sun, 10 Nov 2013 08:00:25 +0000 (13:30 +0530)]
AVRCP: Proper handling of Fragmented AVCTP packet

- AVCTP : Allocate bigger buffer for reassembly
- AVRCP : Handle getelimentattr to eliminate duplicates
          and invalid attributes, this also fixes BOF.

Change-Id: I99f6e0fc4dc0cc0fac8854a8ee8671249d67f745
CRs-Fixed: 576831

9 years agoam 8b64bc93: (-s ours) am d30c100b: Merge "DO NOT MERGE Change AVCTP revision to...
Justin Koh [Tue, 24 Mar 2015 19:05:44 +0000 (19:05 +0000)]
am 8b64bc93: (-s ours) am d30c100b: Merge "DO NOT MERGE Change AVCTP revision to 1.4" into lmp-mr1-modular-dev

* commit '8b64bc93aea5a80d407fe78869f90edf0496fd7b':
  DO NOT MERGE Change AVCTP revision to 1.4

9 years agoam d30c100b: Merge "DO NOT MERGE Change AVCTP revision to 1.4" into lmp-mr1-modular-dev
Justin Koh [Tue, 24 Mar 2015 18:52:32 +0000 (18:52 +0000)]
am d30c100b: Merge "DO NOT MERGE Change AVCTP revision to 1.4" into lmp-mr1-modular-dev

* commit 'd30c100bf8789b96cb282fdee9a66822d4725a07':
  DO NOT MERGE Change AVCTP revision to 1.4

9 years agoMerge "DO NOT MERGE Change AVCTP revision to 1.4" into lmp-mr1-modular-dev
Justin Koh [Tue, 24 Mar 2015 18:48:11 +0000 (18:48 +0000)]
Merge "DO NOT MERGE Change AVCTP revision to 1.4" into lmp-mr1-modular-dev

9 years agoRewrite alarm to avoid drift in the periodic version
Zach Johnson [Mon, 23 Mar 2015 20:59:10 +0000 (13:59 -0700)]
Rewrite alarm to avoid drift in the periodic version

Also improve names of some functions.

Change-Id: Ia5aeebc8226ce5c36abdd372ea4de5195314e273

9 years agoMerge "Remove unused remote_name_* variables" into m-wireless-dev
Andre Eisenbach [Tue, 24 Mar 2015 01:11:01 +0000 (01:11 +0000)]
Merge "Remove unused remote_name_* variables" into m-wireless-dev

9 years agoRemove unused remote_name_* variables
Andre Eisenbach [Tue, 24 Mar 2015 01:07:54 +0000 (18:07 -0700)]
Remove unused remote_name_* variables

Change-Id: Ib0db95646564439a9458542db9b1891ea818c5d7

9 years agoMerge "Style guide: Use C99 style flexible arrays" into m-wireless-dev
Andre Eisenbach [Tue, 24 Mar 2015 00:44:36 +0000 (00:44 +0000)]
Merge "Style guide: Use C99 style flexible arrays" into m-wireless-dev

9 years agoStyle guide: Use C99 style flexible arrays
Andre Eisenbach [Thu, 19 Mar 2015 22:38:34 +0000 (15:38 -0700)]
Style guide: Use C99 style flexible arrays

Change-Id: I012d9f4195833e2c6c9a5c953e71b7a7b5847673

9 years agoDelete 0 index LE scan filter at inquiry cancel
Nitin Arora [Fri, 26 Sep 2014 21:05:24 +0000 (14:05 -0700)]
Delete 0 index LE scan filter at inquiry cancel

This patch ensures that the 0 index filter is deleted when the
inquiry is cancelled due to initiation of a direct connection
from inquiry or due to return from the Settings menu screen

Change-Id: I281c6ace15b17fb7e413c42d36e016b8f82d2ace

9 years agoIgnore LE security request if BR/EDR pairing is ongoing
Nitin Arora [Sat, 22 Mar 2014 01:28:04 +0000 (18:28 -0700)]
Ignore LE security request if BR/EDR pairing is ongoing

This change checks the btm state to see if a BR/EDR pairing
is ongoing when a security request is received from a remote
device.

Change-Id: Ia3f9c9db6c1aed944857174528c14ed66f184152

9 years agoMerge "Extend Bluetooth startup timeout from 3s to 8s" into m-wireless-dev
Andre Eisenbach [Mon, 23 Mar 2015 20:26:23 +0000 (20:26 +0000)]
Merge "Extend Bluetooth startup timeout from 3s to 8s" into m-wireless-dev

9 years agoMerge "Reset LE connecting flag on disconnect only if BDA matches" into m-wireless-dev
Andre Eisenbach [Mon, 23 Mar 2015 20:21:42 +0000 (20:21 +0000)]
Merge "Reset LE connecting flag on disconnect only if BDA matches" into m-wireless-dev

9 years agoMerge "Remove ACL connection reference counting" into m-wireless-dev
Andre Eisenbach [Mon, 23 Mar 2015 20:12:53 +0000 (20:12 +0000)]
Merge "Remove ACL connection reference counting" into m-wireless-dev

9 years agoReset LE connecting flag on disconnect only if BDA matches
Nitin Arora [Fri, 6 Jun 2014 22:21:25 +0000 (15:21 -0700)]
Reset LE connecting flag on disconnect only if BDA matches

This change will make sure that the flag representing that BLE device
is connecting is made false only if a disconnection of the same
LE device is received, whose connection is in progress. This is ensured
by matching the bda of the disconnecting device and the LE device which
is in connecting state. This is to prevent a BR/EDR disconnection from
cancelling the connection timeout of an LE device

Change-Id: Ia5b47681479dc0be217cdfc3e15af9ca5323575c

9 years agoSend GATT discovery complete only if discovery is active
Nitin Arora [Tue, 18 Feb 2014 23:28:59 +0000 (15:28 -0800)]
Send GATT discovery complete only if discovery is active

This change forces a discovery complete event at gatt close
event only if service discovery is in progress and not when
inquiry is on going. Otherwise, a false discovery complete
is sent to the host, which cause a never ending inquiry.

Change-Id: I7ca207382b04ed233c149ca50040dab993067870

9 years agoExtend Bluetooth startup timeout from 3s to 8s
Andre Eisenbach [Mon, 23 Mar 2015 16:46:08 +0000 (09:46 -0700)]
Extend Bluetooth startup timeout from 3s to 8s

Change-Id: I0e8af541bf9c5837d92b5ccc047b3dd9d3765767