OSDN Git Service

android-x86/system-bt.git
2 years agoReset the IRK after all devices are unpaired
Martin Brabham [Fri, 29 Oct 2021 21:27:27 +0000 (21:27 +0000)]
Reset the IRK after all devices are unpaired

Bug: 204355134
Bug: 195410559
Test: Check IRK, pair devices, unpair all devices, Check IRK
Tag: #security
Change-Id: I8e44f010a72dcdec595d81293a05f49ccc054065
Merged-In: I8e44f010a72dcdec595d81293a05f49ccc054065

2 years agoMerge "DO NOT MERGE: Enable Qualcomm 3804 log in snoop log with base 64 format" into...
More Kuo [Mon, 25 Oct 2021 02:36:27 +0000 (02:36 +0000)]
Merge "DO NOT MERGE: Enable Qualcomm 3804 log in snoop log with base 64 format" into sc-v2-dev

2 years agoDO NOT MERGE: Enable Qualcomm 3804 log in snoop log with base 64 format
More Kuo [Fri, 15 Oct 2021 08:56:01 +0000 (16:56 +0800)]
DO NOT MERGE: Enable Qualcomm 3804 log in snoop log with base 64 format

Bug: 203015591
Tag: #feature
Test: manually checked content of partial btsnoop log
Ignore-AOSP-First: Enhanced log
Change-Id: I8e0e85b1493332405147f572cceaa24c56771a3d

2 years agoFix possible NPE for UNKNOWN code path
Martin Brabham [Thu, 14 Oct 2021 20:02:59 +0000 (20:02 +0000)]
Fix possible NPE for UNKNOWN code path

Bug: 200595320
Test: Manual
Tag: #feature
Change-Id: I89b52553990bf58b8af304bab0bdd4cd8e8cb017
Merged-In: I89b52553990bf58b8af304bab0bdd4cd8e8cb017

2 years agoSMP API check for cached OOB data
Martin Brabham [Wed, 13 Oct 2021 18:27:43 +0000 (18:27 +0000)]
SMP API check for cached OOB data

If OOB data was generated before the pairing was attempted then use the
cached OOB data information for the pairing.  We don't know if it is the
data for the particular device we are attempting to pair with, but it'll
either work or it won't.  And if it doesn't, then it is likely not the
device we intended to pair with.

This will mean that Pixel will only perform double sided
OOB pairing IF it has previously created OOB data.

Data is removed on successful pairing or advertisement timeout.

When the device is the connector, it doesn't need to ask the
app for the OOB data since the OOB data is provided at the time
of create_bond_out_of_band being called.

This should fix the issue with double OOB data pairing scenarios where
this device is the device that initiates the bond.

Bug: 200595320
Test: Manual, test app.
Tag: #feature
Change-Id: Idd94a4ebe9ebeed57026fd915f499d509873e4f0
Merged-In: Idd94a4ebe9ebeed57026fd915f499d509873e4f0

2 years agoMerge "osi: Prevent memory allocations with MSB set" into rvc-qpr-dev am: 3034c96552...
Chris Manton [Wed, 6 Oct 2021 19:54:40 +0000 (19:54 +0000)]
Merge "osi: Prevent memory allocations with MSB set" into rvc-qpr-dev am: 3034c96552 am: 1f5dd6bdba am: d4a884c71a

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

Change-Id: I2259d50c80bbc76216aa8e65e5cddf9a830275ef

2 years agoMerge "osi: Prevent memory allocations with MSB set" into rvc-qpr-dev am: 3034c96552...
Chris Manton [Wed, 6 Oct 2021 19:39:11 +0000 (19:39 +0000)]
Merge "osi: Prevent memory allocations with MSB set" into rvc-qpr-dev am: 3034c96552 am: 1f5dd6bdba

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

