From 3fc5eab23c34bfd06f7f50e1d8cbffb311001355 Mon Sep 17 00:00:00 2001 From: ppalan289 Date: Fri, 24 Jul 2026 08:57:50 +0000 Subject: [PATCH] RDKOSS-22272 : Main Change in sup_8.3.4.0 Reason for change: crash Test Procedure: Factory reset Risks: Medium Priority: P0 Signed-off-by: ppalan289 --- src/ifce/btrMgr.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ifce/btrMgr.c b/src/ifce/btrMgr.c index 7fedd8f..b1735a1 100644 --- a/src/ifce/btrMgr.c +++ b/src/ifce/btrMgr.c @@ -4033,6 +4033,20 @@ BTRMGR_DeInit ( if (BTRCore_DisconnectDevice(ghBTRCoreHdl, lstConnectedDevices.m_deviceProperty[ui16LoopIdx].m_deviceHandle, lenBtrCoreDevTy) != enBTRCoreSuccess) { BTRMGRLOG_ERROR ("Failed to Disconnect - %llu\n", lstConnectedDevices.m_deviceProperty[ui16LoopIdx].m_deviceHandle); } + if (lenBtrCoreDevTy == enBTRCoreSpeakers || lenBtrCoreDevTy == enBTRCoreHeadSet) { + unsigned int ui32PollCount = 10; /* 10 × 100ms = 1000ms max */ + + do { + usleep(100000); /* 100ms */ + lenBtrCoreRet = BTRCore_GetDeviceDisconnected(ghBTRCoreHdl,lstConnectedDevices.m_deviceProperty[ui16LoopIdx].m_deviceHandle,lenBtrCoreDevTy); + } while ((lenBtrCoreRet != enBTRCoreSuccess) && (--ui32PollCount)); + + if (!ui32PollCount) { + BTRMGRLOG_WARN("Disconnect confirmation timeout for device %llu\n", lstConnectedDevices.m_deviceProperty[ui16LoopIdx].m_deviceHandle); + } else { + BTRMGRLOG_WARN("Disconnect confirmed for device %llu in %dms\n", lstConnectedDevices.m_deviceProperty[ui16LoopIdx].m_deviceHandle, (10 - ui32PollCount) * 100); + } + } } } }