OSDN Git Service

android-x86/system-bt.git
3 years agostopwatch: improve stopwatch problems
weichinweng [Fri, 11 Jun 2021 06:10:54 +0000 (14:10 +0800)]
stopwatch: improve stopwatch problems

* For command timeout case, will print the stopwatch log.
* For startup_timer_expired case, will print the stopwatch log.
* Add record initializationComplete function into stopwatch log.
* For the stopwatch can't correctly dump log if the array is not full
  case, fix it.

bug: 190786398
Test: atest BluetoothInstrumentationTests & Manually
Tag: #stability
Change-Id: I8a66897ca46f593e18e231c43e8873ff0db08288
Merged-In: Ie59dbc0bd2f574761eed7aac695cbff07948d8e2

3 years agoMerge "libunwindstack links libdexfile_support statically now." into sc-dev
TreeHugger Robot [Thu, 17 Jun 2021 08:03:23 +0000 (08:03 +0000)]
Merge "libunwindstack links libdexfile_support statically now." into sc-dev

3 years agoIRK: Set IRK to resolving list
Martin Brabham [Wed, 19 May 2021 04:29:53 +0000 (21:29 -0700)]
IRK: Set IRK to resolving list

Bug: 178234318
Test: Manual
Tag: #feature
Change-Id: Id0843471a009e6ed51874547b570929fd37e4705

3 years agoMerge "A2DP: Restrict MTU while using SBC middle quality" into sc-dev
TreeHugger Robot [Thu, 3 Jun 2021 16:22:09 +0000 (16:22 +0000)]
Merge "A2DP: Restrict MTU while using SBC middle quality" into sc-dev

3 years agoRevert "Always unset def L2CAP_CBB_DEFAULT_DATA_RATE_BUFF_QUOTA"
Chris Manton [Wed, 2 Jun 2021 16:05:27 +0000 (16:05 +0000)]
Revert "Always unset def L2CAP_CBB_DEFAULT_DATA_RATE_BUFF_QUOTA"

This reverts commit 7289f638b11b396b243071ec27f58d54c9f1feae.

Reason for revert: Allow override

Bug:189941410
Test: gd/cert/run
Tag: #refactor
Ignore-AOSP-First: cherry-pick

Change-Id: I86343313bf70057cb776b60fb2b5668045f83332

3 years agoMerge "BluetoothAudioHAL: Wait for A2DP not playing if receiving A2dpSuspended=true...
TreeHugger Robot [Wed, 2 Jun 2021 17:58:30 +0000 (17:58 +0000)]
Merge "BluetoothAudioHAL: Wait for A2DP not playing if receiving A2dpSuspended=true" into sc-dev

3 years agoMerge "Allow for multiple link and accept signalling timers to allow for multiple...
TreeHugger Robot [Wed, 2 Jun 2021 17:56:10 +0000 (17:56 +0000)]
Merge "Allow for multiple link and accept signalling timers to allow for multiple simultaneous incoming A2DP connections" into sc-dev

3 years agoMerge "Ensure we do not send A2DP data to non-active stream devices" into sc-dev
TreeHugger Robot [Wed, 2 Jun 2021 17:55:59 +0000 (17:55 +0000)]
Merge "Ensure we do not send A2DP data to non-active stream devices" into sc-dev

3 years agoAllow for multiple link and accept signalling timers to allow for
Rahul Sabnis [Tue, 11 May 2021 04:32:35 +0000 (21:32 -0700)]
Allow for multiple link and accept signalling timers to allow for
multiple simultaneous incoming A2DP connections

Tag: #feature
Bug: 187236067
Test: Manual
Merged-In: I7df47540ae13c0a33154b2aa65de8b0313d117bc
Change-Id: I7df47540ae13c0a33154b2aa65de8b0313d117bc

3 years agoEnsure we do not send A2DP data to non-active stream devices
Rahul Sabnis [Tue, 18 May 2021 22:16:03 +0000 (15:16 -0700)]
Ensure we do not send A2DP data to non-active stream devices

Tag: #feature
Bug: 187157598
Test: Manual
Merged-In: I4a251f74439e1c74fe6178bafd306c75cd6847e0
Change-Id: I4a251f74439e1c74fe6178bafd306c75cd6847e0

3 years agolibunwindstack links libdexfile_support statically now.
Martin Stjernholm [Fri, 14 May 2021 17:24:31 +0000 (18:24 +0100)]
libunwindstack links libdexfile_support statically now.

Cherry-picked from https://r.android.com/1707629.

