OSDN Git Service

android-x86/system-bt.git
6 years agoChange our AVRCP capabilities if the remote device only supports 1.3 am: c8ab11a06a
Ajay Panicker [Fri, 22 Sep 2017 20:19:43 +0000 (20:19 +0000)]
Change our AVRCP capabilities if the remote device only supports 1.3 am: c8ab11a06a
am: 38cb8be9c3

Change-Id: I4951d1ba9a0e086b89340cf3cf00bcaf66b084ad

6 years agoChange our AVRCP capabilities if the remote device only supports 1.3
Ajay Panicker [Fri, 22 Sep 2017 20:15:23 +0000 (20:15 +0000)]
Change our AVRCP capabilities if the remote device only supports 1.3
am: c8ab11a06a

Change-Id: I0aee338bc6c387ea6060637c74d89fa0745c40e5

6 years agoChange our AVRCP capabilities if the remote device only supports 1.3
Ajay Panicker [Wed, 6 Sep 2017 16:59:51 +0000 (09:59 -0700)]
Change our AVRCP capabilities if the remote device only supports 1.3

This prevents issues with devices that only support 1.3 but can not
handle forward compatability like some Alpine Carkits.

Bug: 37943083
Test: Connect to Alpine carkit that only supports 1.3 and see new features
      are used.

Change-Id: I6d041590dc51d7e8711b17fb1cb9c880b640052a
Merged-In: I6d041590dc51d7e8711b17fb1cb9c880b640052a
(cherry picked from commit f9f1c8b449efb9cb7894a64fe2977f875679ba52)
(cherry picked from commit ff2d86ed3af91099597d033a76a143437543d6fd)

6 years agoGAP: Set service_id before calling gap_release_ccb am: 4c6208fd2d
Myles Watson [Thu, 21 Sep 2017 22:01:26 +0000 (22:01 +0000)]
GAP: Set service_id before calling gap_release_ccb am: 4c6208fd2d
am: acf7e8e1ac

Change-Id: Ie4e81653a6a05a050f2c369cafc02ff4cb41da3e

6 years agoGAP: Set service_id before calling gap_release_ccb
Myles Watson [Thu, 21 Sep 2017 21:52:54 +0000 (21:52 +0000)]
GAP: Set service_id before calling gap_release_ccb
am: 4c6208fd2d

Change-Id: I705d78e301414308a7150a20576f61a9e95f35c3

6 years agoGAP: Set service_id before calling gap_release_ccb
Myles Watson [Thu, 14 Sep 2017 21:13:44 +0000 (14:13 -0700)]
GAP: Set service_id before calling gap_release_ccb

Calling gap_release_ccb with a service_id == 0, which in turn
calls BTM_SecClrService with an ID of 0.

From the documentation for BTM_SecClrService:

  Service ID - Id of the service to remove. '0' removes all
               service records (except SDP).

Bug: 6569576965223508
Test: BLE connection and characteristic read
Change-Id: Icf309807f02e1faa273cf9bad9c09d9221a8bbfd
(cherry picked from commit 5c5c10683e2a11162838297fc8054b15837c4f32)
(cherry picked from commit 4023c6731d5e991c6202d4e499b9dd43d642fb3c)

6 years agoEnable extra A2DP control log messages
Pavlin Radoslavov [Wed, 20 Sep 2017 03:29:33 +0000 (20:29 -0700)]
Enable extra A2DP control log messages

Also, fixed a log message when failed to accept the
corresponding socket socket.

Test: manual
Bug: 63949429
Change-Id: I6d9af32f61974a739d179c37da36c360aefcca79
(cherry picked from commit 7b67302a28019468ae6df9cdb7f9085c6579b859)

6 years agoFix build error for AVRCP13 compat fix
Andre Eisenbach [Sat, 16 Sep 2017 15:27:42 +0000 (15:27 +0000)]
Fix build error for AVRCP13 compat fix
am: ab0fec08a4  -s ours

Change-Id: I6b0837dbb37dc51267ec5eb6955ba7c6facca53c

6 years agoChange our AVRCP capabilities if the remote device only supports 1.3
Ajay Panicker [Sat, 16 Sep 2017 15:27:37 +0000 (15:27 +0000)]
Change our AVRCP capabilities if the remote device only supports 1.3
am: ff2d86ed3a  -s ours

Change-Id: I8edbd554ec49ed2d05f747664c538a54bbad74ed

6 years agoFix build error for AVRCP13 compat fix
Andre Eisenbach [Sat, 16 Sep 2017 07:22:10 +0000 (00:22 -0700)]
Fix build error for AVRCP13 compat fix

Bug: 37943083
Test: manual
Change-Id: I3974192dd007804f90f35a724a39824ed093a633
Merged-In: I6d041590dc51d7e8711b17fb1cb9c880b640052a

6 years agoChange our AVRCP capabilities if the remote device only supports 1.3
Ajay Panicker [Wed, 6 Sep 2017 16:59:51 +0000 (09:59 -0700)]
Change our AVRCP capabilities if the remote device only supports 1.3

This prevents issues with devices that only support 1.3 but can not
handle forward compatability like some Alpine Carkits.

Bug: 37943083
Test: Connect to Alpine carkit that only supports 1.3 and see new features
      are used.

Change-Id: I6d041590dc51d7e8711b17fb1cb9c880b640052a
Merged-In: I6d041590dc51d7e8711b17fb1cb9c880b640052a
(cherry picked from commit f9f1c8b449efb9cb7894a64fe2977f875679ba52)

6 years agoDO NOT MERGE Fix unknown type issue in unit tests
Jack He [Sat, 16 Sep 2017 06:12:11 +0000 (06:12 +0000)]
DO NOT MERGE Fix unknown type issue in unit tests
am: 9b4aebb1ba  -s ours