Change-Id: Id564bb1c778e2230ea48d76d203e47479216788b

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a351...
Chris Manton [Wed, 6 Oct 2021 19:30:51 +0000 (19:30 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912 am: 7300b01716 am: 2cadbc6377 am: 2a995ed2ee am: 9cbaca4043

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

Change-Id: I781c1232894090c5fcdfe1d97155fc04c884ffe1

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173...
Chris Manton [Wed, 6 Oct 2021 19:30:44 +0000 (19:30 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e am: 477c78d5e3 am: 418ede631f am: 80f269c513

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

Change-Id: Ife3582671e89604ab828e434b19fc48babe15e7b

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a351...
Chris Manton [Wed, 6 Oct 2021 19:30:38 +0000 (19:30 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912 am: 7300b01716 am: d2596b6520 am: e430264ba2 am: 04d1214cdd

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

Change-Id: I1c1a82579b2fc8eed34e62577ba59367ff7e9e21

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173...
Chris Manton [Wed, 6 Oct 2021 19:30:30 +0000 (19:30 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e am: e8c11e248e am: ba7b1b8dc5 am: bb7c9a0574

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

Change-Id: I680a11bad2593e9be5143c0b3ff9477dde0b1d18

2 years agoMerge "osi: Prevent memory allocations with MSB set" into rvc-qpr-dev am: 3034c96552
Chris Manton [Wed, 6 Oct 2021 19:29:36 +0000 (19:29 +0000)]
Merge "osi: Prevent memory allocations with MSB set" into rvc-qpr-dev am: 3034c96552

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

Change-Id: If6a8459b1f86d41c2b7913e5e45ed808884fb553

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a351...
Chris Manton [Wed, 6 Oct 2021 19:21:12 +0000 (19:21 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912 am: 7300b01716 am: 2cadbc6377 am: 2a995ed2ee

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

Change-Id: I263be25fe5d31705f8b4fd0d907c7c5edda57f3a

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173...
Chris Manton [Wed, 6 Oct 2021 19:21:07 +0000 (19:21 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e am: 477c78d5e3 am: 418ede631f

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

Change-Id: I496fe0a0941ba593e2148e19005326b81f00e09c

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a351...
Chris Manton [Wed, 6 Oct 2021 19:21:03 +0000 (19:21 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912 am: 7300b01716 am: d2596b6520 am: e430264ba2

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

Change-Id: I0f4d512c6d527005d8a194c1da0a1841583317f6

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173...
Chris Manton [Wed, 6 Oct 2021 19:20:58 +0000 (19:20 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e am: e8c11e248e am: ba7b1b8dc5

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

Change-Id: I6aa57d04dd4c85c781853d1c8ccec84a042a1d49

2 years agoMerge "osi: Prevent memory allocations with MSB set" into rvc-qpr-dev
Chris Manton [Wed, 6 Oct 2021 19:17:56 +0000 (19:17 +0000)]
Merge "osi: Prevent memory allocations with MSB set" into rvc-qpr-dev

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a351...
Chris Manton [Wed, 6 Oct 2021 19:06:03 +0000 (19:06 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912 am: 7300b01716 am: 2cadbc6377

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

Change-Id: I893e25ea34771c4f650ad22f647c03638df77e8d

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173...
Chris Manton [Wed, 6 Oct 2021 19:05:16 +0000 (19:05 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e am: 477c78d5e3

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

Change-Id: I5acb4c7ebd3a994218023aeab327252ed2353484

2 years agoosi: Prevent memory allocations with MSB set am: e435404a7d am: 865d4f4214 am: eacac9...
Chris Manton [Wed, 6 Oct 2021 18:54:35 +0000 (18:54 +0000)]
osi: Prevent memory allocations with MSB set am: e435404a7d am: 865d4f4214 am: eacac971c2 am: 17512ac743

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

Change-Id: Ie9829ae9f032a0d2c6464028db24186c6b9f86c3

2 years agoosi: Prevent memory allocations with MSB set am: e435404a7d am: ec15c0798b am: b40605...
Chris Manton [Wed, 6 Oct 2021 18:54:31 +0000 (18:54 +0000)]
osi: Prevent memory allocations with MSB set am: e435404a7d am: ec15c0798b am: b4060577b1 am: e77476438c

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

Change-Id: I62e317a9a980b73531c89639bffefc9336bd1be3

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a351...
Chris Manton [Wed, 6 Oct 2021 18:53:45 +0000 (18:53 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912 am: 7300b01716 am: d2596b6520

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

Change-Id: I954eaa7530d6c9f9aa9652cfbcc48cdbbc0a306f

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173...
Chris Manton [Wed, 6 Oct 2021 18:53:38 +0000 (18:53 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e am: e8c11e248e

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

Change-Id: I5c6e608a88165a6b8e72ecf42717b90212eb0165

2 years agoosi: Prevent memory allocations with MSB set am: e435404a7d am: 865d4f4214 am: eacac971c2
Chris Manton [Wed, 6 Oct 2021 18:39:28 +0000 (18:39 +0000)]
osi: Prevent memory allocations with MSB set am: e435404a7d am: 865d4f4214 am: eacac971c2

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

Change-Id: I96ba920ef13a419749253ac136b917e140bfeca7

2 years agoosi: Prevent memory allocations with MSB set am: e435404a7d am: ec15c0798b am: b4060577b1
Chris Manton [Wed, 6 Oct 2021 18:39:26 +0000 (18:39 +0000)]
osi: Prevent memory allocations with MSB set am: e435404a7d am: ec15c0798b am: b4060577b1

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

Change-Id: I6525cdadaa71c2a970d307ff7a37ed8941ab11ca

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a351...
Chris Manton [Wed, 6 Oct 2021 18:39:24 +0000 (18:39 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912 am: 7300b01716

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

Change-Id: Ifc1b529263fd24774cef4ffab422bc4bcd334901

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a351...
Chris Manton [Wed, 6 Oct 2021 18:39:24 +0000 (18:39 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912 am: 7300b01716

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

Change-Id: I60ce82f68eb256b8a786f8127fe21c38d0ee1833

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e
Chris Manton [Wed, 6 Oct 2021 18:39:20 +0000 (18:39 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e

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

Change-Id: I7c21d6dfe0efe6812259cea7b839120a3cd58ac1

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e
Chris Manton [Wed, 6 Oct 2021 18:39:20 +0000 (18:39 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602 am: d65173898e

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

Change-Id: I03b2dbdb3dd187880383a26fedf10cb4f06ff670

2 years agoosi: Prevent memory allocations with MSB set am: e435404a7d am: 865d4f4214
Chris Manton [Wed, 6 Oct 2021 18:24:18 +0000 (18:24 +0000)]
osi: Prevent memory allocations with MSB set am: e435404a7d am: 865d4f4214

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

Change-Id: Ia474ae0cada1cf3966d31851059dfe6bc87f45f2

2 years agoosi: Prevent memory allocations with MSB set am: a1184057b2 am: c4935a845a
Chris Manton [Wed, 6 Oct 2021 18:24:04 +0000 (18:24 +0000)]
osi: Prevent memory allocations with MSB set am: a1184057b2 am: c4935a845a

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

Change-Id: I0593ec83e6fe321b88c4200ba548923fa7e6a021

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912
Chris Manton [Wed, 6 Oct 2021 18:23:49 +0000 (18:23 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793 am: 85a3510912

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

Change-Id: Ice95438b8dbce78342490c360887246f7c5a1cb6

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602
Chris Manton [Wed, 6 Oct 2021 18:23:45 +0000 (18:23 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8 am: 32249b0602

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

Change-Id: I169567991117522a820ee5140e8bad2b1444e2e7

2 years agoosi: Prevent memory allocations with MSB set am: e435404a7d am: ec15c0798b
Chris Manton [Wed, 6 Oct 2021 18:23:11 +0000 (18:23 +0000)]
osi: Prevent memory allocations with MSB set am: e435404a7d am: ec15c0798b

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

Change-Id: I109fadf5b18e8796dc683a57897149fff96660ca

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793
Chris Manton [Wed, 6 Oct 2021 18:13:10 +0000 (18:13 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9 am: 1812f99793

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

Change-Id: Ie5cfe615061877d55b80ca411aba92629eb81583

2 years agoosi: Prevent memory allocations with MSB set am: cee4d086c9
Chris Manton [Wed, 6 Oct 2021 18:09:25 +0000 (18:09 +0000)]
osi: Prevent memory allocations with MSB set am: cee4d086c9

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

Change-Id: I29728cd50670ba60bf42f4142aa302f79d6ed9e3

2 years agoosi: Prevent memory allocations with MSB set am: a1184057b2
Chris Manton [Wed, 6 Oct 2021 18:09:21 +0000 (18:09 +0000)]
osi: Prevent memory allocations with MSB set am: a1184057b2

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

Change-Id: If7002b1f305358ff40aa174d81442d3b998b5514

2 years agoosi: Prevent memory allocations with MSB set am: e435404a7d
Chris Manton [Wed, 6 Oct 2021 18:09:15 +0000 (18:09 +0000)]
osi: Prevent memory allocations with MSB set am: e435404a7d

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

Change-Id: Id94265b102135a390aa798b3b682530bc8c33625

2 years agoosi: Prevent memory allocations with MSB set am: e435404a7d
Chris Manton [Wed, 6 Oct 2021 18:09:13 +0000 (18:09 +0000)]
osi: Prevent memory allocations with MSB set am: e435404a7d

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

Change-Id: I977f1225ea250ef304b79efd475440f248bd557d

2 years agoosi: Prevent memory allocations with MSB set am: 1e76ec66d8
Chris Manton [Wed, 6 Oct 2021 18:08:26 +0000 (18:08 +0000)]
osi: Prevent memory allocations with MSB set am: 1e76ec66d8

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

Change-Id: I3f033ec55080fbb2d924662b20d5e09a89a00c51

2 years agoosi: Prevent memory allocations with MSB set am: fa98e7e869
Chris Manton [Wed, 6 Oct 2021 15:49:18 +0000 (15:49 +0000)]
osi: Prevent memory allocations with MSB set am: fa98e7e869

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

Change-Id: I5ec8e46e22290bfbfb8c87e2cf7c37c61f1eca9b

2 years agoosi: Prevent memory allocations with MSB set
Chris Manton [Thu, 30 Sep 2021 00:49:25 +0000 (17:49 -0700)]
osi: Prevent memory allocations with MSB set

Limit allocations on 32bit to 2 GB
Limit allocations on 64bit to 8 Exabyte

Bug: 197868577
Tag: #refactor
Test: gd/cert/run
Ignore-AOSP-First: Security
Change-Id: I1c347084d7617b1e364a3241f1b37b398a2a6c6a

2 years agoosi: Prevent memory allocations with MSB set
Chris Manton [Thu, 30 Sep 2021 00:49:25 +0000 (17:49 -0700)]
osi: Prevent memory allocations with MSB set

Limit allocations on 32bit to 2 GB
Limit allocations on 64bit to 8 Exabyte

Bug: 197868577
Tag: #refactor
Test: gd/cert/run
Ignore-AOSP-First: Security
Change-Id: I1c347084d7617b1e364a3241f1b37b398a2a6c6a

2 years agoFix GATT data loss due to segmentation error
IHLHO KIM [Thu, 30 Sep 2021 08:46:37 +0000 (08:46 +0000)]
Fix GATT data loss due to segmentation error

Wrong segmentation of HCI ACL data packet makes data loss.
HCI ACL Data packet header(preamble) has to be removed for the calculation.
BR_EDR will have same issue. This fix it also.

This issue came from the following patch.
https://android-review.googlesource.com/c/platform/system/bt/+/1407393

Bug: 201372527
Change-Id: I9d6b813b173512638680bdf301379851a2e34180
Tag: #refactor
Test: compile & verify basic functions working
Ignore-AOSP-First: Backport

2 years agoAdd BMW Carkit into IOP table to only use AVRCP 1.4 am: b474562c53
Patty [Fri, 1 Oct 2021 16:24:16 +0000 (16:24 +0000)]
Add BMW Carkit into IOP table to only use AVRCP 1.4 am: b474562c53

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

Change-Id: I60956ea246acbf6f0c3d8a7984fcc412561df971

2 years agoosi: Prevent memory allocations with MSB set
Chris Manton [Thu, 30 Sep 2021 00:49:25 +0000 (17:49 -0700)]
osi: Prevent memory allocations with MSB set

Limit allocations on 32bit to 2 GB
Limit allocations on 64bit to 8 Exabyte

Bug: 197868577
Tag: #refactor
Test: gd/cert/run
Ignore-AOSP-First: Security
Change-Id: I1c347084d7617b1e364a3241f1b37b398a2a6c6a

2 years agoosi: Prevent memory allocations with MSB set
Chris Manton [Thu, 30 Sep 2021 00:49:25 +0000 (17:49 -0700)]
osi: Prevent memory allocations with MSB set

Limit allocations on 32bit to 2 GB
Limit allocations on 64bit to 8 Exabyte

Bug: 197868577
Tag: #refactor
Test: gd/cert/run
Ignore-AOSP-First: Security
Change-Id: I1c347084d7617b1e364a3241f1b37b398a2a6c6a

2 years agoosi: Prevent memory allocations with MSB set
Chris Manton [Thu, 30 Sep 2021 00:49:25 +0000 (17:49 -0700)]
osi: Prevent memory allocations with MSB set

Limit allocations on 32bit to 2 GB
Limit allocations on 64bit to 8 Exabyte

Bug: 197868577
Tag: #refactor
Test: gd/cert/run
Ignore-AOSP-First: Security
Change-Id: I1c347084d7617b1e364a3241f1b37b398a2a6c6a

2 years agoosi: Prevent memory allocations with MSB set
Chris Manton [Thu, 30 Sep 2021 00:49:25 +0000 (17:49 -0700)]
osi: Prevent memory allocations with MSB set

Limit allocations on 32bit to 2 GB
Limit allocations on 64bit to 8 Exabyte

Bug: 197868577
Tag: #refactor
Test: gd/cert/run
Ignore-AOSP-First: Security
Change-Id: I1c347084d7617b1e364a3241f1b37b398a2a6c6a

2 years agoosi: Prevent memory allocations with MSB set
Chris Manton [Thu, 30 Sep 2021 00:49:25 +0000 (17:49 -0700)]
osi: Prevent memory allocations with MSB set

Limit allocations on 32bit to 2 GB
Limit allocations on 64bit to 8 Exabyte

Bug: 197868577
Tag: #refactor
Test: gd/cert/run
Ignore-AOSP-First: Security
Change-Id: I1c347084d7617b1e364a3241f1b37b398a2a6c6a

2 years agoAdd BMW Carkit into IOP table to only use AVRCP 1.4
Patty [Fri, 1 Oct 2021 06:52:08 +0000 (14:52 +0800)]
Add BMW Carkit into IOP table to only use AVRCP 1.4

Tag: #compatibility
Bug: 197454708
Test: Manual
Merged-In: Ib9ed8ee8cd9f94fdad206eaba29fad3160ee0c88
Change-Id: Ib9ed8ee8cd9f94fdad206eaba29fad3160ee0c88

2 years agoImmediately execute instead of queueing request for LE service discovery am: 6788b04e25
Rahul Sabnis [Thu, 30 Sep 2021 21:59:23 +0000 (21:59 +0000)]
Immediately execute instead of queueing request for LE service discovery am: 6788b04e25

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

Change-Id: Ide2ddf10e0d87f336c60b87b7250abd6b05d30b8

2 years agoImmediately execute instead of queueing request for LE service discovery
Rahul Sabnis [Mon, 27 Sep 2021 23:36:10 +0000 (16:36 -0700)]
Immediately execute instead of queueing request for LE service discovery
if the static address matches that of the actively pairing device

Tag: #feature
Bug: 187157597
Test: Manual
Merged-In: I7a014341bec69f1ef97878e90a11558be5ef70d8
Change-Id: I7a014341bec69f1ef97878e90a11558be5ef70d8

2 years agoMerge "Make SDP and inquiry request dequeue and execute more comprehensive and cancel...
TreeHugger Robot [Fri, 24 Sep 2021 19:55:04 +0000 (19:55 +0000)]
Merge "Make SDP and inquiry request dequeue and execute more comprehensive and cancelDiscovery now removes all queued inquiry requests." into sc-qpr1-dev am: b59afca466

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

Change-Id: Ib968d93a142e069c376a089143998e3ccd735833

2 years agoMerge "Make SDP and inquiry request dequeue and execute more comprehensive and cancel...
TreeHugger Robot [Fri, 24 Sep 2021 19:43:50 +0000 (19:43 +0000)]
Merge "Make SDP and inquiry request dequeue and execute more comprehensive and cancelDiscovery now removes all queued inquiry requests." into sc-qpr1-dev

2 years agoMake SDP and inquiry request dequeue and execute more comprehensive and
Rahul Sabnis [Thu, 16 Sep 2021 21:43:40 +0000 (14:43 -0700)]
Make SDP and inquiry request dequeue and execute more comprehensive and
cancelDiscovery now removes all queued inquiry requests.

Ignore-AOSP-First: Submitting for QPR1 & fix needs to be reworked for AOSP
Tag: #feature
Bug: 198178836
Test: Manual
Merged-In: I7b9fc60f090e507c9905ed98c8d2c82d0a9a1fd2
Change-Id: I7b9fc60f090e507c9905ed98c8d2c82d0a9a1fd2

2 years agoMerge "Ensure proper hci le meta event length size" into sc-qpr1-dev am: ffece973f3
Chris Manton [Fri, 24 Sep 2021 00:27:09 +0000 (00:27 +0000)]
Merge "Ensure proper hci le meta event length size" into sc-qpr1-dev am: ffece973f3

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

Change-Id: I38e95f9e6e22079d2350c0e2d00a9d18402896cd

2 years agoMerge "Ensure proper hci le meta event length size" into sc-qpr1-dev
Chris Manton [Fri, 24 Sep 2021 00:12:29 +0000 (00:12 +0000)]
Merge "Ensure proper hci le meta event length size" into sc-qpr1-dev

2 years agoEnsure proper hci le meta event length size
Chris Manton [Tue, 21 Sep 2021 21:55:36 +0000 (14:55 -0700)]
Ensure proper hci le meta event length size

Bug: 167759047
Test: gd/cert/run
Tag: #security
Ignore-AOSP-First: Security
Change-Id: I753b12ec123e28d94c6f362c28ff9f2774ec4445

2 years agoAdd missing return and test for volume check am: 58d268fedb
Ted Wang [Thu, 23 Sep 2021 02:47:19 +0000 (02:47 +0000)]
Add missing return and test for volume check am: 58d268fedb

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

Change-Id: Ifd4380523879804d6f0c679effaf8e893ef9bf0c

2 years agoAdd missing return and test for volume check
Ted Wang [Wed, 22 Sep 2021 07:53:22 +0000 (15:53 +0800)]
Add missing return and test for volume check

feature: #stability
Bug: 167648114
Test: atest net_test_avrcp
Change-Id: I6dce4c7afb78a93dca8ba7fcbd02aa5350f18c1a
Merged-In: I6dce4c7afb78a93dca8ba7fcbd02aa5350f18c1a

2 years agoEnsure proper hci le meta event length size
Chris Manton [Tue, 21 Sep 2021 21:55:36 +0000 (14:55 -0700)]
Ensure proper hci le meta event length size

Bug: 167759047
Test: gd/cert/run
Tag: #security
Ignore-AOSP-First: Security
Change-Id: I753b12ec123e28d94c6f362c28ff9f2774ec4445

2 years agoMerge "Update AVRCP default version to 1.5" into sc-qpr1-dev am: aa5cc0d58f
TreeHugger Robot [Tue, 21 Sep 2021 18:15:38 +0000 (18:15 +0000)]
Merge "Update AVRCP default version to 1.5" into sc-qpr1-dev am: aa5cc0d58f

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

Change-Id: I0e905a2e07d613d3accbab6dc86e5c41158fb513

2 years agoAvoiding sending set volume to volume level same as current volume level am: f1fb497a85
Ted Wang [Tue, 21 Sep 2021 18:14:59 +0000 (18:14 +0000)]
Avoiding sending set volume to volume level same as current volume level am: f1fb497a85

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

Change-Id: I2e4563510db9ea98582d7406b567314c172685f1

2 years agoMerge "Update AVRCP default version to 1.5" into sc-qpr1-dev
TreeHugger Robot [Tue, 21 Sep 2021 18:04:22 +0000 (18:04 +0000)]
Merge "Update AVRCP default version to 1.5" into sc-qpr1-dev

2 years agoAvoiding sending set volume to volume level same as current volume level
Ted Wang [Tue, 14 Sep 2021 03:39:28 +0000 (11:39 +0800)]
Avoiding sending set volume to volume level same as current volume level

feature: #stability
Bug: 167648114
Test: Manul
Change-Id: Ifc5e4bfff5c1d1749037fb19f74e2f9c4172bc42
Merged-In: Ifc5e4bfff5c1d1749037fb19f74e2f9c4172bc42

2 years agoUpdate AVRCP default version to 1.5
Ted Wang [Thu, 16 Sep 2021 02:34:20 +0000 (10:34 +0800)]
Update AVRCP default version to 1.5

Bug: 190553009
Bug: 190462248
Test: make; Check sdp record
Change-Id: I079edc35f7733f8dd63c4577b72be1320a3de499
Merged-In: I079edc35f7733f8dd63c4577b72be1320a3de499

2 years agoDeclare h4_packetizer_lib
Jeongik Cha [Tue, 31 Aug 2021 08:00:42 +0000 (17:00 +0900)]
Declare h4_packetizer_lib

Using include_dir in the other path causes modularity to weaken.
So declare the module instead of filegroup for h4 h4_packetizer_lib.

Bug: 195692688
Test: check bt feature in cf, and log
Change-Id: I71dfd93abefae88a5a0439e7204d7583e282aeba
Merged-In: I71dfd93abefae88a5a0439e7204d7583e282aeba

2 years agoAdd H4PacketizerSources filegroup
Jeongik Cha [Tue, 10 Aug 2021 15:12:33 +0000 (00:12 +0900)]
Add H4PacketizerSources filegroup

bt_vhci_forwarder in cuttlefish doesn't need to full implementation of
rootcanal, it needs only h4 packetizer implementation.

Bug: 195692688
Test: launch_cvd and then check bluetooth feature in cf.
Change-Id: I25aa5f1a2e815703de3beb59ffebf148309baec6
Merged-In: I25aa5f1a2e815703de3beb59ffebf148309baec6

2 years agoSeparate H4 packet parsing from data retrieval.
Erwin Jansen [Thu, 1 Jul 2021 08:13:15 +0000 (10:13 +0200)]
Separate H4 packet parsing from data retrieval.

We are in the process of migrating Rootcanal to support various
architectures as well as different data channels.

For this reason we separate the H4 packetizer into a packet parser and
a packetizer that reads/writes packets from a file descriptor.

This will make it possible to use the H4 protcol with different data
channels that are not based on file descriptors (Qemu/gRPC/Windows)

Bug: 180759795
Test: Run unit tests to validate the parser.
Change-Id: I3a8f24197fed953b86d228f0bc2e793249323a62
Merged-In: I3a8f24197fed953b86d228f0bc2e793249323a62

2 years agoMerge "GATT: Fix data length parameter" into sc-qpr1-dev am: 43cf5f2749
TreeHugger Robot [Thu, 9 Sep 2021 18:08:49 +0000 (18:08 +0000)]
Merge "GATT: Fix data length parameter" into sc-qpr1-dev am: 43cf5f2749

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

Change-Id: I2c592a2619f33bef3d317e1e7d4c7c13caf2cf89

2 years agoMerge "GATT: Fix data length parameter" into sc-qpr1-dev
TreeHugger Robot [Thu, 9 Sep 2021 17:50:22 +0000 (17:50 +0000)]
Merge "GATT: Fix data length parameter" into sc-qpr1-dev

2 years agoGATT: Fix data length parameter
Hansong Zhang [Wed, 8 Sep 2021 17:15:34 +0000 (10:15 -0700)]
GATT: Fix data length parameter

Should also account for L2CAP header size (4)

Bug: 199009840
Tag: #feature
Test: NRF connect
Change-Id: I6b51a8ef046d81836a4ca4850d052b68e0f4dd46

2 years agoSecurity Fix: Crafted GATT request causes BT stack crash am: 1da56d1c81 am: 372e753179
Martin Brabham [Fri, 3 Sep 2021 19:03:12 +0000 (19:03 +0000)]
Security Fix: Crafted GATT request causes BT stack crash am: 1da56d1c81 am: 372e753179

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

Change-Id: I4577f2518fa2e2ad18d5dc3e1041991c4e27f3d5

2 years agoSecurity Fix: Crafted GATT request causes BT stack crash am: 1da56d1c81
Martin Brabham [Fri, 3 Sep 2021 18:50:35 +0000 (18:50 +0000)]
Security Fix: Crafted GATT request causes BT stack crash am: 1da56d1c81

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

Change-Id: Ifacad9537f67f1d6525203d8799479bf868db6de

2 years agoMerge "Fix nullptr in btif_hf_client" into sc-qpr1-dev am: da1eb4647c
TreeHugger Robot [Wed, 1 Sep 2021 17:20:06 +0000 (17:20 +0000)]
Merge "Fix nullptr in btif_hf_client" into sc-qpr1-dev am: da1eb4647c

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

Change-Id: I7ccfd37a0d2a7e6e6731796df1241223bca31d09

2 years agoMerge "Fix nullptr in btif_hf_client" into sc-qpr1-dev
TreeHugger Robot [Wed, 1 Sep 2021 17:06:32 +0000 (17:06 +0000)]
Merge "Fix nullptr in btif_hf_client" into sc-qpr1-dev

2 years agoSecurity Fix: Crafted GATT request causes BT stack crash
Martin Brabham [Mon, 30 Aug 2021 22:23:04 +0000 (15:23 -0700)]
Security Fix: Crafted GATT request causes BT stack crash

A while loop and condition check for the value of a type to be 0
when in fact since the value.len is arbitrary it could make the
remaining length "less than 0" and since the type is unsigned it'll
never be "less than 0."

Use signed type for loop and conditional checking.

Additionally, make sure the value.len when used to read an array is not
more than the remaining length of the data.

Bug: 197536150
Test: poc application
Tag: #security
Change-Id: I20d66ddd1055577d7d39aba447233c19081bb789

3 years agohci_metrics_logging: check command before ASSERT(complete_view.IsValid()) am: 9a2a42e4e6
Chen Chen [Thu, 26 Aug 2021 21:00:06 +0000 (21:00 +0000)]
hci_metrics_logging: check command before ASSERT(complete_view.IsValid()) am: 9a2a42e4e6

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

Change-Id: Ia57354655934bc0f7bb221f8d0514d8f2f1a7d6b

3 years agohci_metrics_logging: check command before ASSERT(complete_view.IsValid())
Chen Chen [Thu, 29 Jul 2021 23:02:37 +0000 (16:02 -0700)]
hci_metrics_logging: check command before ASSERT(complete_view.IsValid())

Bug: 193220499
Test: build
aosp/1780738
Change-Id: I1ef1ac1582d8d1c2800eb2c3e5e79763e0403714
Merged-In: I1ef1ac1582d8d1c2800eb2c3e5e79763e0403714
(cherry picked from commit fe82cc9434862623599b439855fb907641357f87)

3 years agoUpdate default page scan parameters am: d2b3f0a1c6
Hansong Zhang [Fri, 20 Aug 2021 01:49:28 +0000 (01:49 +0000)]
Update default page scan parameters am: d2b3f0a1c6

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

Change-Id: Ib6ac46411ece2a97dbc4350d9f71c150ddd240e7

3 years agoUpdate default page scan parameters
Hansong Zhang [Mon, 16 Aug 2021 20:10:12 +0000 (13:10 -0700)]
Update default page scan parameters

Set BTM_DEFAULT_CONN_WINDOW/INTERVAL from 11.25ms/1280ms to
11.25ms/640ms which is a known sweet spot.

Test: check new page scan parameters
Bug: 196815018
Tag: #refactor
Ignore-AOSP-First: Already merged in AOSP
Merged-In: I730b12b44dbb0c36a5dc4e4984cc1920b7c1c490
Change-Id: Iac87c23625f5fdf7b66a3e96c98f2be49c482fae

3 years agoFix nullptr in btif_hf_client
Hansong Zhang [Tue, 17 Aug 2021 19:11:05 +0000 (12:11 -0700)]
Fix nullptr in btif_hf_client

When cb is nullptr, this can cause a crash in lines below.

Test: manual
Bug: 180420059
Tag: #security
Change-Id: I09156852f6a99315bf4aebf948efee21a7bcfa1c

3 years agoMerge "Stop inquiry when inquiry cancelled" into sc-dev am: adf74bc915 am: 9cbaddfea9
TreeHugger Robot [Fri, 13 Aug 2021 18:16:58 +0000 (18:16 +0000)]
Merge "Stop inquiry when inquiry cancelled" into sc-dev am: adf74bc915 am: 9cbaddfea9

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

Change-Id: Ie0ee87ea713cd4a49a2f61c8e127b20f383af40f

3 years agoMerge "Stop inquiry when inquiry cancelled" into sc-dev am: adf74bc915
TreeHugger Robot [Fri, 13 Aug 2021 18:01:51 +0000 (18:01 +0000)]
Merge "Stop inquiry when inquiry cancelled" into sc-dev am: adf74bc915

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

Change-Id: Id185d89ce382234b4a4f8bdf504fc12d64b32a26

3 years agoMerge "Stop inquiry when inquiry cancelled" into sc-dev
TreeHugger Robot [Fri, 13 Aug 2021 17:50:37 +0000 (17:50 +0000)]
Merge "Stop inquiry when inquiry cancelled" into sc-dev

3 years agoBluetoothAudioHAL: reset A2DP pending command while ending the session am: 7f79977fcf...
Cheney Ni [Thu, 12 Aug 2021 02:41:15 +0000 (02:41 +0000)]
BluetoothAudioHAL: reset A2DP pending command while ending the session am: 7f79977fcf am: 42710a544f

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

Change-Id: I43afe31a5d335daf759838305bc8a8a210a3d8f9

3 years agoBluetoothAudioHAL: reset A2DP pending command while ending the session am: 7f79977fcf
Cheney Ni [Thu, 12 Aug 2021 02:25:46 +0000 (02:25 +0000)]
BluetoothAudioHAL: reset A2DP pending command while ending the session am: 7f79977fcf

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

Change-Id: I41424dee81442b5f7a7dbdcfcda4c87ea0c3d50c

3 years agoBluetoothAudioHAL: reset A2DP pending command while ending the session
Cheney Ni [Mon, 9 Aug 2021 11:15:20 +0000 (19:15 +0800)]
BluetoothAudioHAL: reset A2DP pending command while ending the session

Bug: 175425864
Tag: #compatibility
Test: Switch A2DP active device manually
Ignore-AOSP-First: cherry-pick from aosp to upstream branch
Change-Id: Icf29d8e5c557c927bffe9d49188bd0cf98b07120

3 years agoStop inquiry when inquiry cancelled
IHLHO KIM [Tue, 3 Aug 2021 04:38:27 +0000 (04:38 +0000)]
Stop inquiry when inquiry cancelled

Inquiry is not stopped cause of clearing of BTM_BLE_INQUIRY_MASK.
This issue came from the follwing patch.
https://android-review.googlesource.com/c/platform/system/bt/+/1402183

Bug: 195908804
Change-Id: I3361c924c9445d6aae2856f41b732fca22951f76
Tag: #refactor
Ignore-AOSP-First: cherry-pick from aosp to upstream branch
Test: compile & verify basic functions working

3 years agoMerge "Disable sniff for KDDI carkit" into sc-dev am: 940c572878
TreeHugger Robot [Fri, 6 Aug 2021 16:24:22 +0000 (16:24 +0000)]
Merge "Disable sniff for KDDI carkit" into sc-dev am: 940c572878

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

Change-Id: Ieb440a998c4cd5243d13ed10d498a1a89a402097

3 years agoMerge "Disable sniff for KDDI carkit" into sc-dev
TreeHugger Robot [Fri, 6 Aug 2021 16:06:29 +0000 (16:06 +0000)]
Merge "Disable sniff for KDDI carkit" into sc-dev

3 years agoDisable sniff for KDDI carkit
Patty [Fri, 6 Aug 2021 04:08:00 +0000 (12:08 +0800)]
Disable sniff for KDDI carkit

When sniff is enabled, KDDI car kit may disconnect the ACL connection when SCO connection disconnect.

Tag: #compatibility
Bug: 194029299
Test: 1) Connect with KDDI car kit
      2) Check Write Link Policy Command, enable sniff mode should be false
Change-Id: I597684cc2dc709167a789e2a1de3866bf9aab872

3 years agoDisable sniff mode when AVDTP start am: d50116d306
Ted Wang [Thu, 5 Aug 2021 20:20:01 +0000 (20:20 +0000)]
Disable sniff mode when AVDTP start am: d50116d306

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

Change-Id: Ia7f64d56530e97704a4dec8f3398cc403ef32458

3 years agoDisable sniff mode when AVDTP start
Ted Wang [Tue, 3 Aug 2021 07:27:25 +0000 (15:27 +0800)]
Disable sniff mode when AVDTP start

To avoid ACL link go into sniff mode during a2dp streaming by remote
request, disable sniff mode by link policy when AVDTP start, and
enable when AVDTP suspend, stop or disconnect.

Tag: #compatibility
Bug: 193206591
Test: audio resume after MO/MT call
Change-Id: I0af3223e0722b0343e8d091985e3e23606104268
Merged-In: I0af3223e0722b0343e8d091985e3e23606104268

3 years agoMerge "Also remove entry during delete in addition to clear" into sc-dev am: b66647c837
Martin Brabham [Fri, 30 Jul 2021 19:01:25 +0000 (19:01 +0000)]
Merge "Also remove entry during delete in addition to clear" into sc-dev am: b66647c837

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

Change-Id: I16607b7557614c27627942707f2d15072fb7e000

3 years agoMerge "Also remove entry during delete in addition to clear" into sc-dev
Martin Brabham [Fri, 30 Jul 2021 18:57:19 +0000 (18:57 +0000)]
Merge "Also remove entry during delete in addition to clear" into sc-dev

3 years agoMerge "Reduce shutdown BTA_DM_DISABLE_TIMER_MS from 5000ms to 2000ms" into sc-dev...
TreeHugger Robot [Fri, 30 Jul 2021 17:20:34 +0000 (17:20 +0000)]
Merge "Reduce shutdown BTA_DM_DISABLE_TIMER_MS from 5000ms to 2000ms" into sc-dev am: 84e27dd770

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

Change-Id: I21329c0a29ca4cfdee692fc1ea147cc613dc7d2e

3 years agoMerge "Reduce shutdown BTA_DM_DISABLE_TIMER_MS from 5000ms to 2000ms" into sc-dev
TreeHugger Robot [Fri, 30 Jul 2021 17:07:18 +0000 (17:07 +0000)]
Merge "Reduce shutdown BTA_DM_DISABLE_TIMER_MS from 5000ms to 2000ms" into sc-dev

3 years agoAlso remove entry during delete in addition to clear
Martin Brabham [Thu, 29 Jul 2021 00:48:18 +0000 (17:48 -0700)]
Also remove entry during delete in addition to clear

Bug: 194432570
Test: Manual test app; nRF connect
Tag: #feature
Change-Id: I17a1a8b1ba2b305527ae74bb8ad5f6e1258e870e
Merged-In: I17a1a8b1ba2b305527ae74bb8ad5f6e1258e870e