Test: Boot
Test: mmm system/bt/gd
Test: gd/cert/run --rhost --clean
  (some errors and hangs eventually, but no difference from before this
  CL: http://go/paste/5965220192190464)
Tag: #refactor
Bug: 143978909
Change-Id: Ib6558a0e9e35bfb4d33cb890d64693d6c80d85df
Merged-In: Ib6558a0e9e35bfb4d33cb890d64693d6c80d85df

3 years agoA2DP: Restrict MTU while using SBC middle quality
Cheney Ni [Thu, 20 May 2021 10:58:48 +0000 (18:58 +0800)]
A2DP: Restrict MTU while using SBC middle quality

When SBC headsets report middle quality bitpool under a larger MTU, we
reduce the packet size to prevent the hardware encoder from putting too
many frames in one packet.

Bug: 188020925
Tag: #compatibility
Test: A2DP playback with SBC manually
Change-Id: I164c0c1fe37d6852718889e2946207471b26e5bd
Merged-In: I164c0c1fe37d6852718889e2946207471b26e5bd
(cherry picked from commit 805ca9ca336db6ac6df1ba74dbc74cb7868bf4d6)

3 years agoMerge "gd: Start vendor specific event manager when hci enable" into sc-dev
TreeHugger Robot [Tue, 25 May 2021 22:16:51 +0000 (22:16 +0000)]
Merge "gd: Start vendor specific event manager when hci enable" into sc-dev

3 years agogd: Start vendor specific event manager when hci enable
Chienyuan [Mon, 17 May 2021 08:17:40 +0000 (16:17 +0800)]
gd: Start vendor specific event manager when hci enable

Tag: #gd-refactor
Bug: 188118934
Test: gd/cert/run
Test: bluetooth_test_gd
Ignore-AOSP-First: Patch merged in AOSP
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I24d5e62344376ff63c8d17d58ced41762542c01b
Merged-In: I24d5e62344376ff63c8d17d58ced41762542c01b

3 years agoCall wakelock callouts in JNI thread
Jack He [Fri, 21 May 2021 00:59:45 +0000 (17:59 -0700)]
Call wakelock callouts in JNI thread

Bug: 180790614
Fixes: 180790614
Test: start up Bluetooth
Tag: #refactor
Ignore-AOSP-First: cherry-pick

Change-Id: If1eee9532f20e264ff33a0e2adbf1b06dc3900e6
Merged-In: If1eee9532f20e264ff33a0e2adbf1b06dc3900e6
(cherry picked from commit d773a9d418d2a8ee4fa983ca437efc6f368ac59a)

3 years agoGD: Fix DeviceTest
Jack He [Thu, 20 May 2021 05:41:14 +0000 (22:41 -0700)]
GD: Fix DeviceTest

* Do not assert on crash message

Bug: 188742121
Fixes: 188742121
Test: atest bluetooth_test_gd
Tag: #gd-refactor
Ignore-AOSP-First: Cherry-pick to release branch

Change-Id: I859edea07e083912ca09cc0303551fca35b9c097
(cherry picked from commit 72923eecd892570560c96223c504b5cfdf24fa79)

3 years agoGD: Hold wakelock when starting and stopping the Bluetooth stack
Jack He [Thu, 20 May 2021 05:14:19 +0000 (22:14 -0700)]
GD: Hold wakelock when starting and stopping the Bluetooth stack

* Hold wakelock when starting and stopping the Bluetooth stack so that it
  can meet the timing requirement
* Rename GD wakelock to bluetooth_gd_timer for easier debugging
* Use native HAL based wakelock in GD

Bug: 184608842
Tag: #gd-refactor
Test: atest bluetooth_test_gd_unit
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines
Ignore-AOSP-First: Cherry-pick to release branch

Change-Id: Ib4679782061b82a70a240a2a614f7ee587e5c7c7
(cherry picked from commit 3ea82dbbb74beeb94a2ae15c6d9d1748a14c43ae)

3 years agoGD: Implement Wakelock Manager and Native Wakelock
Jack He [Wed, 19 May 2021 07:56:56 +0000 (00:56 -0700)]
GD: Implement Wakelock Manager and Native Wakelock

* Implement Wakelock Manager to support both OS callout-based wakelocks
  and Android native wakelocks
* Use ISystemSuspend for Android native wakelocks
* Allow runtime override of wakelock callout to bypass the native
  implementation
* Implement unit test for both native and OS callout wakelocks

Bug: 184608842
Bug: 188614066
Tag: #gd-refactor
Test: atest bluetooth_test_gd_unit
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines
Ignore-AOSP-First: Cherry-pick to release branch

Change-Id: I428e06e6a48a423bb6912e3449895e030e0dd073
(cherry picked from commit 0c31c590f50c37cfab45d629ddac91a51cdc523c)

3 years agoMerge "AOSP: Correct device type for dual mode peers" into sc-dev
TreeHugger Robot [Thu, 20 May 2021 15:24:31 +0000 (15:24 +0000)]
Merge "AOSP: Correct device type for dual mode peers" into sc-dev

3 years agoAOSP: Correct device type for dual mode peers
Animesh Fatehpuria [Fri, 5 Mar 2021 11:32:10 +0000 (19:32 +0800)]
AOSP: Correct device type for dual mode peers

Currently, device type determination logic is fuzzy in the stack.
Dual mode devices are incorrectly classified as BR/EDR. We should
reference the remote capabilities and set the peer device type to
DUAL if BR/EDR and BLE transports are both supported.

Bug: 186097823
Tag: #stability
Test: cert/run, manual device type testing (with and without gd)
Merged-In: Ibe4e02eea2a715be01457f8e48abfb846f25c81a

Change-Id: Ibe4e02eea2a715be01457f8e48abfb846f25c81a

3 years agoBluetoothAudioHAL: Wait for A2DP not playing if receiving A2dpSuspended=true
Cheney Ni [Thu, 29 Apr 2021 12:07:07 +0000 (20:07 +0800)]
BluetoothAudioHAL: Wait for A2DP not playing if receiving A2dpSuspended=true

The Upper-layer may useĀ A2dpSuspended=true parameter to inform of
stopping the A2DP playback and dropping streaming data before
establishing the SCO connection, and we have to wait for AVDTP
non-started. This helps prevent a race condition between A2DP and SCO.

Bug: 186613660
Bug: 185191975
Tag: #compatibility
Test: Making a MO / MT call manually while A2DP playing
Change-Id: I17ab9ef97b06928d092ae4bdaa697d97a5732bb0
Merged-In: I17ab9ef97b06928d092ae4bdaa697d97a5732bb0
(cherry picked from commit d93ce78e87d7e09c3410616765106f8a52262a64)

3 years agoMerge "IBluetooth#setRemoteAlias now returns an int to support error codes for failur...
Rahul Sabnis [Wed, 19 May 2021 16:00:11 +0000 (16:00 +0000)]
Merge "IBluetooth#setRemoteAlias now returns an int to support error codes for failure cases" into sc-dev

3 years agoIBluetooth#setRemoteAlias now returns an int to support error codes for
Rahul Sabnis [Wed, 5 May 2021 21:13:36 +0000 (14:13 -0700)]
IBluetooth#setRemoteAlias now returns an int to support error codes for
failure cases

Tag: #feature
Bug: 184714087
Test: atest BluetoothDeviceTest#test_setAlias_getAlias
Ignore-AOSP-First: Depends on CDM changes not available in AOSP
Change-Id: Ife331c56fa6ed950027ef06038b943a5ec8bd447

3 years agogd: Start vendor specific event manager when acl enable am: 3e4a61a5b4 am: 013ee5ebf4...
Chienyuan [Fri, 14 May 2021 20:46:41 +0000 (20:46 +0000)]
gd: Start vendor specific event manager when acl enable am: 3e4a61a5b4 am: 013ee5ebf4 am: 860e1b9201

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1708129

Change-Id: I8254162c61f5ad349c298dde35e3a8b89f7ea4ad

3 years agogd: Start vendor specific event manager when acl enable am: 3e4a61a5b4 am: 013ee5ebf4
Chienyuan [Fri, 14 May 2021 20:26:51 +0000 (20:26 +0000)]
gd: Start vendor specific event manager when acl enable am: 3e4a61a5b4 am: 013ee5ebf4

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1708129

Change-Id: I1f848866b4b283dced81e1c3cb5bc3c4a898bd51

3 years agogd: Start vendor specific event manager when acl enable am: 3e4a61a5b4
Chienyuan [Fri, 14 May 2021 20:06:14 +0000 (20:06 +0000)]
gd: Start vendor specific event manager when acl enable am: 3e4a61a5b4

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1708129

Change-Id: I3163a83938ee35bc8c8364a44bea4716c0e4abd0

3 years ago[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd...
TreeHugger Robot [Fri, 14 May 2021 17:52:34 +0000 (17:52 +0000)]
[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd OOB write" into qt-qpr1-dev am: 454fdc7be9 -s ours am: ebe70e97c9 am: 29bfdb02cf am: 29a4f97794 -s ours

am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/14452688

Change-Id: If8a62b3de3cc883a4e392ca0748c70170462f12f

3 years ago[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd...
TreeHugger Robot [Fri, 14 May 2021 17:51:52 +0000 (17:51 +0000)]
[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd OOB write" into qt-qpr1-dev am: 454fdc7be9 -s ours am: ebe70e97c9 am: e79aa24081 -s ours

am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/14452688

Change-Id: I7b4ad94cac72fba2a82e4ed6a6f862ed9c3b73c9

3 years ago[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd...
TreeHugger Robot [Fri, 14 May 2021 17:27:15 +0000 (17:27 +0000)]
[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd OOB write" into qt-qpr1-dev am: 454fdc7be9 -s ours am: ebe70e97c9 am: 29bfdb02cf

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/14452688

Change-Id: Ie93c3abd997a51e5185168e33a488fd30a708e7a

3 years ago[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd...
TreeHugger Robot [Fri, 14 May 2021 17:19:10 +0000 (17:19 +0000)]
[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd OOB write" into qt-qpr1-dev am: 454fdc7be9 -s ours am: ebe70e97c9

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/14452688

Change-Id: I42e6498e063827819f158e7c30ce8095274b6401

3 years ago[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd...
TreeHugger Robot [Fri, 14 May 2021 17:15:29 +0000 (17:15 +0000)]
[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd OOB write" into qt-qpr1-dev am: 454fdc7be9 -s ours am: ebe70e97c9

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/14452688

Change-Id: Id427688c7da708588ef9d886b121895289ef71b1

3 years agoFix out of bound read in read_reports_cb.
Richard Smith [Mon, 22 Feb 2021 13:44:16 +0000 (13:44 +0000)]
Fix out of bound read in read_reports_cb.

Bug: 180939433
Change-Id: Ibd713c08cb18deb7b56347a842749d9aa85fba32

3 years agogd: Start vendor specific event manager when acl enable
Chienyuan [Fri, 14 May 2021 07:59:06 +0000 (15:59 +0800)]
gd: Start vendor specific event manager when acl enable

Tag: #gd-refactor
Bug: 188118934
Test: gd/cert/run
Test: bluetooth_test_gd
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I6ff766d231fa5258ff10ec8ee62722f0a733eb83

3 years agoMerge "Format time when print stopwatch log." am: 46c41b02e5 am: afea20d8ef am: 0659d...
Treehugger Robot [Fri, 14 May 2021 06:26:57 +0000 (06:26 +0000)]
Merge "Format time when print stopwatch log." am: 46c41b02e5 am: afea20d8ef am: 0659d7c2ac

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1704985

Change-Id: I279f89ca8559b6143ae7897e9b2e25f972a8809d

3 years agoMerge "Format time when print stopwatch log." am: 46c41b02e5 am: afea20d8ef
Treehugger Robot [Fri, 14 May 2021 06:10:37 +0000 (06:10 +0000)]
Merge "Format time when print stopwatch log." am: 46c41b02e5 am: afea20d8ef

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1704985

Change-Id: Ie50672d1f6365f69089ad99587c0dfcb21133648

3 years agoMerge "Format time when print stopwatch log." am: 46c41b02e5
Treehugger Robot [Fri, 14 May 2021 05:55:16 +0000 (05:55 +0000)]
Merge "Format time when print stopwatch log." am: 46c41b02e5

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1704985

Change-Id: I13398f26b1958fd006b24445496f78106150d0be

3 years agoMerge "Format time when print stopwatch log."
Treehugger Robot [Fri, 14 May 2021 05:34:26 +0000 (05:34 +0000)]
Merge "Format time when print stopwatch log."

3 years agoFormat time when print stopwatch log.
weichinweng [Wed, 12 May 2021 05:44:15 +0000 (13:44 +0800)]
Format time when print stopwatch log.

Bug: 187902405
Test: atest BluetoothInstrumentationTests
Tag: #feature
Change-Id: I26f7a334218b303a46693c5dbfa309725b9e8d7b

3 years agogatt: Properly gatt register/deregister am: 7672851def am: 02848cc128 am: 81e9c91090
Chris Manton [Fri, 14 May 2021 00:16:26 +0000 (00:16 +0000)]
gatt: Properly gatt register/deregister am: 7672851def am: 02848cc128 am: 81e9c91090

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1707207

Change-Id: Iaede50fe1df56f8af37d3108df696a16b014a9c6

3 years agogatt: Properly gatt register/deregister am: 7672851def am: 02848cc128
Chris Manton [Thu, 13 May 2021 23:59:39 +0000 (23:59 +0000)]
gatt: Properly gatt register/deregister am: 7672851def am: 02848cc128

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1707207

Change-Id: Ib2d33f9cd877641d86945805bda17d35aa704961

3 years agogatt: Properly gatt register/deregister am: 7672851def
Chris Manton [Thu, 13 May 2021 23:44:17 +0000 (23:44 +0000)]
gatt: Properly gatt register/deregister am: 7672851def

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1707207

Change-Id: I49d1eb7052f3c8f5b5ddf4a7d6c0febe6c010563

3 years agogatt: Properly init/free gatt layer am: 3d058ff5e3 am: d0c7dcfe76 am: 327f969fa6
Chris Manton [Thu, 13 May 2021 23:23:53 +0000 (23:23 +0000)]
gatt: Properly init/free gatt layer am: 3d058ff5e3 am: d0c7dcfe76 am: 327f969fa6

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1707206

Change-Id: Ia4ad93f88ab86207a4a8ba75c8bfbfc124f7878d

3 years agoStreamline bta_gattc_op_cmpl am: c2a4232547 am: e22576be64 am: e4bf83024b
Chris Manton [Thu, 13 May 2021 23:23:51 +0000 (23:23 +0000)]
Streamline bta_gattc_op_cmpl am: c2a4232547 am: e22576be64 am: e4bf83024b

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700656

Change-Id: Ie365635c5ad02111e9e2c3d15bb91e8d2127ae83

3 years agoDecl-def event bta/gatt/bta_gattc_act:bta_gattc_close am: 13a538260b am: 067fc4560d...
Chris Manton [Thu, 13 May 2021 23:23:34 +0000 (23:23 +0000)]
Decl-def event bta/gatt/bta_gattc_act:bta_gattc_close am: 13a538260b am: 067fc4560d am: cdb4c69a09

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700655

Change-Id: Icd5b0cff9ba205bb4a1d79bc610de33331394d59

3 years agogatt: Properly init/free gatt layer am: 3d058ff5e3 am: d0c7dcfe76
Chris Manton [Thu, 13 May 2021 23:05:25 +0000 (23:05 +0000)]
gatt: Properly init/free gatt layer am: 3d058ff5e3 am: d0c7dcfe76

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1707206

Change-Id: I7a57629347466cf8b42e87231dbd452af3dc20f7

3 years agoStreamline bta_gattc_op_cmpl am: c2a4232547 am: e22576be64
Chris Manton [Thu, 13 May 2021 23:05:24 +0000 (23:05 +0000)]
Streamline bta_gattc_op_cmpl am: c2a4232547 am: e22576be64

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700656

Change-Id: I99f97cd74caf0e620116dc3ef8704def2fc7c63c

3 years agoDecl-def event bta/gatt/bta_gattc_act:bta_gattc_close am: 13a538260b am: 067fc4560d
Chris Manton [Thu, 13 May 2021 23:05:07 +0000 (23:05 +0000)]
Decl-def event bta/gatt/bta_gattc_act:bta_gattc_close am: 13a538260b am: 067fc4560d

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700655

Change-Id: I652bd509a2d373990d9ad6674a2d546f6a607e9f

3 years agogatt: Properly init/free gatt layer am: 3d058ff5e3
Chris Manton [Thu, 13 May 2021 22:51:04 +0000 (22:51 +0000)]
gatt: Properly init/free gatt layer am: 3d058ff5e3

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1707206

Change-Id: If0e97d4de7563a0c4c7cd0dd1c98c1fbe4a606b0

3 years agoStreamline bta_gattc_op_cmpl am: c2a4232547
Chris Manton [Thu, 13 May 2021 22:51:01 +0000 (22:51 +0000)]
Streamline bta_gattc_op_cmpl am: c2a4232547

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700656

Change-Id: Ie6e3a2205c8747232722a49302324bfdc76ed43f

3 years agoDecl-def event bta/gatt/bta_gattc_act:bta_gattc_close am: 13a538260b
Chris Manton [Thu, 13 May 2021 22:49:55 +0000 (22:49 +0000)]
Decl-def event bta/gatt/bta_gattc_act:bta_gattc_close am: 13a538260b

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700655

Change-Id: I1ebfb0a6afc250ad1e7c1bbb52cc535ed255dae1

3 years agogatt: Properly gatt register/deregister
Chris Manton [Thu, 13 May 2021 19:08:29 +0000 (12:08 -0700)]
gatt: Properly gatt register/deregister

Bug: 187827452
Test: gd/cert/run
Tag: #refactor

Change-Id: I63eba9149c2695e42c69bfdb19fd5531305b5b8d

3 years agogatt: Properly init/free gatt layer
Chris Manton [Thu, 13 May 2021 19:07:34 +0000 (12:07 -0700)]
gatt: Properly init/free gatt layer

Bug: 188073123
Test: gd/cert/run
Tag: #refactor

Change-Id: Ieb7356322153588dbc1ce3d2030222c5bb2954d2

3 years agoStreamline bta_gattc_op_cmpl
Chris Manton [Sat, 8 May 2021 23:56:09 +0000 (16:56 -0700)]
Streamline bta_gattc_op_cmpl

Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: I940c842ed23be01dc20cbfe7c05d194dc7df19c2

3 years agoavdt_scb: fix dereferences of NULL
George Burgess IV [Thu, 13 May 2021 19:20:24 +0000 (12:20 -0700)]
avdt_scb: fix dereferences of NULL

A recent change to this code added `int` in this for loop's first clause
(good, since that's way more common than declaring `i` outside of the
loop). Unfortunately, this caused the `*p_err_code = 0` to be
interpreted as "create a new int* called p_err_code and set it to 0,"
rather than "set the value pointed to by p_err_code to 0."

Caught by clang's static analyzer:

> system/bt/stack/avdt/avdt_scb.cc:936:19: warning: Dereference of null
pointer (loaded from variable 'p_err_code')
[clang-analyzer-core.NullDereference]>
system/bt/stack/avdt/avdt_scb.cc:941:19: warning: Dereference of null
pointer (loaded from variable 'p_err_code')
[clang-analyzer-core.NullDereference] >
system/bt/stack/avdt/avdt_scb.cc:946:19: warning: Dereference of null
pointer (loaded from variable 'p_err_code')
[clang-analyzer-core.NullDereference] >
system/bt/stack/avdt/avdt_scb.cc:955:23: warning: Dereference of null
pointer (loaded from variable 'p_err_code')
[clang-analyzer-core.NullDereference] >
system/bt/stack/avdt/avdt_scb.cc:963:23: warning: Dereference of null
pointer (loaded from variable 'p_err_code')
[clang-analyzer-core.NullDereference]

Bug: 180421437
Test: TreeHugger
Change-Id: I834032e22da0ed558c25355c9d1cf20c11c8c530

3 years agoDecl-def event bta/gatt/bta_gattc_act:bta_gattc_close
Chris Manton [Sat, 8 May 2021 23:48:04 +0000 (16:48 -0700)]
Decl-def event bta/gatt/bta_gattc_act:bta_gattc_close

Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: I90abbd76e89d1d395859eaa19555c65112f31987

3 years agoMerge "Fix potential null dereferences in btif_rc.cc" into sc-dev
Jakub Pawlowski [Thu, 13 May 2021 18:04:58 +0000 (18:04 +0000)]
Merge "Fix potential null dereferences in btif_rc.cc" into sc-dev

3 years agoRemove useless #def bta/hh/bta_hh_int::BTA_HH_MAX_RPT_CHARS am: c8b751d164 am: cae8c9...
Chris Manton [Thu, 13 May 2021 17:48:25 +0000 (17:48 +0000)]
Remove useless #def bta/hh/bta_hh_int::BTA_HH_MAX_RPT_CHARS am: c8b751d164 am: cae8c9c79a am: e91aea7f06

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700654

Change-Id: I5a524c181b07ecf05ab74faa75d8d8885b1bccca

3 years agoRemove useless #def bta/hh/bta_hh_int::BTA_HH_MAX_RPT_CHARS am: c8b751d164 am: cae8c9c79a
Chris Manton [Thu, 13 May 2021 17:23:45 +0000 (17:23 +0000)]
Remove useless #def bta/hh/bta_hh_int::BTA_HH_MAX_RPT_CHARS am: c8b751d164 am: cae8c9c79a

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700654

Change-Id: I8cb7e2a62184df48b3494ff88329b2cb2821a308

3 years agoRemove useless #def bta/hh/bta_hh_int::BTA_HH_MAX_RPT_CHARS am: c8b751d164
Chris Manton [Thu, 13 May 2021 17:00:36 +0000 (17:00 +0000)]
Remove useless #def bta/hh/bta_hh_int::BTA_HH_MAX_RPT_CHARS am: c8b751d164

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700654

Change-Id: I9e4ba18aa80bd0f0c1d112dcc91e33bfbf2a0657

3 years agoFix potential null dereferences in btif_rc.cc
Jakub Pawlowski [Thu, 13 May 2021 16:10:08 +0000 (18:10 +0200)]
Fix potential null dereferences in btif_rc.cc

Test: compilation
Bug: 182163258
Change-Id: I2450962736f067db28d4b1657ae632f77ada6afe

3 years agoMerge "CTKD: Fix role change bug on legacy BT stack" am: 672131f257 am: 85fc6e6012...
Treehugger Robot [Thu, 13 May 2021 16:01:10 +0000 (16:01 +0000)]
Merge "CTKD: Fix role change bug on legacy BT stack" am: 672131f257 am: 85fc6e6012 am: dfb71cfc7e

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1697087

Change-Id: I106656f327b0cc1ae5b0c997f8096bf4cfd7c5e2

3 years agoMerge "CTKD: Fix role change bug on legacy BT stack" am: 672131f257 am: 85fc6e6012
Treehugger Robot [Thu, 13 May 2021 15:44:33 +0000 (15:44 +0000)]
Merge "CTKD: Fix role change bug on legacy BT stack" am: 672131f257 am: 85fc6e6012

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1697087

Change-Id: I523f6f26dfbde72fae38b639ef65aa4985d6186f

3 years agoMerge "CTKD: Fix role change bug on legacy BT stack" am: 672131f257
Treehugger Robot [Thu, 13 May 2021 15:29:44 +0000 (15:29 +0000)]
Merge "CTKD: Fix role change bug on legacy BT stack" am: 672131f257

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1697087

Change-Id: I78e80cddb072543e1995585cb03d4e46631f4773

3 years agoRemove useless #def bta/hh/bta_hh_int::BTA_HH_MAX_RPT_CHARS
Chris Manton [Sat, 8 May 2021 23:41:47 +0000 (16:41 -0700)]
Remove useless #def bta/hh/bta_hh_int::BTA_HH_MAX_RPT_CHARS

Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: I4b5501ecf96f67c451e86323752ae07ad88940bb

3 years agoMerge "CTKD: Fix role change bug on legacy BT stack"
Treehugger Robot [Thu, 13 May 2021 15:11:25 +0000 (15:11 +0000)]
Merge "CTKD: Fix role change bug on legacy BT stack"

3 years agoCTKD: Fix role change bug on legacy BT stack
Animesh Fatehpuria [Wed, 5 May 2021 07:51:21 +0000 (15:51 +0800)]
CTKD: Fix role change bug on legacy BT stack

If a role switch happens before connection complete, we incorrectly
ignore the information. This can sometimes cause CTKD to not function
properly.

Bug: 186367778
Tag: #refactor
Test: atest net_test_main_shim, presubmit, manual role change testing
(with and without gd enabled)

Change-Id: I619376d35051a9b5ead74608a66fae1c5ea32c2b

3 years agoMerge "remove unused fields" am: eec6ea121c am: 5a8ca9cddc am: 6490206211
Treehugger Robot [Thu, 13 May 2021 05:48:03 +0000 (05:48 +0000)]
Merge "remove unused fields" am: eec6ea121c am: 5a8ca9cddc am: 6490206211

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700653

Change-Id: If60c71778021d9781d65c4164a035a23eb78e37c

3 years agoMerge "remove unused fields" am: eec6ea121c am: 5a8ca9cddc
Treehugger Robot [Thu, 13 May 2021 05:24:57 +0000 (05:24 +0000)]
Merge "remove unused fields" am: eec6ea121c am: 5a8ca9cddc

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700653

Change-Id: Id81e08e65b5cdde6274b92e67a7eac8fa05bdcae

3 years agoMerge "remove unused fields" am: eec6ea121c
Treehugger Robot [Thu, 13 May 2021 05:08:11 +0000 (05:08 +0000)]
Merge "remove unused fields" am: eec6ea121c

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700653

Change-Id: I76d36c558384e7529528234d4ddc1773650dd903

3 years agoMerge "remove unused fields"
Treehugger Robot [Thu, 13 May 2021 04:50:42 +0000 (04:50 +0000)]
Merge "remove unused fields"

3 years agoMerge "Separate End, Reset, and Quit" am: 702c9941ad am: 23e25f722c am: ebf688bb93
Treehugger Robot [Thu, 13 May 2021 04:32:59 +0000 (04:32 +0000)]
Merge "Separate End, Reset, and Quit" am: 702c9941ad am: 23e25f722c am: ebf688bb93

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1705639

Change-Id: I4fc7eae2cc3a31c10fe6af169ba267b21998088f

3 years agoEnum-ify tBTA_HH_INT_EVT am: d2af009d02 am: 0a9d0252c3 am: 54c7a88e0f
Chris Manton [Thu, 13 May 2021 04:32:47 +0000 (04:32 +0000)]
Enum-ify tBTA_HH_INT_EVT am: d2af009d02 am: 0a9d0252c3 am: 54c7a88e0f

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700652

Change-Id: I67543d24fc5f6d2b22fd9320cb2b5afb6a7fe54f

3 years agoRemove useless #def bta/hh/bta_hh_int::BTA_HH_ am: e3e69be13d am: 926e6ac72a am:...
Chris Manton [Thu, 13 May 2021 04:32:45 +0000 (04:32 +0000)]
Remove useless #def bta/hh/bta_hh_int::BTA_HH_ am: e3e69be13d am: 926e6ac72a am: c5c36be70f

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700651

Change-Id: I3d7015bd2234d796ebe8cf24faba63ec1981a3fa

3 years agoRemove useless #def bta/hh/bta_hh_::BTA_HH_FST_BTE_TRANS_EVT am: 3567c1c062 am: 68e1c...
Chris Manton [Thu, 13 May 2021 04:32:41 +0000 (04:32 +0000)]
Remove useless #def bta/hh/bta_hh_::BTA_HH_FST_BTE_TRANS_EVT am: 3567c1c062 am: 68e1c2d253 am: 9a9bdf1e12

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700650

Change-Id: Ifafea3b8724ac820afb46b9cedf79e1d4016cd89

3 years agoMerge "Separate End, Reset, and Quit" am: 702c9941ad am: 23e25f722c
Treehugger Robot [Thu, 13 May 2021 03:29:36 +0000 (03:29 +0000)]
Merge "Separate End, Reset, and Quit" am: 702c9941ad am: 23e25f722c

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1705639

Change-Id: Ifb852a09ea30714f54db75550ae5cd0fa2798beb

3 years agoEnum-ify tBTA_HH_INT_EVT am: d2af009d02 am: 0a9d0252c3
Chris Manton [Thu, 13 May 2021 03:29:25 +0000 (03:29 +0000)]
Enum-ify tBTA_HH_INT_EVT am: d2af009d02 am: 0a9d0252c3

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700652

Change-Id: I0315ec56e540d777fe617a2e47f508c38dbb2d61

3 years agoRemove useless #def bta/hh/bta_hh_int::BTA_HH_ am: e3e69be13d am: 926e6ac72a
Chris Manton [Thu, 13 May 2021 03:29:24 +0000 (03:29 +0000)]
Remove useless #def bta/hh/bta_hh_int::BTA_HH_ am: e3e69be13d am: 926e6ac72a

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700651

Change-Id: Ie4712f317aea8967c7d68b36b54f299b589606ca

3 years agoRemove useless #def bta/hh/bta_hh_::BTA_HH_FST_BTE_TRANS_EVT am: 3567c1c062 am: 68e1c...
Chris Manton [Thu, 13 May 2021 03:29:23 +0000 (03:29 +0000)]
Remove useless #def bta/hh/bta_hh_::BTA_HH_FST_BTE_TRANS_EVT am: 3567c1c062 am: 68e1c2d253

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700650

Change-Id: Icc1f1a72cac25ee60e1f75973c632adcb7432755

3 years agoMerge "Separate End, Reset, and Quit" am: 702c9941ad
Treehugger Robot [Thu, 13 May 2021 03:16:03 +0000 (03:16 +0000)]
Merge "Separate End, Reset, and Quit" am: 702c9941ad

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1705639

Change-Id: I51f6b74794b840a8daded0991e2497f559e76961

3 years agoMerge "Separate End, Reset, and Quit"
Treehugger Robot [Thu, 13 May 2021 03:09:20 +0000 (03:09 +0000)]
Merge "Separate End, Reset, and Quit"

3 years agoEnum-ify tBTA_HH_INT_EVT am: d2af009d02
Chris Manton [Thu, 13 May 2021 03:06:12 +0000 (03:06 +0000)]
Enum-ify tBTA_HH_INT_EVT am: d2af009d02

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700652

Change-Id: Ic1753c7bd0f27c6225e815b607fa78555b049fc4

3 years agoRemove useless #def bta/hh/bta_hh_int::BTA_HH_ am: e3e69be13d
Chris Manton [Thu, 13 May 2021 03:06:09 +0000 (03:06 +0000)]
Remove useless #def bta/hh/bta_hh_int::BTA_HH_ am: e3e69be13d

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700651

Change-Id: I75e478625cae718a5a558038c2af9e6cd7e26c43

3 years agoRemove useless #def bta/hh/bta_hh_::BTA_HH_FST_BTE_TRANS_EVT am: 3567c1c062
Chris Manton [Thu, 13 May 2021 03:05:26 +0000 (03:05 +0000)]
Remove useless #def bta/hh/bta_hh_::BTA_HH_FST_BTE_TRANS_EVT am: 3567c1c062

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700650

Change-Id: I30b22df76e4dae927bc065cd82e606b0a8e6ac37

3 years agoMerge changes If5f6b231,I8c5eb4bb,I01aa1955 am: 8577c8e621 am: fe5cf7cbf1 am: 6ff137977a
Chris Manton [Thu, 13 May 2021 02:44:26 +0000 (02:44 +0000)]
Merge changes If5f6b231,I8c5eb4bb,I01aa1955 am: 8577c8e621 am: fe5cf7cbf1 am: 6ff137977a

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700649

Change-Id: Id79d482cd724a78cd1b5b220925854ca5870f3ae

3 years agoMerge changes If5f6b231,I8c5eb4bb,I01aa1955 am: 8577c8e621 am: fe5cf7cbf1
Chris Manton [Thu, 13 May 2021 02:01:02 +0000 (02:01 +0000)]
Merge changes If5f6b231,I8c5eb4bb,I01aa1955 am: 8577c8e621 am: fe5cf7cbf1

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700649

Change-Id: I90e5368a798e24b5270437642640827b5d31a989

3 years ago[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd...
TreeHugger Robot [Thu, 13 May 2021 01:33:47 +0000 (01:33 +0000)]
[automerger skipped] Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd OOB write" into qt-qpr1-dev am: 454fdc7be9 -s ours

am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/14452688

Change-Id: I77b1c51ea375ae50b2a0973e9235b544a5dc8eed

3 years agoMerge changes If5f6b231,I8c5eb4bb,I01aa1955 am: 8577c8e621
Chris Manton [Thu, 13 May 2021 01:25:19 +0000 (01:25 +0000)]
Merge changes If5f6b231,I8c5eb4bb,I01aa1955 am: 8577c8e621

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700649

Change-Id: Iba49f3d4d1fa8afa9efb14987d629c16ba3b4fa4

3 years agoMerge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd OOB write" into qt-qpr1-dev
TreeHugger Robot [Thu, 13 May 2021 01:21:30 +0000 (01:21 +0000)]
Merge "RESTRICT AUTOMERGE Contain avrc_ctrl_pars_vendor_cmd OOB write" into qt-qpr1-dev

3 years agoremove unused fields
Chris Manton [Sat, 8 May 2021 21:41:23 +0000 (14:41 -0700)]
remove unused fields

Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: Ief8a8daf8f5e2a6c75f1a460d95a6e205ad3bc96

3 years agoEnum-ify tBTA_HH_INT_EVT
Chris Manton [Sat, 8 May 2021 20:45:48 +0000 (13:45 -0700)]
Enum-ify tBTA_HH_INT_EVT

Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: Iae765a7240ad61db3abfa8398b8e7d087f586afd

3 years agoRemove useless #def bta/hh/bta_hh_int::BTA_HH_
Chris Manton [Sat, 8 May 2021 20:39:39 +0000 (13:39 -0700)]
Remove useless #def bta/hh/bta_hh_int::BTA_HH_

Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: I520cccf0607bd9191802bdc6f362de48227b5132

3 years agoRemove useless #def bta/hh/bta_hh_::BTA_HH_FST_BTE_TRANS_EVT
Chris Manton [Sat, 8 May 2021 20:37:58 +0000 (13:37 -0700)]
Remove useless #def bta/hh/bta_hh_::BTA_HH_FST_BTE_TRANS_EVT

Bug: 163134718
Test: gd/cert/run
Tag: #refactor

Change-Id: I25d547b6870863d4b0a6fa3a2d12d626e043e62b

3 years agoInitial commit for rusty BluetoothManager am: 2dc4fc3188 am: 7beaf545d9 am: cc2cfb3fcc
Hansong Zhang [Thu, 13 May 2021 01:12:00 +0000 (01:12 +0000)]
Initial commit for rusty BluetoothManager am: 2dc4fc3188 am: 7beaf545d9 am: cc2cfb3fcc

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1662963

Change-Id: Ibd814462ed51c97f1aaf8aae55454f6e113a6a24

3 years agoMerge changes If5f6b231,I8c5eb4bb,I01aa1955
Chris Manton [Thu, 13 May 2021 01:11:33 +0000 (01:11 +0000)]
Merge changes If5f6b231,I8c5eb4bb,I01aa1955

* changes:
  Remove useless #def bta/hh/bta_hh_::BTA_HH_FST_TRANS_CB_EVT
  Streamline bta_hh_read_ssr_param
  Streamline BTM_GetLinkSuperTout

3 years agoInitial commit for rusty BluetoothManager am: 2dc4fc3188 am: 7beaf545d9
Hansong Zhang [Thu, 13 May 2021 00:55:05 +0000 (00:55 +0000)]
Initial commit for rusty BluetoothManager am: 2dc4fc3188 am: 7beaf545d9

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1662963

Change-Id: Ia80b7cd591daaf42e4cf92c863b8be57e27e4fbe

3 years agoInitial commit for rusty BluetoothManager am: 2dc4fc3188
Hansong Zhang [Thu, 13 May 2021 00:31:47 +0000 (00:31 +0000)]
Initial commit for rusty BluetoothManager am: 2dc4fc3188

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1662963

Change-Id: I528838ef9f1b5f4e7f35b2cce66128c242c87951

3 years agoSeparate End, Reset, and Quit
Myles Watson [Wed, 12 May 2021 23:49:13 +0000 (16:49 -0700)]
Separate End, Reset, and Quit

Bug: 187371955
Test: cert/run
Tag: #testing
Change-Id: I99b5181df1781545026cd25b659b399e86add71c

3 years agoInitial commit for rusty BluetoothManager
Hansong Zhang [Fri, 2 Apr 2021 21:24:08 +0000 (14:24 -0700)]
Initial commit for rusty BluetoothManager

Add the basic state machine (without timeout so far), basic DBUS API,
and basic unit test for state machine.

Bug: 179719629
Test: cargo test
Change-Id: I0aafc8e9e84defc5c19d1c235ed1c935cf6691cb

3 years agoRemove unused #defs bta/hh/bta_hh_utils am: 2c22338448 am: 945ac3ba5a am: d5cd1e01d0
Chris Manton [Wed, 12 May 2021 21:44:03 +0000 (21:44 +0000)]
Remove unused #defs bta/hh/bta_hh_utils am: 2c22338448 am: 945ac3ba5a am: d5cd1e01d0

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700646

Change-Id: I24876036cfb1e7f41869d66093b3182e8b72b6a3

3 years agoRemove unused funcs bta/hh::bta_hh_parse_ am: 83ae09b5fd am: ebd12c15dc am: d90bd3c013
Chris Manton [Wed, 12 May 2021 21:44:01 +0000 (21:44 +0000)]
Remove unused funcs bta/hh::bta_hh_parse_ am: 83ae09b5fd am: ebd12c15dc am: d90bd3c013

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1700645

Change-Id: Ie26914c1b4b64789a56622eae5c09c61387550bf