Change-Id: I8fe51a6c113e8dd94e7822cd45548043baddfb51

6 years agoClean-up BTIF profile queue on profile shutdown
Jack He [Sat, 16 Sep 2017 06:12:05 +0000 (06:12 +0000)]
Clean-up BTIF profile queue on profile shutdown
am: a2d0cbc35a  -s ours

Change-Id: I25dae768d2fb38d1b8b0747bba8cf46300838530

6 years agoDO NOT MERGE Fix unknown type issue in unit tests
Jack He [Sat, 16 Sep 2017 01:03:29 +0000 (18:03 -0700)]
DO NOT MERGE Fix unknown type issue in unit tests

Bug: 63790458
Test: build, unit test
Change-Id: If5e403907292aa25c8d39b17f2f1818d493433e6
Merged-In: I28288c295b7ca0259b2112c11b4e5a81d6f2e33c

6 years agoMerge "Clean-up BTIF profile queue on profile shutdown" into oc-mr1-dev
TreeHugger Robot [Sat, 16 Sep 2017 01:24:29 +0000 (01:24 +0000)]
Merge "Clean-up BTIF profile queue on profile shutdown" into oc-mr1-dev

6 years agoClean-up BTIF profile queue on profile shutdown
Jack He [Fri, 15 Sep 2017 00:13:19 +0000 (17:13 -0700)]
Clean-up BTIF profile queue on profile shutdown

* Add btif_profile_cleanup(uuid) method to remove pending connection
  requests for individual UUIDs
* Call the above method in each profile's clean-up method
* Add unit tests for btif_profile_queue

Bug: 63790458
Test: make, unit tests, pair and connect car kits
Change-Id: I28288c295b7ca0259b2112c11b4e5a81d6f2e33c
Merged-In: I28288c295b7ca0259b2112c11b4e5a81d6f2e33c
(cherry picked from commit d366807102bce97e494e83570d757ebcb6a33b3c)

6 years agoMerge "Don't reject notifications and wait until new addressed player is ready (2...
Ajay Panicker [Sat, 16 Sep 2017 00:14:14 +0000 (00:14 +0000)]
Merge "Don't reject notifications and wait until new addressed player is ready (2/2)" into oc-dr1-dev
am: 7fba61cf06  -s ours

Change-Id: Ibbe07200a10dcbd5a2aa189a4d1e95fab9912a3c

6 years agoMerge "Don't reject notifications and wait until new addressed player is ready (2...
TreeHugger Robot [Sat, 16 Sep 2017 00:10:43 +0000 (00:10 +0000)]
Merge "Don't reject notifications and wait until new addressed player is ready (2/2)" into oc-dr1-dev

6 years agoGAP: Set service_id before calling gap_release_ccb
Myles Watson [Fri, 15 Sep 2017 23:37:23 +0000 (23:37 +0000)]
GAP: Set service_id before calling gap_release_ccb
am: f606990828  -s ours

Change-Id: I5d2b91b2f343491ef4ad1654f30eab118b173a52

6 years agoClean-up BTIF profile queue on profile shutdown
Jack He [Fri, 15 Sep 2017 00:13:19 +0000 (17:13 -0700)]
Clean-up BTIF profile queue on profile shutdown

* Add btif_profile_cleanup(uuid) method to remove pending connection
  requests for individual UUIDs
* Call the above method in each profile's clean-up method
* Add unit tests for btif_profile_queue

Bug: 63790458
Test: make, unit tests, pair and connect car kits
Change-Id: I28288c295b7ca0259b2112c11b4e5a81d6f2e33c
(cherry picked from commit d366807102bce97e494e83570d757ebcb6a33b3c)

6 years agoGAP: Set service_id before calling gap_release_ccb
Myles Watson [Thu, 14 Sep 2017 21:13:44 +0000 (14:13 -0700)]
GAP: Set service_id before calling gap_release_ccb

Calling gap_release_ccb with a service_id == 0, which in turn
calls BTM_SecClrService with an ID of 0.

From the documentation for BTM_SecClrService:

  Service ID - Id of the service to remove. '0' removes all
               service records (except SDP).

Bug: 6569576965223508
Test: BLE connection and characteristic read
Change-Id: Icf309807f02e1faa273cf9bad9c09d9221a8bbfd
Merged-In: Icf309807f02e1faa273cf9bad9c09d9221a8bbfd
(cherry picked from commit 5c5c10683e2a11162838297fc8054b15837c4f32)
(cherry picked from commit 4023c6731d5e991c6202d4e499b9dd43d642fb3c)

6 years agoDon't reject notifications and wait until new addressed player is ready (2/2)
Ajay Panicker [Wed, 30 Aug 2017 01:30:43 +0000 (18:30 -0700)]
Don't reject notifications and wait until new addressed player is ready (2/2)

There are some carkits like the ones found in the 2016 Honda CRZ and some
Audi's that do not follow the spec and do not honor reject pending notification
messages after switching players. This causes an issue whenever you switch
players, the metadata freezes due to the fact that the carkit never re-registers
for new track changed notifications. This patch removes the reject notification
and reorders the current notifications.

Bug: 64142363
Test: Test with Audi S7 and 2016 Honda CRZ and see that switching players works
      TestTracker: 105391/3975
Change-Id: Iaec70863594e13217916ab740d529f526d27c2d1
Merged-In: Iaec70863594e13217916ab740d529f526d27c2d1
(cherry picked from commit dd535e70c767fe214c1634b46618d0fb5ed4385d)

