Skip to content

Commit

Permalink
Merge pull request rdkcentral#4599 from PaviP98/SERXIONE-3642-23Q4-sp…
Browse files Browse the repository at this point in the history
…rint

SERXIONE-3642: [Whoami]Device not triggering maintenance tasks, once …
  • Loading branch information
vinupalackal authored Nov 2, 2023
2 parents aff0aab + 844b325 commit cc2c93e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions MaintenanceManager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.

## [1.0.27] - 2023-10-31
### Changed
- Proceed with maintenance tasks during first time activation once we got internet

## [1.0.26] - 2023-10-09
### Added
- Added support to set partnerID through Authservice received from gdi
Expand Down
15 changes: 9 additions & 6 deletions MaintenanceManager/MaintenanceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ using namespace std;

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 26
#define API_VERSION_NUMBER_PATCH 27
#define SERVER_DETAILS "127.0.0.1:9998"


Expand Down Expand Up @@ -319,16 +319,18 @@ namespace WPEFramework {
#endif

#if defined(ENABLE_WHOAMI)
string activation_status = "";
if (UNSOLICITED_MAINTENANCE == g_maintenance_type) {
/* WhoAmI check*/
bool whoAmIStatus = knowWhoAmI();
bool whoAmIStatus = knowWhoAmI(activation_status);
if (whoAmIStatus) {
LOGINFO("knowWhoAmI() returned successfully");
}
}
#endif

if ( false == internetConnectStatus && activation_status == "activated" ) {
#else
if ( false == internetConnectStatus ) {
#endif
m_statusMutex.lock();
MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_ERROR);
m_statusMutex.unlock();
Expand Down Expand Up @@ -407,7 +409,7 @@ namespace WPEFramework {
}

#if defined(ENABLE_WHOAMI)
bool MaintenanceManager::knowWhoAmI()
bool MaintenanceManager::knowWhoAmI(string &activation_status)
{
bool success = false;
int retryDelay = 10;
Expand Down Expand Up @@ -478,7 +480,8 @@ namespace WPEFramework {

retryCount++;
if (retryCount == 4 && !success) {
if (checkActivatedStatus() == "activated") {
activation_status = checkActivatedStatus();
if (activation_status == "activated") {
LOGINFO("Device is already activated. Exiting from knowWhoAmI()");
success = true;
}
Expand Down
2 changes: 1 addition & 1 deletion MaintenanceManager/MaintenanceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace WPEFramework {
#if defined(ENABLE_WHOAMI)
std::map<string, string> m_param_map;
std::map<string, DATA_TYPE> m_paramType_map;
bool knowWhoAmI();
bool knowWhoAmI(string &activation_status);
#endif
PluginHost::IShell* m_service;

Expand Down

0 comments on commit cc2c93e

Please sign in to comment.