|
|
@@ -124,7 +124,6 @@ ErrorCodeEnum CDeviceControlFSM::OnInit()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- DoBrowserCacheClearJob();
|
|
|
//DoRestartSogouServicesJob();
|
|
|
|
|
|
return Error_Succeed;
|
|
|
@@ -162,47 +161,6 @@ ErrorCodeEnum CDeviceControlFSM::InitializeTokenLib()
|
|
|
#endif //RVC_OS_WIN
|
|
|
}
|
|
|
|
|
|
-void CDeviceControlFSM::DoBrowserCacheClearJob()
|
|
|
-{
|
|
|
- LOG_FUNCTION();
|
|
|
-
|
|
|
- CSmartPointer<IConfigInfo> spConfig;
|
|
|
- ErrorCodeEnum err = GetEntityBase()->GetFunction()->OpenConfig(Config_Run, spConfig);
|
|
|
- CSimpleStringA str(true);
|
|
|
- err = spConfig->ReadConfigValue("Browser", "CacheClear", str);
|
|
|
- if (str.Compare("true", true) == 0) {
|
|
|
-
|
|
|
- BOOL bSucc(FALSE);
|
|
|
- CSimpleStringA strCachePath;
|
|
|
- GetEntityBase()->GetFunction()->GetPath("Temp", strCachePath);
|
|
|
- if (!strCachePath.IsNullOrEmpty()) {
|
|
|
-
|
|
|
- bSucc = TRUE;
|
|
|
-
|
|
|
- const char* cacheDirs[] = {"cefCache", "cefCache_Ad", "cefCache_breakdown", "cefCache_ErrNotify", "cefCache_main"
|
|
|
- , "UOSBrowser_Ad", "UOSBrowser_main" };
|
|
|
-
|
|
|
- for(int i=0; i<array_size(cacheDirs); ++i)
|
|
|
- {
|
|
|
- CSimpleStringA strcefCachePath(strCachePath);
|
|
|
- strcefCachePath += SPLIT_SLASH_STR;
|
|
|
- strcefCachePath += cacheDirs[i];
|
|
|
-
|
|
|
- if (ExistsDirA(strcefCachePath)) {
|
|
|
- RemoveDirRecursiveA(strcefCachePath);
|
|
|
- LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_BROWSER_CACHE_CLEAER,
|
|
|
- CSimpleStringA::Format("clear chromium browser cache: %s", strcefCachePath.GetData()));
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (bSucc) {
|
|
|
- spConfig->WriteConfigValue("Browser", "CacheClear", NULL);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
void CDeviceControlFSM::DoRestartSogouServicesJob()
|
|
|
{
|
|
|
LOG_FUNCTION();
|