From 73dc897e0ce15f3362644930ea7c47919e97dda1 Mon Sep 17 00:00:00 2001 From: tharun-kumarv <105273644+tharun-kumarv@users.noreply.github.com> Date: Mon, 24 Feb 2025 10:32:54 +0530 Subject: [PATCH] DELIA-67545 :Gamepad is disconnected and autoconnect is off Reason for change: skipped posting the connection completion event after disconnection until UI initiates the connect wrapper Test Procedure: Follow the steps in the ticket description Risks: Low Priority: P1 --- src/ifce/btrMgr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ifce/btrMgr.c b/src/ifce/btrMgr.c index ac9e4ad..9ea6c10 100644 --- a/src/ifce/btrMgr.c +++ b/src/ifce/btrMgr.c @@ -9164,7 +9164,12 @@ btrMgr_DeviceStatusCb ( else if ((lstEventMessage.m_pairedDevice.m_deviceType == BTRMGR_DEVICE_TYPE_HID) || (lstEventMessage.m_pairedDevice.m_deviceType == BTRMGR_DEVICE_TYPE_HID_GAMEPAD)) { BTRMGRLOG_DEBUG("HID Device Found ui16DevAppearanceBleSpec - %d \n",p_StatusCB->ui16DevAppearanceBleSpec); - if(ghBTRMgrDevHdlLastDisconnected == lstEventMessage.m_pairedDevice.m_deviceHandle) + /* Skipped posting the connection completion event here if the device tries to auto-connect + * post disconnection from UI, Based on the connect wrapper initiated from UI connection + * completion event will be posted. + */ + if ((ghBTRMgrDevHdlLastDisconnected == lstEventMessage.m_pairedDevice.m_deviceHandle) || + (p_StatusCB->eDevicePrevState == enBTRCoreDevStDisconnected)) break; if ((p_StatusCB->ui16DevAppearanceBleSpec == BTRMGR_HID_GAMEPAD_LE_APPEARANCE) && (enBTRCoreDevStLost == p_StatusCB->eDevicePrevState) &&