OSDN Git Service

HID: Update state to disconnected in virtual unplug
authorHemant Gupta <hemantg@codeaurora.org>
Fri, 2 Mar 2018 04:59:25 +0000 (10:29 +0530)
committerJakub Pawlowski <jpawlowski@google.com>
Thu, 3 May 2018 07:35:22 +0000 (07:35 +0000)
commit126397bc6e8ff19bd37b0bc4b9b5db978eecb773
treefad1c81f33827ada8d86d9f758fad90cbb9010c0
parent0d33f58fe74e1ad4aa047ebfd0005afe580cfdb3
HID: Update state to disconnected in virtual unplug

Usecase:
1.Pair and connect DUT with Remote device
2.Disconnect Remote device from DUT (Settings menu)
3.Connect to Remote device from settings menu when Remote will not be
  advertising.
4.With in 30 secs of connect command, delete the stored link key and then pair
  and connect again to Remote device from settings menu
  (when RD is advertising).

Expected Result:
Remote device should connect successfully.

Observed Result:
Remote device is shown in paired devices(settings menu)but not connected.

Root cause:
When virtual unplug happens device state is not cleared properly. So next
time when we are trying to connect its going to connected state.

Fix:
Update the current device state to BTHH_CONN_STATE_CONNECTING to
BTIF_HH_DEV_DISCONNECTED when virtual unplug happens.

Test: Issue is not seen after above steps

Fixes: 74082929
Change-Id: I8a325987ff5eb0a8e4f8708fc7c76b8a9ade6ccf
btif/include/btif_hh.h
btif/src/btif_hh.cc