From 9e668353b60ba4ad10ff13702d17010e67d15b6b Mon Sep 17 00:00:00 2001 From: NatrajMuthusamygithubpractice <106724208+NatrajMuthusamygithubpractice@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:28:10 +0530 Subject: [PATCH] Pairing request is posted to btmgr instead of connection request. (#5695) Reason for change: Using the == operator in the if check directly checks for string equality Test Procedure: Test the auto-connect feature for BT gamepads from UI. Risks: Medium Signed-off-by: Natraj Muthusamy --- Bluetooth/Bluetooth.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Bluetooth/Bluetooth.cpp b/Bluetooth/Bluetooth.cpp index 37e454bedf..9052dceca1 100644 --- a/Bluetooth/Bluetooth.cpp +++ b/Bluetooth/Bluetooth.cpp @@ -788,15 +788,15 @@ namespace WPEFramework lstBtrMgrEvtRsp.m_deviceHandle = deviceID; - if (eventType.compare(EVT_PAIRING_REQUEST)) { + if (eventType == EVT_PAIRING_REQUEST) { lstBtrMgrEvtRsp.m_eventType = BTRMGR_EVENT_RECEIVED_EXTERNAL_PAIR_REQUEST; lstBtrMgrEvtRsp.m_eventResp = Utils::String::equal(respValue, "ACCEPTED") ? 1 : 0; } - else if (eventType.compare(EVT_CONNECTION_REQUEST)) { + else if (eventType == EVT_CONNECTION_REQUEST) { lstBtrMgrEvtRsp.m_eventType = BTRMGR_EVENT_RECEIVED_EXTERNAL_CONNECT_REQUEST; lstBtrMgrEvtRsp.m_eventResp = Utils::String::equal(respValue, "ACCEPTED") ? 1 : 0; } - else if (eventType.compare(EVT_PLAYBACK_REQUEST)) { + else if (eventType == EVT_PLAYBACK_REQUEST) { lstBtrMgrEvtRsp.m_eventType = BTRMGR_EVENT_RECEIVED_EXTERNAL_PLAYBACK_REQUEST; lstBtrMgrEvtRsp.m_eventResp = Utils::String::equal(respValue, "ACCEPTED") ? 1 : 0; }