6 years agoGAP: Set service_id before calling gap_release_ccb
Myles Watson [Thu, 14 Sep 2017 21:13:44 +0000 (14:13 -0700)]
GAP: Set service_id before calling gap_release_ccb

Calling gap_release_ccb with a service_id == 0, which in turn
calls BTM_SecClrService with an ID of 0.

From the documentation for BTM_SecClrService:

  Service ID - Id of the service to remove. '0' removes all
               service records (except SDP).

Bug: 6569576965223508
Test: BLE connection and characteristic read
Change-Id: Icf309807f02e1faa273cf9bad9c09d9221a8bbfd
(cherry picked from commit 5c5c10683e2a11162838297fc8054b15837c4f32)

6 years agoEnsure that services are cleaned from the GattServer HandleMap. am: eb215402e3
Jeremy Klein [Thu, 14 Sep 2017 23:43:55 +0000 (23:43 +0000)]
Ensure that services are cleaned from the GattServer HandleMap. am: eb215402e3
am: 04dd67f8e2

Change-Id: I12d8826369233a50bfeca51d2ae8aa8732ab35ed

6 years agoEnsure that services are cleaned from the GattServer HandleMap.
Jeremy Klein [Thu, 14 Sep 2017 23:38:53 +0000 (23:38 +0000)]
Ensure that services are cleaned from the GattServer HandleMap.
am: eb215402e3

Change-Id: Ic509b64189fccf8c48afaf947d625a8998b389af

6 years agoEnsure that services are cleaned from the GattServer HandleMap.
Jeremy Klein [Fri, 8 Sep 2017 21:04:39 +0000 (14:04 -0700)]
Ensure that services are cleaned from the GattServer HandleMap.

The incorrect service handle was being plumbed up to onServiceDeleted.
This was causing stale entries to stick around forever in the HandleMap,
which could later cause failures to find callback references in
ContextMap if the connection ID changed for a given device.

Bug: 65463237
Test: unit tests modified and run
Change-Id: I2e22858b447f4e6b5a4fbceee4c406191c84a67d
(cherry picked from commit e631789075f5625fd79c774678f4af0bf102c7d1)

6 years agoMerge "Add Suspend/Resume for advertising" into oc-mr1-dev
TreeHugger Robot [Wed, 13 Sep 2017 21:49:20 +0000 (21:49 +0000)]
Merge "Add Suspend/Resume for advertising" into oc-mr1-dev

6 years agoMerge changes from topics "bt-asan-tBTA_AV-copy-crash", "bt-bta-av-role-res-error...
TreeHugger Robot [Wed, 13 Sep 2017 19:30:30 +0000 (19:30 +0000)]
Merge changes from topics "bt-asan-tBTA_AV-copy-crash", "bt-bta-av-role-res-error" into oc-mr1-dev

* changes:
  Fix ASAN crash inside btif_av_event_deep_copy()
  Return the correct status when BTA_AV Open failed because of role switch

6 years agoAdd Suspend/Resume for advertising
Jakub Pawlowski [Mon, 28 Aug 2017 16:56:13 +0000 (09:56 -0700)]
Add Suspend/Resume for advertising

This is needed for resolving list handling.

Bug: 64846264
Test: updated unit tests
Change-Id: I3d9c7b90d3b69d459d33c4ca7a9849ca3a7abc40

6 years agoMerge "Fix crash during derigister GATT server" into oc-mr1-dev
TreeHugger Robot [Wed, 13 Sep 2017 17:47:47 +0000 (17:47 +0000)]
Merge "Fix crash during derigister GATT server" into oc-mr1-dev

6 years agoFix crash during derigister GATT server
Chao Quan [Mon, 24 Jul 2017 11:46:53 +0000 (19:46 +0800)]
Fix crash during derigister GATT server

When deregister a gatt server, GATT_deregister
will use a loop to stop service one by one and
call std::list::erase in GATTS_StopService to
remove service info. But erase makes iterator lose
efficacy. If the iterator is operated after that,
Bluetooth will crash.

Add the iterator before erase.

Test: manual
Bug: 65632336
Change-Id: I10f9351a95ab4922553d8a77663a0212407607aa
Merged-In: I10f9351a95ab4922553d8a77663a0212407607aa
(cherry picked from commit a5aca8f6de825252b5bb72f5d1d8ff7dd1b5247a)

6 years agoFix ASAN crash inside btif_av_event_deep_copy()
Pavlin Radoslavov [Tue, 12 Sep 2017 19:08:49 +0000 (12:08 -0700)]
Fix ASAN crash inside btif_av_event_deep_copy()

Allocate sufficient data on the stack that can be safely copied inside
btif_av_event_deep_copy()

Bug: 65524264
Test: Run Bluetooth on ASAN enabled build
Change-Id: Ie6d4a28933302131c58eb4aee34161e435634377
(cherry picked from commit 6d07e45b9ad1ae32ffe70a0bcc7736719ba973e5)

6 years agoReturn the correct status when BTA_AV Open failed because of role switch
Pavlin Radoslavov [Tue, 12 Sep 2017 18:51:21 +0000 (11:51 -0700)]
Return the correct status when BTA_AV Open failed because of role switch

Bug: 65588660
Test: Code compilation
Change-Id: I705ec28c76f2342e18bece193005c962b9febac8
(cherry picked from commit 54bdc23b0452c356204379a2ce30c78fbf213461)

6 years agobtm: Clear LINK_KEY_KNOWN flag for temporary connections
Myles Watson [Tue, 12 Sep 2017 15:23:23 +0000 (08:23 -0700)]
btm: Clear LINK_KEY_KNOWN flag for temporary connections

Bug: 62561154
Test: Smart Setup, erase target, Smart Setup
Change-Id: Icba672a38772dc99a74f351301c81d66f37ee929

