Browse Source

Z991239-2089 #comment 修复对MediaController的特殊处理是的参考:参考ie启动变成参考是否曾经进入首页

杨诗友80174847 4 năm trước cách đây
mục cha
commit
ac64e4d554

+ 12 - 13
Module/mod_selfchecker/SelfCheckerFSM.cpp

@@ -115,7 +115,8 @@ void CSelfCheckerFSM::s0_on_entry()
 		CSmartPointer<IEntityFunctionPrivilege> pFuncPrivilege = pFunc.ConvertCase<IEntityFunctionPrivilege>();
 		CEntityRunInfo runInfo;
 		eErr = pFunc->GetEntityRunInfo(tmpNames[i], runInfo);
-		if (runInfo.eState != EntityState_NoStart)
+		if (runInfo.eState != EntityState_NoStart
+			|| tmpNames[i] == "Download" || tmpNames[i] == "UpgradeRun" || tmpNames[i] == "UpgradeManager")
 		{
 			Dbg("Add entity %s",(const char*)tmpNames[i]);
 			m_allEntity.push_back(tmpNames[i]);
@@ -729,7 +730,9 @@ void CSelfCheckerFSM::DoOnClosed(const char *pszEntityName,EntityCloseCauseEnum
 				if(!strncmp(pszEntityName,*it,it->GetLength()))
 				{
 					Dbg("onclosed %s",pszEntityName);
-					m_activeEntity.erase(it);
+					//oilyang@20210425 as almost all entity's start configure have been set to 0(can be ignored)
+					//no need to erase the m_activeEntity any more
+					//m_activeEntity.erase(it);
 					break;
 				}
 			}
@@ -771,20 +774,14 @@ void CSelfCheckerFSM::OnAnswer(CSmartPointer<IAsynWaitSp> pAsynWaitSp)
 		ErrorCodeEnum eErr;
 		CSmartPointer<IEntityFunction> pFunc = GetEntityBase()->GetFunction();
 		CSmartPointer<IEntityFunctionPrivilege> pFuncPrivilege = pFunc.ConvertCase<IEntityFunctionPrivilege>();
-		//TODO(Gifur@20210507) Linux Platform has no IEBrowser!!
-		CEntityRunInfo ieInfo;
-		eErr = pFunc->GetEntityRunInfo("IEBrowser",ieInfo);
-		const bool bIEStarted = (eErr == Error_Succeed && ieInfo.eState != EntityState_NoStart);
-
 		if (_strnicmp("MediaController", (const char*)new_entry->EntityName, strlen("MediaController")) == 0
-			&& !bIEStarted)
+			&& !m_bEverInMainPage)
 		{
 			Dbg("On loading stage,don't process MediaController exception.");
 		}
