Skip to content
Merged
2 changes: 2 additions & 0 deletions include/btmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ extern "C"
#define BTRMGR_COLUMBO_UUID "64d9f574-7756-4ebc-9ebe-ed5f7f2871ab"
#define BTRMGR_REMOTE_DEVICE "Remote Device"

#define BTRMGR_APPLE_VENDOR_ID_1 0x342
#define BTRMGR_APPLE_VENDOR_ID_2 0x4c
Comment thread
natrajmuthusamy marked this conversation as resolved.
#define BTRMGR_XBOX_ELITE_PRODUCT_ID 0x0B05
#define BTRMGR_XBOX_ELITE_VENDOR_ID 0x045E
#define BTRMGR_SONY_PS_VENDOR_ID 0x054c
Expand Down
30 changes: 21 additions & 9 deletions src/ifce/btrMgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -6183,6 +6183,13 @@ BTRMGR_StartAudioStreamingOut_StartUp (
BTRMGRLOG_INFO ("Incoming Connection accepted for Audio Out device based on the response from UI\n");
} else {
BTRMGRLOG_INFO ("Incoming Connection rejected for Audio Out device based on the response from UI\n");
if (strstr(stDeviceInfo.pcDeviceName, "AirPods") ||
(stDeviceInfo.ui32ModaliasVendorId == BTRMGR_APPLE_VENDOR_ID_1) ||
(stDeviceInfo.ui32ModaliasVendorId == BTRMGR_APPLE_VENDOR_ID_2)) {
BTRMGRLOG_INFO("Device remains connected even after authorization rejection; initiating a 5‑second timer to disconnect the AirPods.\n");
Comment thread
natrajmuthusamy marked this conversation as resolved.
btrMgr_ClearDisconnDevHoldOffTimer();
btrMgr_SetDisconnDevHoldOffTimer(stDeviceInfo.tDeviceId);
Comment thread
natrajmuthusamy marked this conversation as resolved.
}
Comment thread
natrajmuthusamy marked this conversation as resolved.
Comment thread
natrajmuthusamy marked this conversation as resolved.
}
gEventRespReceived = 0;
}
Expand Down Expand Up @@ -9083,17 +9090,15 @@ btrmgr_DisconnectDeviceTimerCb (

gAuthDisconnDevTimeOutRef = 0; // TODO: Is this really required ? Should we call btrMgr_ClearDisconnDevHoldOffTimer to perform g_source_destroy
// Can we even call a g_source_destroy from the context of the timer Cb associated with the same Id/Ref ?
if (ghBTRMgrDevHdlCurStreaming != aBTRCoreDevId && ghBTRMgrDevHdlStreamStartUp != aBTRCoreDevId) //check device hasn't started streaming since timer was set ( don't want to disconnect incorrectly)
{

if (ghBTRMgrDevHdlCurStreaming != aBTRCoreDevId) {
if (BTRCore_DisconnectDevice (ghBTRCoreHdl, aBTRCoreDevId, lenBTRCoreDeviceType) != enBTRCoreSuccess) {
BTRMGRLOG_ERROR ("Post Device disconnect Cb timeout Failed!\n");
}
}
else
{
BTRMGRLOG_INFO("Not disconnecting device, as device has started streaming or is starting up streaming\n");
}
return FALSE;
} else {
BTRMGRLOG_INFO("Not disconnecting device, as device has started streaming\n");
}
return FALSE;
}

static gboolean
Expand Down Expand Up @@ -10457,6 +10462,13 @@ btrMgr_ConnectionInAuthenticationCb (
BTRMGRLOG_INFO ("Incoming Connection accepted for Audio Out device based on the response from UI\n");
} else {
BTRMGRLOG_INFO ("Incoming Connection rejected for Audio Out device based on the response from UI\n");
if (strstr(apstConnCbInfo->stKnownDevice.pcDeviceName, "AirPods") ||
(apstConnCbInfo->stKnownDevice.ui32VendorId == BTRMGR_APPLE_VENDOR_ID_1) ||
(apstConnCbInfo->stKnownDevice.ui32VendorId == BTRMGR_APPLE_VENDOR_ID_2)) {
BTRMGRLOG_INFO("Device remains connected even after authorization rejection; initiating a 5-second timer to disconnect the AirPods.\n");
btrMgr_ClearDisconnDevHoldOffTimer();
btrMgr_SetDisconnDevHoldOffTimer(apstConnCbInfo->stKnownDevice.tDeviceId);
}
Comment thread
natrajmuthusamy marked this conversation as resolved.
Comment thread
natrajmuthusamy marked this conversation as resolved.
Comment thread
natrajmuthusamy marked this conversation as resolved.
Comment thread
natrajmuthusamy marked this conversation as resolved.
}
gEventRespReceived = 0;
}
Expand All @@ -10467,7 +10479,7 @@ btrMgr_ConnectionInAuthenticationCb (
}
else {
BTRMGRLOG_ERROR ("Incoming Connection denied\n");
if (strstr(apstConnCbInfo->stKnownDevice.pcDeviceName, "AirPods") || (apstConnCbInfo->stKnownDevice.ui32VendorId == 834)) {
if (strstr(apstConnCbInfo->stKnownDevice.pcDeviceName, "AirPods") || (apstConnCbInfo->stKnownDevice.ui32VendorId == BTRMGR_APPLE_VENDOR_ID_1)) {
btrMgr_ClearDisconnDevHoldOffTimer();
btrMgr_SetDisconnDevHoldOffTimer(apstConnCbInfo->stKnownDevice.tDeviceId);
}
Expand Down
Loading