6 years agoFix alarms being posted on wrong thread
Jakub Pawlowski [Fri, 8 Sep 2017 18:26:25 +0000 (11:26 -0700)]
Fix alarms being posted on wrong thread

Alarms from btu_bta_alarm_queue and btu_generic_alarm_queue should be
processed on the main MessageLoop thread.
Replaced obsoleted alarm_set_on_queue() alarm API with the new
alarm_set_on_mloop() API

Test: manual
Bug: 65078753
Change-Id: I54b472b39b44a6c541dbdcdad7414056d0dd4163
Merged-In: I54b472b39b44a6c541dbdcdad7414056d0dd4163
(cherry picked from commit be8bbd7a83ec8bc900fac58a03010fbcb74956c9)

6 years agoEnsure that services are cleaned from the GattServer HandleMap.
Jeremy Klein [Fri, 8 Sep 2017 21:04:39 +0000 (14:04 -0700)]
Ensure that services are cleaned from the GattServer HandleMap.

The incorrect service handle was being plumbed up to onServiceDeleted.
This was causing stale entries to stick around forever in the HandleMap,
which could later cause failures to find callback references in
ContextMap if the connection ID changed for a given device.

Bug: 65463237
Test: unit tests modified and run
Change-Id: I2e22858b447f4e6b5a4fbceee4c406191c84a67d

6 years agoRead the Tx Power level when flushing the A2DP Tx queue
Pavlin Radoslavov [Fri, 1 Sep 2017 23:40:59 +0000 (16:40 -0700)]
Read the Tx Power level when flushing the A2DP Tx queue

Also, minor renaming and cleanup (for consistency).

Test: Streaming A2DP headset and trigger audio stutter
Bug: 64038257
Change-Id: Id722342b596e0bf3c9c7664272b6d3e311bb82e9
(cherry picked from commit c7bf47cefc5446e99ff12b6cae45a0984e0b9999)

6 years agoImplement HCI_Read_Automatic_Flush_Timeout mechanism
Pavlin Radoslavov [Fri, 1 Sep 2017 23:09:27 +0000 (16:09 -0700)]
Implement HCI_Read_Automatic_Flush_Timeout mechanism

Also, read the Automatic Flush Timeout when flushing the A2DP Tx queue

Test: Streaming A2DP headset and trigger audio stutter
Bug: 64038257
Change-Id: Ic49b5236328ddacde1d7f2aee131e35e317a14ef
(cherry picked from commit b8568ae0e198a84225c9fdef1e715dc4d45565c9)

6 years agoFix GATT log spam
Jakub Pawlowski [Wed, 6 Sep 2017 15:41:46 +0000 (08:41 -0700)]
Fix GATT log spam

Bug: 65255942
Test: manual
Change-Id: I212bc93149dc514517f409edc36f74e1c2895d96

6 years agoChange our AVRCP capabilities if the remote device only supports 1.3
Ajay Panicker [Wed, 6 Sep 2017 16:59:51 +0000 (09:59 -0700)]
Change our AVRCP capabilities if the remote device only supports 1.3

This prevents issues with devices that only support 1.3 but can not
handle forward compatability like some Alpine Carkits.

Bug: 37943083
Test: Connect to Alpine carkit that only supports 1.3 and see new features
      are used.

Change-Id: I6d041590dc51d7e8711b17fb1cb9c880b640052a

6 years agoMerge "Implement HCI_Read_Failed_Contact_Counter mechanism" into oc-mr1-dev
TreeHugger Robot [Sat, 2 Sep 2017 02:46:29 +0000 (02:46 +0000)]
Merge "Implement HCI_Read_Failed_Contact_Counter mechanism" into oc-mr1-dev

6 years agoMerge "Bluetooth: Add AVRCP 1.3 as a developer option for AVRCP version (2/2)" into...
TreeHugger Robot [Sat, 2 Sep 2017 00:32:33 +0000 (00:32 +0000)]
Merge "Bluetooth: Add AVRCP 1.3 as a developer option for AVRCP version (2/2)" into oc-mr1-dev

6 years agoBluetooth: Add AVRCP 1.3 as a developer option for AVRCP version (2/2)
Ajay Panicker [Fri, 1 Sep 2017 19:07:42 +0000 (12:07 -0700)]
Bluetooth: Add AVRCP 1.3 as a developer option for AVRCP version (2/2)

This is requied for the 2012 Mazda 3 carkit as the carkit refuses to send
AVRCP commands other than passthrough commands when the version is anything
else. AVRCP 1.3 is compatible with most carkits on the market and can be
used to get most carkits working at the cost of losing many features.

Bug: 37943083
Test: Set AVRCP 1.3 in developer options and see that SDP and the AVRCP
      capabilites have updated to reflect this.
      TestTracker: 105915/3975

Change-Id: Iffc7ed1dd91eecb699153125b25451de5826f202

6 years agoImplement HCI_Read_Failed_Contact_Counter mechanism
Pavlin Radoslavov [Fri, 1 Sep 2017 05:06:11 +0000 (22:06 -0700)]
Implement HCI_Read_Failed_Contact_Counter mechanism

Also, read the Failed Contact Counter when flushing the A2DP Tx queue

Test: Streaming A2DP headset and trigger audio stutter
Bug: 64038257
Change-Id: I8ff72560e3840c5c22cfac9613c4be670b8a4cf1
(cherry picked from commit 6ab749f3cfd9c7660bb245764fcd01dcff51dbe9)

6 years agoMerge "BTIF: Add meaningful logging to btif_profile_queue" into oc-mr1-dev
TreeHugger Robot [Fri, 1 Sep 2017 18:13:27 +0000 (18:13 +0000)]
Merge "BTIF: Add meaningful logging to btif_profile_queue" into oc-mr1-dev