-		else {
-            //ExceptionErrorProcess(new_entry->EntityName,new_entry->ErrorResult);
-            Proc((const char*)new_entry->EntityName, ProcType_Shake, new_entry->ErrorResult);
-		}
+		else
+			//ExceptionErrorProcess(new_entry->EntityName,new_entry->ErrorResult);
+			Proc((const char*)new_entry->EntityName,ProcType_Shake,new_entry->ErrorResult);
 	}
 	else
 	{
@@ -1490,9 +1487,11 @@ ErrorCodeEnum CSelfCheckerFSM::ExceptionErrorProcessXml(ProcType eType, const ch
 									  }
 									  //oilyang@20200403
 									  //for fwb test,PinPad&CardSwiper can't be stop immediately
+									  //huchen@20210220,SIPPhone can't be stop immediately
 									  if (_strnicmp("PinPad", pszEntityName, strlen("PinPad")) == 0
 										  || _strnicmp("CardSwiper", pszEntityName, strlen("CardSwiper")) == 0
-										  || _strnicmp("Sensors", pszEntityName, strlen("Sensors")) == 0
+										  //oilyang@20210220 for huchen add SIPPhone
+										  || _strnicmp("SIPPhone", pszEntityName, strlen("SIPPhone")) == 0
 										  || _strnicmp("IDCertificate", pszEntityName, strlen("IDCertificate")) == 0
 										  || _strnicmp("FingerPrint", pszEntityName, strlen("FingerPrint")) == 0
 										  || _strnicmp("DeviceControl", pszEntityName, strlen("DeviceControl")) == 0)

+ 4 - 2
Module/mod_selfchecker/SelfCheckerFSM.h

@@ -150,7 +150,8 @@ public:
 		FSM_RULE_ENTRY(s0, s1, USER_EVT_INIT, 0)
 		END_FSM_RULE()
 
-		CSelfCheckerFSM() :m_warmLevel(0), m_bFirstCalcCpu(true), m_pHealthClient(NULL) , m_diskLastWarnHour(1){}
+		CSelfCheckerFSM() :m_warmLevel(0), m_bFirstCalcCpu(true), m_pHealthClient(NULL) , m_diskLastWarnHour(1)
+	, m_bEverInMainPage(false){}
 	~CSelfCheckerFSM(){}
 	virtual ErrorCodeEnum OnInit();
 	virtual ErrorCodeEnum OnExit();
@@ -182,6 +183,7 @@ public:
 	void SetEntityCfgInfo(const char *pszEntityName,int loadOpt){m_entRunInfo[pszEntityName].loadOpt = loadOpt;Dbg("%s,%d,%d",(LPCTSTR)pszEntityName,loadOpt,m_entRunInfo[pszEntityName].loadOpt);};
 	void SetEntityRestarting(const char* pszEntityName,bool flag) { m_entRunInfo[pszEntityName].bRestarting = flag;}
 	int Proc(string entity, ProcType eType, DWORD dwCode,const char *pszMessage="");
+	void SetEverEnterMainPageFlag(bool bValue = true) { m_bEverInMainPage = bValue; }
 private:
 	ErrorCodeEnum Initial();
 	void OnNormalWorkTimerout(void *pData);
@@ -208,7 +210,7 @@ private:
 	int m_restartNormal,m_restartSpecial,m_maxOsRestart,m_maxPowerRestart
 		,m_cpuHighPercent,m_memHighPercent,m_diskHighPercent,m_warmLevel,m_diskLastWarnHour;
 	DWORD m_dwIssueCount,m_dwCaptureCount;
-	bool m_bInIssue,m_bFirstCalcCpu;
+	bool m_bInIssue,m_bFirstCalcCpu, m_bEverInMainPage;
 	int m_simulateTest;
 	CSimpleStringA m_csKeyEntity,m_csMachineType,m_csSite;
 	__int64  m_xIdlePre,m_xKernelPre,m_xUserPre;

+ 13 - 2
Module/mod_selfchecker/mod_selfchecker.cpp

@@ -91,13 +91,13 @@ void CSelfCheckerEntity::OnEntityStateHook(const char *pszEntityName,const char
 		case EntityState_Lost:
 			//doing nothing except for loading stage. HandShake will take it.
 			//and only for MediaController module.
-			if (m_bIEIdle && _strnicmp("TokenKeeper",pszEntityName,strlen("TokenKeeper")) == 0)
+			if (m_bEverInMainPage && _strnicmp("TokenKeeper",pszEntityName,strlen("TokenKeeper")) == 0)
 			{
 				Dbg("TokenKeeper lost");
 				LogEvent(Severity_Middle,LOG_EVT_SELFCHECK_TOKEN_KEEPER_LOST,"TokenKeeper lost,restart and auth again.");
 				break;
 			}
-			if (m_bIEIdle)
+			if (m_bEverInMainPage)
 				break;
 			if (_strnicmp("MediaController",pszEntityName,strlen("MediaController")) != 0)
 				break;
@@ -399,6 +399,17 @@ ErrorCodeEnum CSelfCheckerEntity::RestartModule(const char* pEntityName)
 	m_fsm.SetEntityRestarting(pEntityName, false);
 	return Error_Succeed;
 }
+void CSelfCheckerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
+{
+	if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
+	{
+		if (_strnicmp(pszValue, "M", strlen("M")) == 0)
+		{
+			m_bEverInMainPage = true;
+			m_fsm.SetEverEnterMainPageFlag();
+		}
+	}
+}
 void AssistChannelSelfCheckerClient::OnMessage(ErrorCodeEnum Error, ChannelService_State_Info &Msg,  CSmartPointer<IReleasable> pData)	
 {
 

+ 5 - 3
Module/mod_selfchecker/mod_selfchecker.h

@@ -36,11 +36,11 @@ public:
 };
 
 
-class CSelfCheckerEntity : public CEntityBase,public IEntityLifeListener,public IEntityStateListener
+class CSelfCheckerEntity : public CEntityBase,public IEntityLifeListener,public IEntityStateListener, public ISysVarListener
 	,public ILogListener
 {
 public:
-	CSelfCheckerEntity():m_bIEIdle(false),m_pAssChanClient(NULL){ }
+	CSelfCheckerEntity():m_bIEIdle(false),m_pAssChanClient(NULL), m_bEverInMainPage(false){ }
 	virtual ~CSelfCheckerEntity() {}
 	virtual const char *GetEntityName() const { return "SelfChecker"; }
 	
@@ -133,6 +133,8 @@ public:
 	//ErrorCodeEnum AddEntity(vector<CSimpleStringA> &entityVec,const char *pszEntityName);
 	//ErrorCodeEnum RemoveEntity(vector<CSimpleStringA> &entityVec,const char *pszEntityName);
 	//ErrorCodeEnum CheckEntity();
+	virtual void OnSysVarEvent(const char* pszKey,
+		const char* pszValue, const char* pszOldValue, const char* pszEntityName);
 	virtual CServerSessionBase *OnNewSession(const char* /*pszRemoteEntityName*/, const char * /*pszParam*/)
 	{
 		return new SelfCheckerSession(this);
@@ -142,7 +144,7 @@ public:
 private:
 	CSelfCheckerFSM m_fsm;
 	map<CSimpleStringA,EntityProcessInfo> m_entityProcInfo;
-	bool m_bIEIdle;
+	bool m_bIEIdle, m_bEverInMainPage;
 	CUUID m_uuidCardIsuuer,m_uuidCardSwiper,m_uuidPinPad,m_uuidIDCertificate,m_uuidMedia;
 	AssistChannelSelfCheckerClient *m_pAssChanClient;
 	CSimpleStringA m_csQueryStateEntity;