Skip to content

Commit 33e7ef2

Browse files
authored
XIONE-17284 : VG not working after FSR (rdkcentral#6284) (rdkcentral#6290) (rdkcentral#6297)
Reason for change: update retry mechanism Test Procedure: Mentioned in ticket Risks: Low Signed-off-by: vdinak240 <[email protected]>
1 parent adb215f commit 33e7ef2

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

TextToSpeech/CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ All notable changes to this RDK Service will be documented in this file.
1515
* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.
1616

1717
* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
18+
## [1.0.36] - 2025-06-19
19+
### Fixed
20+
- Fixed coverity reported issue
1821

19-
## [1.0.35] - 2025-06-19
22+
## [1.0.35] - 2025-06-16
2023
### Fixed
21-
- Fixed coverity reported issues
24+
- EAA -VG not working on FTUE screen
2225

2326
## [1.0.34] - 2025-04-01
2427
### Fixed

TextToSpeech/TextToSpeech.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#define API_VERSION_NUMBER_MAJOR 1
2323
#define API_VERSION_NUMBER_MINOR 0
24-
#define API_VERSION_NUMBER_PATCH 35
24+
#define API_VERSION_NUMBER_PATCH 36
2525
#define API_VERSION_NUMBER 1
2626

2727
namespace WPEFramework {

TextToSpeech/impl/RFCURLObserver.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#define SYSTEMSERVICE_CALLSIGN "org.rdk.System"
1616
#define SYSTEMSERVICE_CALLSIGN_VER SYSTEMSERVICE_CALLSIGN".1"
1717

18-
#define MAX_RETRIES 3 // Define the maximum number of retries
1918
#define RETRY_DELAY_MS 2000 // Define the delay between retries in milliseconds
2019

2120
using namespace WPEFramework;
@@ -109,8 +108,7 @@ void RFCURLObserver::registerNotification() {
109108
m_systemService = new WPEFramework::JSONRPC::LinkType<Core::JSON::IElement>(_T(SYSTEMSERVICE_CALLSIGN_VER),"", false, token);
110109
}
111110

112-
int retries = 0;
113-
while (retries < MAX_RETRIES) {
111+
while (!m_eventRegistered) {
114112
if (m_systemService->Subscribe<JsonObject>(3000, "onDeviceMgtUpdateReceived",
115113
&RFCURLObserver::onDeviceMgtUpdateReceivedHandler, this) == Core::ERROR_NONE) {
116114
m_eventRegistered = true;
@@ -119,13 +117,8 @@ void RFCURLObserver::registerNotification() {
119117
} else {
120118
TTSLOG_ERROR("Failed to subscribe to notification handler: onDeviceMgtUpdateReceived..Retrying");
121119
std::this_thread::sleep_for(std::chrono::milliseconds(RETRY_DELAY_MS));
122-
retries++;
123120
}
124121
}
125-
126-
if (!m_eventRegistered) {
127-
TTSLOG_ERROR("Failed to subscribe to notification handler after maximum retries.");
128-
}
129122
}
130123
}
131124

TextToSpeech/impl/SatToken.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ string SatToken::getSecurityToken() {
8484
return token;
8585
}
8686

87+
std::string SatToken::getSAT() {
88+
if (m_tokenUpdated.load(std::memory_order_acquire)) {
89+
TTSLOG_INFO("SAT token updated refetch");
90+
getServiceAccessToken();
91+
m_tokenUpdated.store(false, std::memory_order_release);
92+
}
93+
std::lock_guard<std::mutex> lock(m_mutex);
94+
return m_SatToken;
95+
}
96+
8797
void SatToken::getServiceAccessToken() {
8898
if(m_authService != nullptr) {
8999
JsonObject joGetParams, joGetResult;
@@ -108,8 +118,8 @@ void SatToken::getServiceAccessToken() {
108118
}
109119

110120
void SatToken::serviceAccessTokenChangedEventHandler(const JsonObject& parameters) {
111-
TTSLOG_INFO("SAT changed");
112-
getServiceAccessToken();
121+
TTSLOG_INFO("TTS - SAT token updated notification");
122+
m_tokenUpdated.store(true, std::memory_order_release);
113123
}
114124

115125
}

TextToSpeech/impl/SatToken.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _TTS_SATTOKEN_H_
22
#define _TTS_SATTOKEN_H_
33
#include "TTSCommon.h"
4+
#include <atomic>
45
#include <mutex>
56

67
namespace WPEFramework {
@@ -10,10 +11,7 @@ namespace TTS {
1011
class SatToken {
1112
public:
1213
static SatToken* getInstance(const string callsign);
13-
string getSAT() {
14-
std::lock_guard<std::mutex> lock(m_mutex);
15-
return m_SatToken;
16-
};
14+
string getSAT();
1715

1816
private:
1917
SatToken(){};
@@ -30,6 +28,7 @@ class SatToken {
3028
string m_callsign;
3129
std::mutex m_mutex;
3230
bool m_eventRegistered{false};
31+
std::atomic<bool> m_tokenUpdated {false};
3332
};
3433
}
3534
}

0 commit comments

Comments
 (0)