6 years agoMerge "RFCOMM: Add more logging during port close" into oc-mr1-dev
TreeHugger Robot [Fri, 1 Sep 2017 18:10:20 +0000 (18:10 +0000)]
Merge "RFCOMM: Add more logging during port close" into oc-mr1-dev

6 years agoBTIF: Add meaningful logging to btif_profile_queue
Jack He [Wed, 30 Aug 2017 18:13:08 +0000 (11:13 -0700)]
BTIF: Add meaningful logging to btif_profile_queue

* Add INFO logging to add/advance/execute functions in
  btif_profile_queue
* Add ERROR logging to add failures

Bug: 65051171
Test: Try connection to multiple profiles
Change-Id: I058ad06a45eeceb4d160af472f317d08843ca6bf
(cherry picked from commit f42cf2b48f4c73fa2e6e6511b20d98a9ab665a7e)

6 years agoMerge "Don't reject notifications and wait until new addressed player is ready (2...
Ajay Panicker [Fri, 1 Sep 2017 16:15:13 +0000 (16:15 +0000)]
Merge "Don't reject notifications and wait until new addressed player is ready (2/2)" into oc-mr1-dev

6 years agoDon't reject notifications and wait until new addressed player is ready (2/2)
Ajay Panicker [Wed, 30 Aug 2017 01:30:43 +0000 (18:30 -0700)]
Don't reject notifications and wait until new addressed player is ready (2/2)

There are some carkits like the ones found in the 2016 Honda CRZ and some
Audi's that do not follow the spec and do not honor reject pending notification
messages after switching players. This causes an issue whenever you switch
players, the metadata freezes due to the fact that the carkit never re-registers
for new track changed notifications. This patch removes the reject notification
and reorders the current notifications.

Bug: 64142363
Test: Test with Audi S7 and 2016 Honda CRZ and see that switching players works
      TestTracker: 105391/3975
Change-Id: Iaec70863594e13217916ab740d529f526d27c2d1

6 years agoRFCOMM: Add more logging during port close
Jack He [Wed, 30 Aug 2017 19:00:41 +0000 (12:00 -0700)]
RFCOMM: Add more logging during port close

* Log MAC address and UUIDs of closed connections
* Log reasons for RFCOMM closure when generic CLOSE is used
  as reason

Bug: 65080465
Test: Use profiles that use RFCOMM
Change-Id: Iff9f7537989e51d7b98f7cf1241db3f196f501d7
(cherry picked from commit 074867d4c7c966758eddbe30294c4a9b6459c8dd)

6 years agoMerge "Limit the maximum number of entries in the remote bdaddr cache to 1024" into...
TreeHugger Robot [Thu, 31 Aug 2017 21:16:24 +0000 (21:16 +0000)]
Merge "Limit the maximum number of entries in the remote bdaddr cache to 1024" into oc-mr1-dev

6 years agoMerge "Add / update log messages during stack startup / shutdown" into oc-mr1-dev
TreeHugger Robot [Thu, 31 Aug 2017 21:12:29 +0000 (21:12 +0000)]
Merge "Add / update log messages during stack startup / shutdown" into oc-mr1-dev

6 years agoAdd / update log messages during stack startup / shutdown
Pavlin Radoslavov [Tue, 29 Aug 2017 17:00:21 +0000 (10:00 -0700)]
Add / update log messages during stack startup / shutdown

Test: manual
Bug: 64975965
Change-Id: I22ae7cad3b0ef3b7eb7ea2b7b6f93449a6363070
(cherry picked from commit 303ff4cee3830fa9c1f9f8f30ca1b7a9dd95fe0d)

6 years agoLimit the maximum number of entries in the remote bdaddr cache to 1024
Pavlin Radoslavov [Tue, 29 Aug 2017 00:42:46 +0000 (17:42 -0700)]
Limit the maximum number of entries in the remote bdaddr cache to 1024

Also, renamed p_dev_cb to remote_bdaddr_cache.

Bug: 64975965
Test: BLE scanning
Change-Id: I518390c53c5ff2a24ac9f010464225d763b33228
(cherry picked from commit a375c31ae34dd49c48f12a15d4af003a864bd979)

6 years agoInline comparison operators for RawAddress
Pavlin Radoslavov [Wed, 30 Aug 2017 18:02:27 +0000 (11:02 -0700)]
Inline comparison operators for RawAddress

Test: Code compilation
Bug: 64975965

Change-Id: I5a7ab7e0cd270c2769a3a471a506fc78a0a94533
(cherry picked from commit c705670fbec2d404a92261efa0234c614232ec4f)

6 years agoAdd missing comparison operators for RawAddress
Pavlin Radoslavov [Tue, 29 Aug 2017 22:02:44 +0000 (15:02 -0700)]
Add missing comparison operators for RawAddress

Test: Unit tests added
Bug: 64975965
Change-Id: Id27f1ef7ec99f0761d6e2fb40bf38212ab8312a1
(cherry picked from commit b3e7d947a1add4ecbdd90ca850614641e7224075)

6 years agoFix crashes in btm_consolidate_dev
Jakub Pawlowski [Tue, 22 Aug 2017 10:10:46 +0000 (03:10 -0700)]
Fix crashes in btm_consolidate_dev

It is not safe to do list_next after list_remove.

Test: sl4a BleStressTest:test_le_pairing
Bug: 31442085
Change-Id: Ib4cb02154684b39ebc652d20559e1b07eee2c357
Merged-In: Ib4cb02154684b39ebc652d20559e1b07eee2c357
(cherry picked from commit bd8ed367d3522037c0c09e425fc85baf5b66a411)

