summaryrefslogtreecommitdiff
path: root/system/stack/hid
AgeCommit message (Collapse)Author
2025-03-13stack: Inline methods from stack_metrics_logging.h Henri Chataing
Bug: 401588157 Test: m com.android.bt Flag: EXEMPT, no logical change Change-Id: I1cf4a5e3664f4afc3eb2cfebbf23642c568403a4
2025-02-26Merge "HID Host: Reset conn state if failed to disconnect" into main am: ↵ Treehugger Robot
8aefe5767c am: 5dd5cc6f82 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3509391 Change-Id: I828b226530d58ca5627170189662ce85626c6b59 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-26HID Host: Reset conn state if failed to disconnect Archie Pusaka
It's possible for the ctrl_cid to be populated even though no l2cap connect has been issued. When the baseband connection is disconnected under this situation, we still send L2CAP DisconnectReq but it will fail and we won't get a response. Call the response callback in this case. Bug: 344778226 Bug: 387937345 Test: m -j Test: Connect a classic HID device, then toggle the "Input" selection on the device details page. Verify device is still connectable. Flag: com.android.bluetooth.flags.disconnect_hid_channels_serially Change-Id: I97ca0d6f6fbf6a6ed773c3d68ea037352758e839
2025-01-07Merge "HID: disconnect control/interrupt channel serially" into main am: ↵ Himanshu Rawat
85383b055b am: f7bc01064e Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3382047 Change-Id: Ia11e898afc1227c2b9e0e8ef19960ad28526e691 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-01-07HID: disconnect control/interrupt channel serially Archie Pusaka
According to the BT spec, we need to disconnect the interrupt channel first, and then the control channel. Sometimes the PTS might complain if we just disconnect these two channels in parallel. Bug: 344778226 Bug: 387937345 Test: m -j Test: Run PTS HID/HOS/HCR/BV-04-C Flag: com.android.bluetooth.flags.disconnect_hid_channels_serially Change-Id: I2762102c799541483d0f32e707161575c9480166
2024-12-16Merge "system: Convert base::StringPrintf to std::format" into main am: ↵ Henri Chataing
8c74fcfb8b am: b99dcfa40f Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3407745 Change-Id: I3204b9b49e3e1fb088d73d3af325876f62b9d2bd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-12system: Convert base::StringPrintf to std::format Henri Chataing
Bug: 331817295 Test: m com.android.btservices Flag: EXEMPT, mechanical refactor Change-Id: Ib6933af3c28a1d429ea0cb6e3eae05b53fc9f2b4
2024-12-02Merge "system/stack/*: Fix -Wmissing-prototypes warnings" into main am: ↵ Treehugger Robot
cfea2a3d70 am: c0e7dfc66f Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3381253 Change-Id: If2c1a2c97e653b26e3d802ba741d13bf4cae7507 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-27system/stack/*: Fix -Wmissing-prototypes warnings Henri Chataing
Bug: 369381361 Test: m com.android.btservices Flag: EXEMPT, no logical change Change-Id: Idefcf4bb07451c40113689cda7815d486620ff35
2024-11-21Merge "system: Migrate from {fmt} to std::format" into main am: 3723874896 ↵ Henri Chataing
am: 648e440e0d Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3345590 Change-Id: I803c2c60053beaf4439a7090b0daa8dd0c7cfba4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-20system: Migrate from {fmt} to std::format Henri Chataing
Bug: 305066880 Test: m com.android.btservices Flag: EXEMPT, log change Change-Id: If1dbab99250a4f62626206fc9f73d27e71ebab56
2024-11-14Merge "Fix floss build breakage "bt_transport.h" not found" into main am: ↵ Treehugger Robot
231e391f9b am: d5cf9b98bf Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3341202 Change-Id: I4131ee6eed451ca9ff4abe8ada87af767833eae9 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-13Fix floss build breakage "bt_transport.h" not found Hsin-chen Chuang
The include statement was added by https://r.android.com/3343104 but not being changed by https://r.android.com/3344385. Bug: 369703686 Test: mmm packages/modules/Bluetooth Test: ./build-in-container.py Test: USE=floss_upstream emerge-brya floss Flag: EXEMPT, no logical change Change-Id: I8e37861cb2bbc85a8598e242c58f21c08a8637d4
2024-11-12Merge "system/stack: Apply clang-tidy fixes" into main am: 4b50815e76 am: ↵ Henri Chataing
75b5079fe5 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3343104 Change-Id: Ie265e7738dbca1771bae0b817b2a70bdfcf8ab32 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-12Merge "system/stack: Apply clang-tidy fixes" into main Henri Chataing
2024-11-11Merge changes I8175344d,Ic26c9b03 into main am: d02482c2e7 am: a87ab740f4 William Escande
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3342085 Change-Id: I12c07b90ff6eec89405aabf31767115377e60d3e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-11system/stack: Apply clang-tidy fixes Henri Chataing
Bug: 374984156 Test: m com.android.btservices Flag: EXEMPT, no logical change Change-Id: I5bb14ad304658e74ea21d6e350a4eee96d5c5725
2024-11-09Merge "cpplint: fix and enable whitespace/newline" into main am: f61b8aba89 ↵ Treehugger Robot
am: 8d986fa23a Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3341000 Change-Id: I4ab13eaa0dec9cc31e15e9d44e2709789f2c569e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-08cpplint: fix and enable whitespace/blank_line William Escande
Bug: 364967694 Test: m . Flag: Exempt refactor Change-Id: Ic26c9b0305b76f66a461a4449845a8ca10726c36
2024-11-08cpplint: fix and enable whitespace/newline William Escande
Done with a combination of: sed -i 'N;s|\(^ *// .*\)\n\( *else.*\)|\2\n\1|;P;D' $i sed -i 'N;s|\(^ */\* .*\)\n\( *else.*\)|\2\n\1|;P;D' $i sed -i 'N;s|\(^ */\*\* .*\)\n\( *else.*\)|\2\n\1|;P;D' $i sed -i 'N;s|\(^ *\* .*\)\n\( *else.*\)|\2\n\1|;P;D' $i + repo upload formatter Bug: 364967694 Test: m . Flag: Exempt refactor Change-Id: Ie1af09932f2508da5ed94c625b8c4052ab2c1e78
2024-11-06Fix more memory-unsafe logging Brian Delwiche
In various locations around the stack, log statements use structures that may, in exceptional cases, have been freed by preceding calls. This can lead to use after free and potentially to security vulnerabilities. Use local variables instead, or store the length before the call if no local variable is already convenient. Bug: 375404242 Bug: 375398779 Bug: 375397720 Bug: 375397164 Bug: 375397370 Bug: 375396810 Bug: 375159652 Bug: 375160214 Bug: 375159480 Test: m libbluetooth Test: researcher POC Flag: EXEMPT trivial logic fix Ignore-AOSP-First: security Tag: #security Change-Id: Ia50e074de751661a0e617bfffa17871497b8d1ea
2024-10-17Remove os/log.h Henri Chataing
The logging macros within have long been removed, this is just cleanup work to inline the included headers where necessary Bug: 331817295 Test: m com.android.btservices Flag: EXEMPT, no logical change Change-Id: I2147ce4bdcea977b92318b2cb96e7020a8958161
2024-09-25Enforce -Wmissing-prototypes Henri Chataing
This lint check will raise an error if a function is implemented without a corresponding prototype declaration included in scope. The main use case will be to ensure mock functions do not become out of sync causing the original function to be linked instead. Because of the large amount of errors, this change suppresses errors in all locations, to be cleaned up gradually. Bug: 369381361 Test: m com.android.btservices Flag: EXEMPT, lint fixes Change-Id: I888b5e284e237d8a6e2864bdde55c0a7fc0c348d
2024-09-12Use SDP size in next byte for small Report descriptors Joshua Stalder
When the length of the Report descriptor for HIDD is below 256 bytes but the length in its SDP attribute is specified with SIZE_IN_NEXT_WORD, MS Windows no longer correctly accepts the HIDD connection. To retain compatibility with existing apps and Windows releases, we can use SIZE_IN_NEXT_BYTE if possible based on the descriptor size, which works around the issue. Bug: 362791956 Test: manually Change-Id: I5f13aa571cd373876d1cf94c3ac4f7d5facd9a53
2024-09-11[25/25] stack::l2cap encapsulate l2c_api.h Chris Manton
Bug: 343808590 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I73cdcd8ce5f46db78958782fd2568e2a3f126583
2024-09-10[19/25] stack::hid Use stack::l2cap::get_interface() Chris Manton
Bug: 343808590 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Ifae14f298293e3cecbf8b7acc9e9a3a30f98364e
2024-09-04Merge "Correct SDP data element size descriptor for HIDD report descriptor" ↵ Jakub Pawłowski
into main
2024-09-02Correct SDP data element size descriptor for HIDD report descriptor Joshua Stalder
The length of the Report descriptor for HIDD is a unit16_t and limited by the API to 2048 bytes, is however written as an SDP data element with SIZE_IN_NEXT_BYTE, which leads to the element size being at most 255 bytes. The descriptor however is written fully to the SDP stream. By using SIZE_IN_NEXT_WORD, we can accommodate for maximum size of 2048 bytes, which resolves these issues. Bug: 362791956 Change-Id: Ie65e79d395c9f1db3adc0fef917a6c8db16bbe29 Test: manually
2024-08-30stack::l2cap class enum-ify tL2CAP_CONN Chris Manton
Bug: 363111728 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I939f82f7d4d18e5419e14140057dfff6e09a6e7a
2024-08-27stack::l2cap class enum-ify tL2CAP_CFG_RESULT Chris Manton
Bug: 361948635 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Idc3ddcadaca7ba184b6da389bde13d2d44c0863b
2024-08-09libbt-stack: Remove warning no-unused-parameter Chris Manton
Bug: 358475437 Test: m . Flag: EXEMPT, Unused parameters Change-Id: Ifc47f682fe4bb524cc98ab7d20dced0bd03c38ff
2024-08-07stack::sdp Class enum-ify tSDP_STATUS Chris Manton
Bug: 358146225 Test: m . Flag: EXEMPT, Class Enumification Change-Id: Ifbdd4157dfbe269a17105db8701a371d010da610
2024-07-31Allow multiple service discoveries in HID Himanshu Rawat
BTA HID host maintains a common SDP database instance for all connections. This means that only one connection attempt can be made a time. This change makes the SDP database instance a part of connection control block and uses returned address to find the relevant connection control block. Test: mmm packages/modules/Bluetooth Test: Manual | Change preferred HID transport on pairing with earbuds supporting both DSA 1.0 and DSA 2.0 Flag: EXEMPT bugfix Bug: 347241319 Change-Id: Ie9c1eebb6ced858ea7781e8536a4f3a83cd40724
2024-07-21mock: [29/63] Remove BTM_IsAclConnectionUp Chris Manton
Use get_btm_client_interface() instead Bug: 352129816 Test: m . Flag: EXEMPT, Test infrastructure Change-Id: I9660f96b8030c90194ed8f79e5e802a24f04b716
2024-07-07Format: apply clang rules William Escande
Restore SpacesBeforeTrailingComments to 2 to match current style Then run clang-format -i **/**.{c,h,cc,cpp,hpp} Then fix a bunch of typo (reported by gerrit) Then fix unnecessary multiline string Then fix whitespace for disabled clang format (reported by cpplint) This is no-op Bug: 311772251 Test: mmm packages/modules/Bluetooth Flag: Exempt Format only Change-Id: If135447803a40a2a07d4630ba2195e08ef8d250c
2024-06-19Streamline enum stack::l2cap::tL2CAP_DW_RESULT Chris Manton
Bug: 344992630 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I58c45c5c40e155e0e4c5b6bb3bc50333ca798037
2024-06-17Class-enumify stack::l2cap::tL2CAP_DW_RESULT Chris Manton
Bug: 344991872 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I925537804979745d42b47d081130817097322ba6
2024-06-17Use proper types stack::l2cap::tL2CAP_DW_RESULT Chris Manton
Bug: 344989901 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Ic904eeea4b4a45c1fa8f1c2a99c14177847ea204
2024-05-31stack::l2cap: Properly name L2CA_Register2 => L2CA_RegisterWithSecurity Chris Manton
Bug: 343941946 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I7414241506c78067200c94d27dc9fd1aad4ed062
2024-05-31stack::l2cap: Properly name L2CA_ConnectReq2 => L2CA_ConnectReqWithSecurity Chris Manton
Bug: 343941099 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I48f35c123e9cd4ccfa26a2bd172720766778afef
2024-05-21stack::l2cap [15/19] L2CA_SetIdleTimeoutByBdAddr Chris Manton
Bug: 339732512 Test: m . Flag: EXEMPT, Logging Change Change-Id: I95e5d9844e81e3f787278043650579bceff1beeb
2024-05-21stack::l2cap [2/19] L2CA_DataWrite Chris Manton
Bug: 339732512 Test: m . Flag: EXEMPT, Logging Change Change-Id: Ida920d0a1a5abbcabc30c551e65fda5ccb6b1b18
2024-05-17stack::l2cap [4/19] L2CA_DisconnectReq Chris Manton
Bug: 339732512 Test: m . Flag: EXEMPT, Logging Change Change-Id: Idc4822540f314d793879c7ee5006ed0565ae70b6
2024-05-13stack::sdp [1/12] service.SDP_InitDiscoveryDb Chris Manton
Bug: 339311914 Test: m . Flag: EXEMPT, Logging Change Change-Id: I40991b63d6241760d18a3dd64fc15bacf622d33a
2024-05-11IWYU: stack/include/l2cdefs.h Chris Manton
Bug: 339736332 Test: m . Flag: EXEMPT, IWYU Change-Id: I259fff959f69059982eb5be40672cffd44e39d46
2024-05-09stack::sdp Ensure return value failures are logged Chris Manton
Bug: 339288758 Test: m . Flag: EXEMPT, Logging Change Change-Id: I293a38ae5244dda0dc71d9352465c8ef496db544
2024-04-26Merge "system/stack: Remove UNUSED_ATTR" into main Myles Watson
2024-04-24system/stack: Remove UNUSED_ATTR Myles Watson
Comment out unused parameters to have the compiler check that they're unused. Bug: 336310650 Test: mma -j32 Flag: EXEMPT, mechanical refactor Change-Id: I55368273d61a24815dc16a5584994cb1dce15534
2024-04-24system: Strip unnecessary () around fmt arguments Henri Chataing
Test: m com.android.btservices Bug: 305066880 Flag: EXEMPT, mechanical refactor Change-Id: I020564e4975bdcf6a23f70e7e0f789ddeddc3cbc
2024-04-19Merge "system: Remove include directives for <stdio.h>" into main Henri Chataing