From 17d692578102d73bcf30b00442cdd456e92a7912 Mon Sep 17 00:00:00 2001 From: Nitin Shivpure Date: Thu, 22 Mar 2018 16:16:32 +0530 Subject: [PATCH] HOGP: Update status to OK, if link is already encrypted Usecase: 1) Connect to HOGP device. (Because of some condition encryption fails with Connection Timeout, remote device turned off when connection was initiated) 2) Try to connect again to HoGP device Expected Result: Connection should be successful Observed Result: UI stuck in connecting state and connection never succeeds. Root cause: When encryption fails in previous iteration, encryption happens before HoGP Server starts security procedure, leading to Encryption Complete event being received with wrong status. Fix: Update the status to success when sending encryption complete event if link is already encrypted Test: Issue is not seen after above steps Fixes: 76133015 Change-Id: Ib404cf157289170ea300eae40f51393606c35105 --- bta/hh/bta_hh_le.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/bta/hh/bta_hh_le.cc b/bta/hh/bta_hh_le.cc index 78540c50e..7c79a0054 100644 --- a/bta/hh/bta_hh_le.cc +++ b/bta/hh/bta_hh_le.cc @@ -1098,6 +1098,7 @@ void bta_hh_start_security(tBTA_HH_DEV_CB* p_cb, /* if link has been encrypted */ if (sec_flag & BTM_SEC_FLAG_ENCRYPTED) { + p_cb->status = BTA_HH_OK; bta_hh_sm_execute(p_cb, BTA_HH_ENC_CMPL_EVT, NULL); } /* if bonded and link not encrypted */ -- 2.11.0