6 years agoFix connection handle data type
Jakub Pawlowski [Fri, 18 Aug 2017 11:14:22 +0000 (04:14 -0700)]
Fix connection handle data type

conn_handle should be uint16_t, not uint8_t.

Test: compilation test
Bug: 64232952
Change-Id: Ibce88e2cf2f74f402ea26f7471e5ac35aef6229b
Merged-In: Ibce88e2cf2f74f402ea26f7471e5ac35aef6229b

6 years agoCleanup RawAddress usage
Jakub Pawlowski [Wed, 16 Aug 2017 13:41:02 +0000 (06:41 -0700)]
Cleanup RawAddress usage

Use RawAddress::kLength instead of sizeof(RawAddress). When copying
value using memcpy, use "->address" instead of direct instance address.

Bug: 64726342
Change-Id: Iac7e5674f7e32b53162ab734c2251e65e9d4554c
Merged-In: Iac7e5674f7e32b53162ab734c2251e65e9d4554c
(cherry picked from commit 2e05f0dd4f3b33a0fdeb9a1c72a53cf14851e734)

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41...
Andre Eisenbach [Thu, 17 Aug 2017 01:02:43 +0000 (01:02 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41 am: 8498351370 am: 615de1d1fe  -s ours am: 1ee8850324  -s ours am: 27e67ba277  -s ours am: 5af8ec6e85  -s ours am: bc2ddd916c  -s ours am: ad12cf8070  -s ours am: eb80110ae4  -s ours
am: 672f067faf  -s ours

Change-Id: I81142402eb0fa0ca40fde6b9f50e3c827dba8f2e

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41...
Andre Eisenbach [Thu, 17 Aug 2017 00:53:40 +0000 (00:53 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41 am: 8498351370 am: 615de1d1fe  -s ours am: 1ee8850324  -s ours am: 27e67ba277  -s ours am: 5af8ec6e85  -s ours am: bc2ddd916c  -s ours am: ad12cf8070  -s ours
am: eb80110ae4  -s ours

Change-Id: Ie41f709b2f47fcf629022c561b3c712ae90ac572

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41...
Andre Eisenbach [Thu, 17 Aug 2017 00:51:13 +0000 (00:51 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41 am: 8498351370 am: 615de1d1fe  -s ours am: 1ee8850324  -s ours am: 27e67ba277  -s ours am: 5af8ec6e85  -s ours am: bc2ddd916c  -s ours
am: ad12cf8070  -s ours

Change-Id: I98a440d9bfa53e413c531b2afa510b52c02104cc

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41...
Andre Eisenbach [Thu, 17 Aug 2017 00:49:09 +0000 (00:49 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41 am: 8498351370 am: 615de1d1fe  -s ours am: 1ee8850324  -s ours am: 27e67ba277  -s ours am: 5af8ec6e85  -s ours
am: bc2ddd916c  -s ours

Change-Id: Iad7cf407257de1788102f83e7ceafaf9167655c9

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41...
Andre Eisenbach [Thu, 17 Aug 2017 00:46:40 +0000 (00:46 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41 am: 8498351370 am: 615de1d1fe  -s ours am: 1ee8850324  -s ours am: 27e67ba277  -s ours
am: 5af8ec6e85  -s ours

Change-Id: I8971c22e6641d46e2d1fba13fe55407e3386acb2

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41...
Andre Eisenbach [Thu, 17 Aug 2017 00:45:10 +0000 (00:45 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41 am: 8498351370 am: 615de1d1fe  -s ours am: 1ee8850324  -s ours
am: 27e67ba277  -s ours

Change-Id: I5fb42670d4a641b39a14e538057a0193d33afb0e

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41...
Andre Eisenbach [Thu, 17 Aug 2017 00:42:45 +0000 (00:42 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41 am: 8498351370 am: 615de1d1fe  -s ours
am: 1ee8850324  -s ours

Change-Id: I5f54fca3ea0d17cad9a5e5439265c9b40340036c

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c...
Andre Eisenbach [Thu, 17 Aug 2017 00:40:10 +0000 (00:40 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c am: 33aee8d11e am: d772aec66b am: c8d256c052  -s ours am: 7fe92a7abf  -s ours
am: 65fc86d417  -s ours

Change-Id: I9b9ce9b2e16443a9a3261a7d918ad027c9caaf02

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41...
Andre Eisenbach [Thu, 17 Aug 2017 00:39:39 +0000 (00:39 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41 am: 8498351370
am: 615de1d1fe  -s ours

Change-Id: I2e6425620ccf65636ba0b0ba6c783c8bf8764ec0

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41
Andre Eisenbach [Thu, 17 Aug 2017 00:37:42 +0000 (00:37 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f am: 5dc24c7b41
am: 8498351370

Change-Id: I171cafa603f3bf9d6a91895aba461fa96711c18c

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f
Andre Eisenbach [Thu, 17 Aug 2017 00:32:37 +0000 (00:32 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 294cc61f4f
am: 5dc24c7b41

Change-Id: I27dffd6583706912f79cfd730eca390e930e9294

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot()
Andre Eisenbach [Thu, 17 Aug 2017 00:30:38 +0000 (00:30 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot()
am: 294cc61f4f

Change-Id: Ief8d911221408ff79a5addc7a7d58c7ca1a38808

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c...
Andre Eisenbach [Thu, 17 Aug 2017 00:28:39 +0000 (00:28 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c am: 33aee8d11e am: d772aec66b am: c8d256c052  -s ours
am: 7fe92a7abf  -s ours

Change-Id: Ie383a65f8f6b2593f4c4bf32cea0179521e351b3

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c...
Andre Eisenbach [Thu, 17 Aug 2017 00:03:55 +0000 (00:03 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c am: 33aee8d11e am: d772aec66b
am: c8d256c052  -s ours

Change-Id: I0c563fdf2b28e8b50abab9f6d9a1b1851a13a2ab

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c...
Andre Eisenbach [Wed, 16 Aug 2017 23:45:18 +0000 (23:45 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c am: 33aee8d11e
am: d772aec66b

Change-Id: I41ed5d1d9f8efa504941b7084aa955496dfe0ec3

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c
Andre Eisenbach [Wed, 16 Aug 2017 23:27:46 +0000 (23:27 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa am: 3b90fd7b0c
am: 33aee8d11e

Change-Id: Ie3991cdfd834d3d0ff736562af300251fd70f96c

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa
Andre Eisenbach [Wed, 16 Aug 2017 23:07:45 +0000 (23:07 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: 82e4754aaa
am: 3b90fd7b0c

Change-Id: I2e9769b83ab39cfc51320b1116959780dd5d92da

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot()
Andre Eisenbach [Wed, 16 Aug 2017 22:52:42 +0000 (22:52 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot()
am: 82e4754aaa

Change-Id: Ica0050f493b45e216daa4c31e6eea38a4921d356

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot() am: b413f1b136
Andre Eisenbach [Wed, 16 Aug 2017 17:37:42 +0000 (17:37 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot() am: b413f1b136
am: a708395ce2

Change-Id: I6939a5c1ad822a09177705032a7ba9ef4da3e4d0

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot()
Andre Eisenbach [Wed, 16 Aug 2017 17:25:11 +0000 (17:25 +0000)]
SDP: Bounds check 'id' parameter for free_sdp_slot()
am: b413f1b136

Change-Id: I2a51738b15ab49d419a95a1f14abf87aa2542af1

6 years agoFix errors in handling RawAddresses
Jack He [Tue, 15 Aug 2017 06:02:16 +0000 (23:02 -0700)]
Fix errors in handling RawAddresses

* In change I8d1bd6914aec55bb53495b1d0d5e3d37b86865e6
  memcmp(a, b, LEN) != 0 should be translated to
  A != B
* memcpy should not be applied to RawAddress objects.
  Assignment operator should be used instead.
* memset should not be applied to RawAddress objects.
  Assignment to RawAddress::kEmpty should be used.
* Fixed a crash in GATT

Bug: 64316340
Test: Unit test, pair with device and transmit
Change-Id: Iceefab821c1d45a88194d87a43a192afa5f263fd
(cherry picked from commit 882aec320e88b0860a3d53db828bb099c7ca2409)

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot()
Andre Eisenbach [Tue, 8 Aug 2017 23:51:12 +0000 (16:51 -0700)]
SDP: Bounds check 'id' parameter for free_sdp_slot()

Merged-In: I34e8296ec7ec6b4ffbe1fa0452754f2a421e6ec7

Test: manual
Fixes: 37502513
Change-Id: I34e8296ec7ec6b4ffbe1fa0452754f2a421e6ec7
(cherry picked from commit b413f1b1365af4273647727e497848f95312d0ec)

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot()
Andre Eisenbach [Tue, 8 Aug 2017 22:41:21 +0000 (15:41 -0700)]
SDP: Bounds check 'id' parameter for free_sdp_slot()

Merged-In: I34e8296ec7ec6b4ffbe1fa0452754f2a421e6ec7

Test: manual
Fixes: 37502513
Change-Id: I34e8296ec7ec6b4ffbe1fa0452754f2a421e6ec7
(cherry picked from commit b413f1b1365af4273647727e497848f95312d0ec)

6 years agoSDP: Bounds check 'id' parameter for free_sdp_slot()
Andre Eisenbach [Tue, 8 Aug 2017 22:41:21 +0000 (15:41 -0700)]
SDP: Bounds check 'id' parameter for free_sdp_slot()

Test: manual
Fixes: 37502513
Change-Id: I34e8296ec7ec6b4ffbe1fa0452754f2a421e6ec7

6 years agoAdvertisement parsing fix for zero padding
Jakub Pawlowski [Mon, 7 Aug 2017 21:33:32 +0000 (21:33 +0000)]
Advertisement parsing fix for zero padding
am: 436058ee3f

Change-Id: I4c5a04c769d3f0366fed96881edb46cc9979cd6a

6 years agoAdvertisement parsing fix for zero padding
Jakub Pawlowski [Fri, 4 Aug 2017 15:56:53 +0000 (08:56 -0700)]
Advertisement parsing fix for zero padding

When AD data is zero padded, and Scan Response is appended at end, data
becomes invalid. Instead, zero paddning must be removed first.

Test: AdvertiseDataParserTest.RemoveTrailingZeros
Bug: 38489707
Change-Id: I229ca3db6c92bc06bc1429e72412417010721063
Merged-In: I229ca3db6c92bc06bc1429e72412417010721063
(cherry picked from commit 35a9ea352d59e6d261eba1254814f7238e3ed022)

6 years agoUse a mutex to protect the scheduling of tBTA_PM_TIMER
Pavlin Radoslavov [Mon, 7 Aug 2017 18:18:19 +0000 (18:18 +0000)]
Use a mutex to protect the scheduling of tBTA_PM_TIMER
am: a8ba0bd7c8

Change-Id: I805c9e2156a3616e7be2bf17e34e2c353f5a0469

6 years agoUse a mutex to protect the scheduling of tBTA_PM_TIMER
Pavlin Radoslavov [Sun, 6 Aug 2017 06:47:50 +0000 (23:47 -0700)]
Use a mutex to protect the scheduling of tBTA_PM_TIMER

Bug: 63689331
Test: Code compilation
Change-Id: If062f7b3e2c17cb5a1ac2c8ef0813a2fe5c5a5f5
(cherry picked from commit a34d33ff2a3fe3562c1e003d870a0716f83568bf)

6 years agoProtect the btif config state with a lock during cleanup
Pavlin Radoslavov [Fri, 4 Aug 2017 22:14:30 +0000 (22:14 +0000)]
Protect the btif config state with a lock during cleanup
am: ecadb0d01d

Change-Id: I279e7a496ec3742b19073a0610953c4a68cd37d1

6 years agoProtect the btif config state with a lock during cleanup
Pavlin Radoslavov [Fri, 4 Aug 2017 18:26:21 +0000 (11:26 -0700)]
Protect the btif config state with a lock during cleanup

Bug: 64186300
Test: Code compilation, enable/disable Bluetooth
Change-Id: Ic2397a128d59c9cc69cbd8252734b69eb7c02501
(cherry picked from commit a4febd6d0460ee0f5834822ca406a4b8bab28cf1)

6 years agoMerge "Added another entry to the INTEROP_2MBPS_LINK_ONLY interoperability database...
Pavlin Radoslavov [Fri, 4 Aug 2017 04:01:20 +0000 (04:01 +0000)]
Merge "Added another entry to the INTEROP_2MBPS_LINK_ONLY interoperability database" into oc-dr1-dev
am: 1dc69f4180

Change-Id: I17f6180ebfb596d74ec6c76b6ec3573c37a9ffdc

6 years agoMerge "Added another entry to the INTEROP_2MBPS_LINK_ONLY interoperability database...
Pavlin Radoslavov [Fri, 4 Aug 2017 03:50:45 +0000 (03:50 +0000)]
Merge "Added another entry to the INTEROP_2MBPS_LINK_ONLY interoperability database" into oc-dr1-dev

6 years agoAdded another entry to the INTEROP_2MBPS_LINK_ONLY interoperability database
Pavlin Radoslavov [Fri, 4 Aug 2017 00:34:07 +0000 (17:34 -0700)]
Added another entry to the INTEROP_2MBPS_LINK_ONLY interoperability database

Bug: 64357126
Test: Audio streaming to the affected carkit
Change-Id: I160eb3775c77fe400798f038d2aae7dd7825aacb

6 years agoMerge "Revert "Allow collection of Bluetooth firmware dumps in bugreports (3/3)"...
Pankaj Kanwar [Fri, 4 Aug 2017 00:00:43 +0000 (00:00 +0000)]
Merge "Revert "Allow collection of Bluetooth firmware dumps in bugreports (3/3)"" into oc-dr1-dev
am: 233a2b47b2

Change-Id: Iad6f3b180335b51fb24935aaa87243fc597f64ed

6 years agoMerge "Revert "Allow collection of Bluetooth firmware dumps in bugreports (3/3)"...
Pankaj Kanwar [Thu, 3 Aug 2017 23:52:09 +0000 (23:52 +0000)]
Merge "Revert "Allow collection of Bluetooth firmware dumps in bugreports (3/3)"" into oc-dr1-dev

6 years agoMerge "AVRCP Controller request metadata on playback." into oc-mr1-dev
Joseph Pirozzo [Thu, 3 Aug 2017 23:46:53 +0000 (23:46 +0000)]
Merge "AVRCP Controller request metadata on playback." into oc-mr1-dev

6 years agoRevert "Allow collection of Bluetooth firmware dumps in bugreports (3/3)"
Pankaj Kanwar [Thu, 3 Aug 2017 20:41:44 +0000 (20:41 +0000)]
Revert "Allow collection of Bluetooth firmware dumps in bugreports (3/3)"

This reverts commit 0580dd639cb10fafb6953d8a724db030df5030db.

Change-Id: I37f9ba5a9ace655d1d12404926a158fb9a4001a7

6 years agoWorkaround for Traxxas
Jakub Pawlowski [Tue, 1 Aug 2017 22:12:04 +0000 (15:12 -0700)]
Workaround for Traxxas

Bug: 64252588
Test: net_test_stack_ad_parser
Change-Id: I1471e9e5f0f36ec931f8d86c927abbc1137e2b94
Merged-In: I1471e9e5f0f36ec931f8d86c927abbc1137e2b94

6 years agoAVRCP Controller request metadata on playback.
Joseph Pirozzo [Tue, 1 Aug 2017 21:58:03 +0000 (14:58 -0700)]
AVRCP Controller request metadata on playback.

Track metadata is only provided when requested, and the current
implementation only requested it when there was a track change
notification.  Add a request for metadata whenever there is an
update to indicate that the play status is playing.

Bug: 63998350
Test: Start playing media, make a phone call, end a phonecall observe
metadata is correct.

Change-Id: Iea5cdacfe95c1a98cdaf73836ee6359a923f481b
Merged-In: Iae6969ff230d91335b6af41955f07f1151d79de2
(cherry picked from commit 7e08d96dc3b58e4d796c901b92d35185da005548)

6 years agoDon't reuse AVDTP internal state for different purposes
Pavlin Radoslavov [Thu, 3 Aug 2017 03:17:38 +0000 (03:17 +0000)]
Don't reuse AVDTP internal state for different purposes
am: c64dc1d284

Change-Id: Ia42b343751f2fa48a0b8f601256828d3c15718b2

6 years agoAdd A2DP_DumpCodecInfo() API
Pavlin Radoslavov [Thu, 3 Aug 2017 02:47:37 +0000 (02:47 +0000)]
Add A2DP_DumpCodecInfo() API
am: 81c2234305

Change-Id: I9775e3cf2ca822cb9b8386f8d4a63f65b20b5952