|
@@ -257,7 +257,7 @@ void CHealthManagerEntity::OnCheckTimeTimeout()
|
|
|
eErrCode = GetFunction()->GetSysVar("TerminalStage", csTermStage);
|
|
|
Dbg("OnCheckTimeTimeout::ToRestartByCenterSetting to get termstage %s", csTermStage.GetData());
|
|
|
//oilyang@20250313 in Main page('UIState' is 'M') or TerminalStage is (NOT 'S') AND (NOT 'A'),that is in close page which caused by terminal app
|
|
|
- if (CheckUIStateIsM() || (!CheckUIStateIsM() && csTermStage.Compare("S") != 0 && csTermStage.Compare("A") != 0) )
|
|
|
+ if (m_bInMainPage || (!m_bInMainPage && csTermStage.Compare("S") != 0 && csTermStage.Compare("A") != 0) )
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("THE key CenterSetting updated,we must restart framework right now.");
|
|
|
m_fsm.QuitFrameworkAndSaveInfo(RebootTrigger_Resource, RebootWay_Framework);
|
|
@@ -299,13 +299,9 @@ void CHealthManagerEntity::OnCheckTimeTimeout()
|
|
|
//1、AccessAuth ok
|
|
|
//2、have ever enter main page OR
|
|
|
if (!m_bSayIdle)
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_fsm.GetAccessAuthFlag():%d, m_bEnterMainPageEver:%d, m_bInMainPage:%d", m_fsm.GetAccessAuthFlag()
|
|
|
- , m_bEnterMainPageEver, CheckUIStateIsM());
|
|
|
- //oilyang@20241230 check accessauth flag AND if in Main page ever
|
|
|
- //oilyang@20250313 "Main page ever" has two scenes
|
|
|
- //1. have enter main page ever,that is "m_bEnterMainPageEver is true"
|
|
|
- //2. healthmanager have been lost at some point in the past,we check the "UIState" value if 'M'
|
|
|
- if (m_fsm.GetAccessAuthFlag() && (m_bEnterMainPageEver || (!m_bEnterMainPageEver && CheckUIStateIsM())))
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_fsm.GetAccessAuthFlag():%d, CheckIfHaveEnterMainPageEver:%d", m_fsm.CheckIfAccessAuthSuc(), CheckIfHaveEnterMainPageEver());
|
|
|
+ //oilyang@20241230 check if have enter Main page ever
|
|
|
+ if (CheckIfHaveEnterMainPageEver())
|
|
|
{
|
|
|
iCheckGuardian = CheckGuardianIsRun(true);
|
|
|
if (!m_bSayIdle)
|
|
@@ -379,7 +375,7 @@ void CHealthManagerEntity::OnCheckTimeTimeout()
|
|
|
else
|
|
|
{
|
|
|
//oilyang@20190905 add if auth suc,tell guardian,for upgrade
|
|
|
- if (m_fsm.GetAccessAuthFlag())
|
|
|
+ if (m_fsm.CheckIfAccessAuthSuc())
|
|
|
{
|
|
|
if (CheckGuardianIsRun(true) > 0)
|
|
|
{
|
|
@@ -1272,11 +1268,11 @@ void CHealthManagerEntity::OnSysVarEvent(const char *pszKey, const char *pszValu
|
|
|
if (_strnicmp(pszValue, "M", strlen("M")) == 0)
|
|
|
{
|
|
|
m_bInMainPage = true;
|
|
|
- m_bEnterMainPageEver = true;
|
|
|
-
|
|
|
- if (!m_bHaveThrowMainPage)
|
|
|
+ if (!CheckIfHaveEnterMainPageEver())
|
|
|
{
|
|
|
- m_bHaveThrowMainPage = true;
|
|
|
+ CSystemRunInfo sysRunInfo;
|
|
|
+ if (GetFunction()->GetSystemRunInfo(sysRunInfo) != Error_Succeed || sysRunInfo.eAppBootState == AppBootState_CallAccessAuth)
|
|
|
+ GetFunction()->GetPrivilegeFunction()->RefreshAppBootState(AppBootState_FirstEnterMainPage);
|
|
|
|
|
|
CSmartPointer<IConfigInfo> spConfigRun;
|
|
|
ErrorCodeEnum eErr = GetFunction()->OpenConfig(Config_Run, spConfigRun);
|
|
@@ -1302,8 +1298,6 @@ void CHealthManagerEntity::OnSysVarEvent(const char *pszKey, const char *pszValu
|
|
|
}
|
|
|
else
|
|
|
m_bInMainPage = false;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
void CHealthManagerEntity::OnBroadcastEvent(CUUID SubID, const char *pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, CAutoBuffer Buffer)
|
|
@@ -1315,7 +1309,7 @@ void CHealthManagerEntity::OnTimeout(DWORD dwTimeID)
|
|
|
switch (dwTimeID)
|
|
|
{
|
|
|
case HEALTHMANAGER_WAIT_MAINPAGE_OPEN_TIMER_ID:
|
|
|
- if (!m_bHaveThrowMainPage)
|
|
|
+ if (!CheckIfHaveEnterMainPageEver())
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setResultCode("RTA5101")
|
|
|
("After receive accessauth success event, havn't receive enter main page.", m_maxWaitMainpageTime / 1000);
|
|
|
break;
|
|
@@ -1455,18 +1449,6 @@ namespace
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-bool CHealthManagerEntity::IsTestMode()
|
|
|
-{
|
|
|
- static int flag = -1;
|
|
|
- if (flag == -1) {
|
|
|
- CSystemRunInfo runInfo;
|
|
|
- bool result = (GetFunction()->GetSystemRunInfo(runInfo) == Error_Succeed
|
|
|
- && !!(runInfo.dwBootOption & SystemBootOptionEnum::BootOption_Test));
|
|
|
- flag = result ? 1 : 0;
|
|
|
- }
|
|
|
- return !!flag;
|
|
|
-}
|
|
|
-
|
|
|
void CHealthManagerEntity::OnEntityStateHook(const char* pszEntityName, const char* pszTriggerEntity, EntityStateEnum eState, EntityStateEnum eLastState)
|
|
|
{
|
|
|
CSmartPointer<IEntityFunction> pFunc = GetFunction();
|
|
@@ -1508,7 +1490,7 @@ void CHealthManagerEntity::OnEntityStateHook(const char* pszEntityName, const ch
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402501S1").setResultCode(csResultCode.GetData())(tmpWarnMsg.GetData());
|
|
|
//doing nothing before enter main page. HandShake will take it.
|
|
|
//AND if selfcheck is doing, no action at all
|
|
|
- if (m_bEnterMainPageEver && m_modRunInfo[pszEntityName].abnormalCount < m_maxAbnormalTimes && !m_modRunInfo[pszEntityName].bAbnormalBusy)
|
|
|
+ if (CheckIfHaveEnterMainPageEver() && m_modRunInfo[pszEntityName].abnormalCount < m_maxAbnormalTimes && !m_modRunInfo[pszEntityName].bAbnormalBusy)
|
|
|
{
|
|
|
m_modRunInfo[pszEntityName].bAbnormalBusy = true;
|
|
|
m_modRunInfo[pszEntityName].abnormalCount++;
|
|
@@ -1744,20 +1726,23 @@ void CHealthManagerEntity::EntityLostProc(CSimpleStringA entityName)
|
|
|
}
|
|
|
else
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("on lost start %d", eErrCode);
|
|
|
- if (m_bEnterMainPageEver && _strnicmp("TokenKeeper", entityName, strlen("TokenKeeper")) == 0)
|
|
|
+ if (CheckIfHaveEnterMainPageEver() && _strnicmp("TokenKeeper", entityName, strlen("TokenKeeper")) == 0)
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("TokenKeeper lost");
|
|
|
m_fsm.ToReAccessAuth();
|
|
|
}
|
|
|
m_modRunInfo[entityName].bAbnormalBusy = false;
|
|
|
}
|
|
|
-bool CHealthManagerEntity::CheckUIStateIsM()
|
|
|
+bool CHealthManagerEntity::CheckIfHaveEnterMainPageEver()
|
|
|
{
|
|
|
- if (m_bInMainPage)
|
|
|
- return true;
|
|
|
- CSimpleStringA uiState(true);
|
|
|
- if (GetFunction()->GetSysVar("UIState", uiState) != Error_Succeed || uiState.Compare("M") != 0)
|
|
|
- return false;
|
|
|
+ if (!m_bSayIdle)
|
|
|
+ {
|
|
|
+ CSystemRunInfo sysRunInfo;
|
|
|
+ if (GetFunction()->GetSystemRunInfo(sysRunInfo) == Error_Succeed && sysRunInfo.eAppBootState == AppBootState_FirstEnterMainPage)
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+ }
|
|
|
else
|
|
|
return true;
|
|
|
}
|