OSDN Git Service
Chris Manton [Wed, 30 Sep 2020 04:26:24 +0000 (21:26 -0700)]
L2cap CoC callback use Confirm not Ind on server
Confirm is nullptr on L2cap connect-only-services
Bug:
169725013
Test: act.py -tc BleCocTest
Tag: #refactor
Change-Id: I5c87923a2b721c3d5b87d52969552382a5b1d633
Dan Shi [Tue, 29 Sep 2020 23:31:48 +0000 (16:31 -0700)]
Remove net_test_bta from TEST_MAPPING file
The test is device only test.
Bug:
169705178
Test: none
Change-Id: I19b6fdf5ff5e197380f5406563903f685e7a3d78
Treehugger Robot [Tue, 29 Sep 2020 18:46:09 +0000 (18:46 +0000)]
Merge changes Iefb88b7e,Ia8fd678c,Ieefd35fa,Ib474f0be,I16606384, ...
* changes:
Re-log btif/src/btif_dm::btif_dm_cancel_discovery
Re-log btif/src/btif_dm::btif_dm_search_services_evt
Re-log btif/src/btif_dm::btif_update_remote_properties
Re-log btif/src/btif_dm::bond_state_changed
Re-log btif/src/btif_core::btif_enable_bluetooth_evt
Re-log btif_get____type
Log proper btif/src/btif_bqr::ConfigureBqr
Re-log btif/src/btif_av::btif_av_get_peer_sep
Re-log btif/src/btif_a2dp::btif_a2dp_on_idle
Restore Le transport for SetPhy function
Treehugger Robot [Tue, 29 Sep 2020 17:31:58 +0000 (17:31 +0000)]
Merge "Reject SetBrowsedPlayer if there is not browsable player"
Hansong Zhang [Tue, 29 Sep 2020 04:56:13 +0000 (21:56 -0700)]
L2cap shim: Add mtu requirement to config option
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ib0da747b905df5edfc1f03518a565f1ed914a148
Alain Vongsouvanh [Tue, 29 Sep 2020 17:00:02 +0000 (17:00 +0000)]
Merge "GAP: Support 128-bit custom UUID in EIR record"
Chris Manton [Thu, 24 Sep 2020 18:11:17 +0000 (11:11 -0700)]
Re-log btif/src/btif_dm::btif_dm_cancel_discovery
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Iefb88b7ec327e34ab37efa95b85c348b237928a3
Chris Manton [Thu, 24 Sep 2020 18:10:07 +0000 (11:10 -0700)]
Re-log btif/src/btif_dm::btif_dm_search_services_evt
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Ia8fd678c45b26606b913bfcea632fc570f56d127
Chris Manton [Thu, 24 Sep 2020 18:06:29 +0000 (11:06 -0700)]
Re-log btif/src/btif_dm::btif_update_remote_properties
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Ieefd35faee11881a178000e755d2d7fa575f8632
Chris Manton [Thu, 24 Sep 2020 18:03:05 +0000 (11:03 -0700)]
Re-log btif/src/btif_dm::bond_state_changed
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Ib474f0be03be451c3a5c14242c1fb9c4c8e97d3c
Chris Manton [Thu, 24 Sep 2020 18:01:59 +0000 (11:01 -0700)]
Re-log btif/src/btif_core::btif_enable_bluetooth_evt
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I16606384fa2580fe372aa852cc4b7f0f606cd484
Chris Manton [Thu, 24 Sep 2020 17:58:38 +0000 (10:58 -0700)]
Re-log btif_get____type
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Ie3d53b527b0938dc76763d5106afe5deb02601cc
Chris Manton [Thu, 24 Sep 2020 17:57:39 +0000 (10:57 -0700)]
Log proper btif/src/btif_bqr::ConfigureBqr
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I56d3b55cbf6eee6b55cfa66f718451dae3aee1db
Chris Manton [Thu, 24 Sep 2020 17:56:31 +0000 (10:56 -0700)]
Re-log btif/src/btif_av::btif_av_get_peer_sep
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Ieac7e5a6c0545a9de9296b4b6081e86cf0c986a7
Chris Manton [Thu, 24 Sep 2020 17:54:11 +0000 (10:54 -0700)]
Re-log btif/src/btif_a2dp::btif_a2dp_on_idle
Towards loggable code
Bug:
163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I4e2ed9eb46823b70d0c7d066c1df555ef8483742
Chris Manton [Fri, 25 Sep 2020 19:53:32 +0000 (12:53 -0700)]
Restore Le transport for SetPhy function
Bug:
163134718
Tag: #refactor
Test: ble paired 2 phones
Test: act.py -tc BleCocTest
Change-Id: I5952932176fdd1392142eb3a3df9e2f4f0e94dab
Hansong Zhang [Mon, 28 Sep 2020 23:11:45 +0000 (16:11 -0700)]
GD L2cap: Add a way to enforce required mtu
Test: cert/run --host
Tag: #gd-refactor
Bug:
141555841
Change-Id: Iefe65f3105ced94a9e653d82a59e550687765df2
Hansong Zhang [Mon, 28 Sep 2020 22:38:47 +0000 (15:38 -0700)]
GAP_ConnOpen code minor clean up
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0ecb38538aae423a1232676004a3a7b85d628bcd
Hansong Zhang [Mon, 28 Sep 2020 20:15:10 +0000 (13:15 -0700)]
LE COC: Indicate channel open on ConnectRsp recv
Also don't auto send ConnectRsp for LE. Need to clean up config.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4e148d0d0d6597ef8d1d9115db8c8ba6f92a1b8e
Treehugger Robot [Tue, 29 Sep 2020 00:49:15 +0000 (00:49 +0000)]
Merge "Call EXPECT_CALL before the incoming event"
Treehugger Robot [Tue, 29 Sep 2020 00:00:20 +0000 (00:00 +0000)]
Merge "SM: Implement name request during Classic pairing"
Martin Brabham [Mon, 28 Sep 2020 22:52:55 +0000 (15:52 -0700)]
Call EXPECT_CALL before the incoming event
Bug:
169598507
Tag: #stability
Test: atest --host bluetooth_test_gd
Change-Id: If58fa04c6c292c197959b14e29f52800fd14c03b
Martin Brabham [Fri, 4 Sep 2020 05:03:32 +0000 (22:03 -0700)]
SM: Implement name request during Classic pairing
Ensure we try to receive the name and wait for it before
we show the UserConfirmation Dialog.
Bug:
162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Test: atest --host bluetooth_test_gd
Change-Id: I6a4401873770f7f642e06da34002dba55e5f049e
Hansong Zhang [Mon, 28 Sep 2020 20:00:18 +0000 (13:00 -0700)]
L2CAP: Remove unused ConnectRsp
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ifa6fc5470aeda670eb51482ed91a2b7ab665a813
Hansong Zhang [Mon, 28 Sep 2020 19:40:00 +0000 (12:40 -0700)]
RFCOMM, AVDT, HID: L2cap signal id is not used
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I53b2236b8603b4d8a3c6a49f8ae1355020a657e5
Hansong Zhang [Mon, 28 Sep 2020 19:20:19 +0000 (12:20 -0700)]
Include initial remote config in pL2CA_ConfigCfm_Cb
So we don't need to send a separate pL2CA_ConfigInd_Cb.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I75dafa4bc38a1c5a7773db6be5665b30ad88b006
Hansong Zhang [Mon, 28 Sep 2020 06:59:00 +0000 (23:59 -0700)]
Serialize L2CAP connect ind/cfm, config ind, cfm
Make them happen at one place.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie6b073312f77d837009783dcdbbf6835dfe71985
Hansong Zhang [Sun, 27 Sep 2020 23:49:17 +0000 (16:49 -0700)]
L2cap: Auto send ConnectRsp
In the past, L2cap user can decide whether to accept or reject a
ConnectReq. If reject, the channel is closed.
Now let L2cap layer always auto accept the remote ConnectReq and start
config process. If the L2cap user wants to reject, they can send a
DisconnectReq. According to L2cap state machine, a DisconnectReq after
ConnectRsp terminates the channel, which is equivalent to sending a
negative ConnectRsp, as before.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ibed56206148922356e8d9cb10650e9d82ab61225
Hansong Zhang [Sun, 27 Sep 2020 23:30:03 +0000 (16:30 -0700)]
Check for control block nullptr on l2cap error
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie041822b2f51aa20e57fa35f90c432a6c96733d5
Hansong Zhang [Sun, 27 Sep 2020 23:12:43 +0000 (16:12 -0700)]
L2cap channel cb: Store who initiated dynamic channel
Use pL2CA_ConfigCfm_Cb to let user know the direction.
Later the user can run check in ConnectInd or ConnectCfm callback.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Iae663e6bea0fc9426c5dfbbfc52bd1ae848f2965
Hansong Zhang [Sun, 27 Sep 2020 22:53:12 +0000 (15:53 -0700)]
We always send pL2CA_ConfigCfm_Cb with status OK
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4865330b4c48fe507bd6df72a5e362a616744ef4
Hansong Zhang [Sun, 27 Sep 2020 22:18:57 +0000 (15:18 -0700)]
L2cap shim clean up
Now we send ConfigReq and ConfigRsp automatically, we need to send
callbacks automatically.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I34e9a8afef63fed21befeda5c3a66e425d6ffaf8
Hansong Zhang [Sun, 27 Sep 2020 21:23:20 +0000 (14:23 -0700)]
L2CAP_FLUSHABLE_PKT is never used
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I21ef421c0fcc0f85ab4497fb4ff47bd83a242673
Ted Wang [Thu, 24 Sep 2020 11:24:24 +0000 (19:24 +0800)]
Reject SetBrowsedPlayer if there is not browsable player
Tag: #compatibility
Bug:
163109635
Test: atest net_test_avrcp
Change-Id: I587ca0d514b50c7a72269eef86a8b5ff38343d05
Hansong Zhang [Sun, 27 Sep 2020 07:24:48 +0000 (00:24 -0700)]
Minor clean up in l2c_api
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4e7f7d610dba175c9d0abc3d23038891acf31242
Hansong Zhang [Sun, 27 Sep 2020 07:12:49 +0000 (00:12 -0700)]
L2cap: Simplify DisconnectRsp
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working & OPP
Change-Id: I3c4c18bc6d55fe3aa8acda4db8d72f97781729ec
Hansong Zhang [Sun, 27 Sep 2020 07:03:53 +0000 (00:03 -0700)]
Remove unused L2cap code
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working & OPP
Change-Id: I3fce28b929e0d8685656b64725d8d36e37a082b4
Hansong Zhang [Sun, 27 Sep 2020 00:59:51 +0000 (17:59 -0700)]
Simplify avdt_sec_check_complete_term
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Iabddefde41cc2f63b306efe0cd4eb7e59116141b
Hansong Zhang [Sun, 27 Sep 2020 00:42:02 +0000 (17:42 -0700)]
Simplify bnep_sec_check_complete
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ifc0edea758f4d1e0847f5b00fc49b51b4ad00344
Hansong Zhang [Sat, 26 Sep 2020 23:58:47 +0000 (16:58 -0700)]
l2c_csm: Use pL2CA_Error_Cb on error
Note that we only have two result codes, because the user only needs to
know whether it's during ConnectRsp or ConfigRsp (except for HIDH
retry), which we need further research.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I24aa7bf8487c9b2b69fc455cfdb52a7ec758b90b
Hansong Zhang [Sat, 26 Sep 2020 23:48:40 +0000 (16:48 -0700)]
Regard L2CAP_CFG_PENDING as failure
Since all L2CAP users disconnect if the status is not OK.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I112400c2081be12d038426c1e8ea82229d5b9f4a
Hansong Zhang [Sat, 26 Sep 2020 23:39:28 +0000 (16:39 -0700)]
Introduce pL2CA_Error_Cb
L2CAP notifies users error in ConnectRsp and ConfigRsp through this
callback function (not linked so far). Next step is we send success
through pL2CA_ConnectCfm_Cb and pL2CA_ConfigCfm_Cb.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4456487d36248408fc1c31403d107baef05e3646
Hansong Zhang [Sat, 26 Sep 2020 23:20:31 +0000 (16:20 -0700)]
l2c_csm: Remove unused variable
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie11caa34cc55ed7e4aa6789df4cf08725998c73a
Treehugger Robot [Mon, 28 Sep 2020 02:28:06 +0000 (02:28 +0000)]
Merge "Add missing runtime dependency of android.hardware.bluetooth@1.1-service.btlinux"
Treehugger Robot [Mon, 28 Sep 2020 00:05:12 +0000 (00:05 +0000)]
Merge "Set apex_available property"
Hansong Zhang [Sun, 27 Sep 2020 06:38:13 +0000 (23:38 -0700)]
L2CAP ERTM: Fix p_ccb->max_rx_mtu
Use the old value, which was removed in
I78c3d65fdaf14addf80607ce5105221e52447a9e.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working & OPP
Change-Id: I90a8f94d16f87df2d4ce8bb0de8130d544affd12
Hansong Zhang [Sat, 26 Sep 2020 06:06:13 +0000 (23:06 -0700)]
Use hidh_on_l2cap_error for error handling
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I098743c83c82445618d02c2d8491890d8f765fee
Hansong Zhang [Sat, 26 Sep 2020 06:18:33 +0000 (23:18 -0700)]
Use hidd_on_l2cap_error for error handling
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I96bb727b01b8f0114d9f0cba1b8068e9591fae1f
Hansong Zhang [Sat, 26 Sep 2020 06:04:26 +0000 (23:04 -0700)]
HID: Simplify security check code
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ief3f87adbe41c1d4c5ea848fcddc3d1a3352166b
Hansong Zhang [Sat, 26 Sep 2020 06:30:27 +0000 (23:30 -0700)]
Use rfc_on_l2cap_error for error handling
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I32a6be12ab14a27c9c0502961bf5bd9bdbdff005
Hansong Zhang [Sat, 26 Sep 2020 00:40:04 +0000 (17:40 -0700)]
Use avct_on_l2cap_error for error handling
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6e35a51a175b43d9b0dc5bb5be859e2d5ff94fa1
Hansong Zhang [Sat, 26 Sep 2020 00:35:36 +0000 (17:35 -0700)]
Use avdt_on_l2cap_error for error handling
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I03f15d69e86d12b53fa4ee7fc711d4dca8a294aa
Hansong Zhang [Sat, 26 Sep 2020 00:12:47 +0000 (17:12 -0700)]
Use avct_br_on_l2cap_error
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I40fb1d61ff9375d0da2e1f4c83d42d5b273699c4
Tianyu Jiang [Fri, 25 Sep 2020 22:36:20 +0000 (15:36 -0700)]
Add missing runtime dependency of android.hardware.bluetooth@1.1-service.btlinux
so that hwasan build succeeds.
Test: lunch aosp_??????-userdebug && m SANITIZE_TARGET=hwaddress -j36
Bug:
169083233
Change-Id: I78da891664c2667aa449969b6f06f030e624b2e7
(cherry picked from commit
7181fb9f9e6823e06e718de5727f123b4073e05e)
Hansong Zhang [Sat, 26 Sep 2020 00:03:33 +0000 (17:03 -0700)]
Use gap_on_l2cap_error for error handling
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I8faaa5f586e3133d1a5c7ff890ad27a87ee9433a
Hansong Zhang [Fri, 25 Sep 2020 23:54:05 +0000 (16:54 -0700)]
Use gatt_on_l2cap_error for error handling
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I7a2fbc5805662270588d152ead932ffa02fc9dc6
Hansong Zhang [Fri, 25 Sep 2020 23:37:51 +0000 (16:37 -0700)]
Simplify bnep_on_l2cap_error
Both cases are doing the same thing.
Error reason isn't used throughout the stack.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ib3793f96c0d8a2907fc41d9a24712d2db78a0665
Hansong Zhang [Fri, 25 Sep 2020 23:37:05 +0000 (16:37 -0700)]
Use bnep_on_l2cap_error for error handling
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ieb28a7bbdea106a5e51e9bf996ecba9dab71f15a
Hansong Zhang [Fri, 25 Sep 2020 23:29:29 +0000 (16:29 -0700)]
Simplify sdp_on_l2cap_error
Both cases are doing the same thing (send disconnect request is no-op if
channel is not open, and then free the control block).
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I9b29899164b00fd9072e4dc37cfc30dd095c3524
Hansong Zhang [Fri, 25 Sep 2020 23:27:47 +0000 (16:27 -0700)]
SDP failure reason isn't used
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I1ee477914c1f13f43f868a28f18b372e36baf752
Hansong Zhang [Fri, 25 Sep 2020 23:24:52 +0000 (16:24 -0700)]
SDP: Move L2cap error handling to one place
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I903127f07ae97349d1fa7625d20835b46dbe9063
Hansong Zhang [Fri, 25 Sep 2020 23:16:48 +0000 (16:16 -0700)]
Remove unused code in l2c_api
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ifdcb0a14919e75103796246cddb9011393e0035a
Hansong Zhang [Fri, 25 Sep 2020 22:32:40 +0000 (15:32 -0700)]
Remove L2CA_ErtmConnectRsp
Just use L2CA_ConnectRsp.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie95ed09c9d2e79fabd9d6eae6a038a6896a8e558
Hansong Zhang [Fri, 25 Sep 2020 22:27:51 +0000 (15:27 -0700)]
Remove L2CA_ErtmConnectReq
Now that the p_ertm_info parameter is unused, just use L2CA_ConnectReq.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I458e0d8bcc2809c8bc2d295be29516be05bf05ba
Hansong Zhang [Fri, 25 Sep 2020 22:18:09 +0000 (15:18 -0700)]
L2CAP: Use ERTM info during registration, not conn req
ERTM info is stored in p_ccb->p_rcb. Use that as the source of truth.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I78c3d65fdaf14addf80607ce5105221e52447a9e
Hansong Zhang [Fri, 25 Sep 2020 21:57:49 +0000 (14:57 -0700)]
Clean up unused defines and imports
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I5c47ee320085664b3db68ff4a5860aa931d1376d
Hansong Zhang [Fri, 25 Sep 2020 21:32:11 +0000 (14:32 -0700)]
L2cap user: Use ConfigCfm_Cb as channel open indicator
When the user receives ConfigCfm_Cb, it's guaranteed that ConfigInd_Cb
is received with correct option enforced.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6de12f1ba6e9612f6a84b399e7fc984a7f3c3c72
Hansong Zhang [Fri, 25 Sep 2020 20:24:55 +0000 (13:24 -0700)]
L2C_CSM: Send ConfigCfm to user after ConfigInd
This way, users know that a ConfigCfm event with status OK means channel
is established. No need to further keep track of state.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I90295349c53d57aa859c5bb65e6f28a299714b3d
Hansong Zhang [Fri, 25 Sep 2020 19:39:16 +0000 (12:39 -0700)]
L2CA_ConfigCfm_Cb only need to provide result
Users only care about result.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ife07db2454f938fb1dd1b7fde2136b8de887fa3b
Hansong Zhang [Fri, 25 Sep 2020 19:17:12 +0000 (12:17 -0700)]
HIDD: Treat unacceptable QOS as normal failure
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I7d37c46f7c6b16a55afafe04b62081d43f63c122
Hansong Zhang [Fri, 25 Sep 2020 18:31:02 +0000 (11:31 -0700)]
L2CA_ConfigReq and L2CA_ConfigRsp are internal now
Only used by l2c_csm, so we make an internal version instead.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: If725c705bcbabec025cb16d063cd4d4aa4b319f9
Hansong Zhang [Fri, 25 Sep 2020 18:15:00 +0000 (11:15 -0700)]
Remove L2CA_ConfigReq in client code
Let L2CAP do this for you.
HIDD used to send anothe ConfigReq if the remote HIDH wants a different
QOS. We drop this adjustment for now. QOS is not used. Regard this as a
normal config error. This simplifies the workflow.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ic3ff08a4b876462fec697ffa8a09fc8bca943603
Hansong Zhang [Fri, 25 Sep 2020 04:32:08 +0000 (21:32 -0700)]
L2CAP module will send ConfigReq for you
No need to send it in client code.
Will get rid of the fake L2CA_ConfigReq() next.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I66e2efad144e76eb6abfa6d421e12ae4a60d8e1f
Hansong Zhang [Fri, 25 Sep 2020 07:04:44 +0000 (00:04 -0700)]
L2CAP: Don't allow sending re-config
There is no use case. Remove the support for now. This makes L2CAP state
machine more complicated.
Note that we don't handle re-config request from remote gracefully. For
example, RFCOMM will simply disconnect.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I1d2a420e4f904b7e935715f327171d133760eab3
Hansong Zhang [Fri, 25 Sep 2020 06:28:56 +0000 (23:28 -0700)]
L2CA_ConfigRsp is always invoked with status OK
So we can move some error processing logic.
Also we never send a config with continuation flag.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6c5e05b39a76138f90b41a0e56b7bfd73f056455
Hansong Zhang [Fri, 25 Sep 2020 04:20:37 +0000 (21:20 -0700)]
L2CAP: Provide a default ERTM option
Note that the existing ERTM options for AVCT_BR and GAP OBEX are almost
the same, and the only difference is TxWindow (10 and 20). Providing a
default value of 10 won't make a difference.
Use the same ERTM option so that later L2CAP can send config request for
them.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I410045f47c643fd4a152ae44722e905b2ce01197
Hansong Zhang [Fri, 25 Sep 2020 03:59:13 +0000 (20:59 -0700)]
Some ERTM values are constant
Remove unnecessary definition.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I2cb74575a57262e11ebc389a3f9473702dbb13b4
Hansong Zhang [Fri, 25 Sep 2020 03:45:11 +0000 (20:45 -0700)]
Remove unnecessary definition
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I9baf600d22cad78b2b93d29dd7d8975731beb47d
Treehugger Robot [Sat, 26 Sep 2020 00:51:46 +0000 (00:51 +0000)]
Merge "HciCaptures: Add CommandComplete"
Myles Watson [Thu, 24 Sep 2020 15:51:14 +0000 (08:51 -0700)]
HciCaptures: Add CommandComplete
Add public methods to match or extract events in matchers.py.
Call the same private static methods to extract or match events.
- CommandComplete
- LeMetaEvent
- LeConnectionComplete
Test: cert/run --host
Bug:
145832107
Tag: #gd-refactor
Change-Id: I308e97cfe60dbcd351f211ff836c0516019412db
Hansong Zhang [Fri, 25 Sep 2020 03:05:07 +0000 (20:05 -0700)]
Let L2CAP send ConfigRsp for you
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4767af7032b9c22fc297cca0877a1bc7e8c8607b
Chris Manton [Fri, 25 Sep 2020 00:11:21 +0000 (17:11 -0700)]
Straighten out stack/acl/btm_acl::btm_read_remote_version_complete
Towards readable code
Bug:
163134718
Tag: #refactor
Test: ble paired 2 phones
Test: act.py -tc BleCocTest
Change-Id: I87db6ce0106e98684f1582a60f28beed81d66aec
Chris Manton [Fri, 25 Sep 2020 05:12:00 +0000 (22:12 -0700)]
Add gd/l2cap::OnReadRemoteVersionInformationComplete
Provide ability to handle at higher layer
Bug:
166280067
Tag: #refactor
Test: gd/cert/run --host
Change-Id: I717b273623df4a3e21bf07e62b034cd7ad790cd3
Treehugger Robot [Fri, 25 Sep 2020 19:15:18 +0000 (19:15 +0000)]
Merge "Handle remote connection parameter request"
Jakub Pawlowski [Fri, 25 Sep 2020 17:28:07 +0000 (19:28 +0200)]
Handle remote connection parameter request
Bug:
145832107
Test: connect with LE Device that request parameter chagne
Tag: #gd-refactor
Change-Id: I82839b56c58dda4b2f430c212156bf8919d67103
Hansong Zhang [Fri, 25 Sep 2020 02:57:01 +0000 (19:57 -0700)]
Enforce remote MTU requirement in L2CAP directly
AVCT_BR and BNEP don't need to enforce it locally.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I090d4e31b76e0098fc77e707ebd2eacf4cd78b7b
Hansong Zhang [Fri, 25 Sep 2020 02:28:17 +0000 (19:28 -0700)]
L2CAP: peer_cfg_bits is unused
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Icec4e536f28a649779f747d34a7d76295f5ef10f
Hansong Zhang [Fri, 25 Sep 2020 00:50:55 +0000 (17:50 -0700)]
L2CAP: Add a "required_remote_mtu" and store it
For AVCT_BR and BNEP, we need a larger required remote mtu than minimal
L2CAP MTU.
So far we enforce this in profile service itself, but later we can let
L2CAP module enforce this for us.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0b4bad4049636bcdc52615c000b1fff3acde360c
Hansong Zhang [Fri, 25 Sep 2020 00:27:49 +0000 (17:27 -0700)]
Remove unused code in BNEP
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I51a6edb1d7f94422657128d0b3d8398a4c25c5de
Hansong Zhang [Thu, 24 Sep 2020 23:56:10 +0000 (16:56 -0700)]
Profile services have const MTU size now
For GAP, the value comes from
`btsock_l2cap_listen_or_connect`. For classic dynamic channel, we use
L2CAP_SDU_LENGTH_MAX for now.
For GATT, we use GATT_MAX_MTU_SIZE, which was used when we send
config request.
Bug:
159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I93b82c718866f09c4c209311c93b65f2dc74b193
Jiyong Park [Mon, 21 Sep 2020 14:10:36 +0000 (23:10 +0900)]
Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written allowlist in build/soong/apex/apex.go. Trying to remove
the list by adding apex_available property to the Android.bp of
the libraries.
Bug:
150999716
Test: m
Change-Id: I8dad3cdd017fb128e7e17313ed20756c093009a2
Treehugger Robot [Fri, 25 Sep 2020 15:14:56 +0000 (15:14 +0000)]
Merge changes I8b3c9cd4,Iedb0a81a,If7612988,I25f7c702,I23eb6baa, ...
* changes:
Move decls to ble_hci interface
Locally link and remove unused funcs stack/btm/btm_ble_privacy
Remove duplicate decls stack/btm/btm_ble_int
Move function decls with usage stack/btm::
Explictly provide ble extern declarations
Move stack/btm/btm_ble_addr::btm_ble_refresh_raddr_timer_timeout
Yanfei Zhou [Tue, 28 Aug 2018 02:58:52 +0000 (10:58 +0800)]
GAP: Support 128-bit custom UUID in EIR record
1)Add 128-bit custom UUID into EIR when API
BluetoothAdapter#listenUsingRfcommWithServiceRecord is called.
2) Delete 128-bit custom UUID from EIR when socket created by API
BluetoothAdapter#listenUsingRfcommWithServiceRecord is closed.
Test: atest net_test_bta
Bug:
119535937
Sponsor: alainv@
Tag: #feature
Change-Id: I163abf9c4afe5430442381c994e324cefbb04f22
Chris Manton [Sun, 20 Sep 2020 00:54:59 +0000 (17:54 -0700)]
Move decls to ble_hci interface
From: stack/btm/btm_ble_int
Towards readable code
Bug:
163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I8b3c9cd43fe3cc34a2c41c53252d5f58990b2dbf
Jakub Pawlowski [Fri, 25 Sep 2020 09:12:13 +0000 (09:12 +0000)]
Merge "Properly pass address type when extended advertisement is received"
Chris Manton [Sun, 20 Sep 2020 01:22:09 +0000 (18:22 -0700)]
Locally link and remove unused funcs stack/btm/btm_ble_privacy
Towards readable code
Bug:
163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Iedb0a81a01f7c1ac24bc35202be32b9799e2e4e4
Chris Manton [Sun, 20 Sep 2020 00:41:57 +0000 (17:41 -0700)]
Remove duplicate decls stack/btm/btm_ble_int
Towards readable code
Bug:
163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: If7612988717edca3d2676635783fbff331552268
Chris Manton [Sun, 20 Sep 2020 00:38:17 +0000 (17:38 -0700)]
Move function decls with usage stack/btm::
Towards readable code
Bug:
163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I25f7c7024c29ac461d4f50db365fb28d97f5f407
Chris Manton [Sun, 20 Sep 2020 01:00:52 +0000 (18:00 -0700)]
Explictly provide ble extern declarations
Towards readable code
Bug:
163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I23eb6baa71324529a413f20614dc9e4e8ab8bc70
Chris Manton [Sun, 20 Sep 2020 00:22:05 +0000 (17:22 -0700)]
Move stack/btm/btm_ble_addr::btm_ble_refresh_raddr_timer_timeout
From: stack/btm/btm_ble_gap::btm_ble_refresh_raddr_timer_timeout
Group functionality within same file
Towards readable code
Bug:
163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Ida81c42548b377ecada80bfe7e94f0e4fa45721a