From d0364aa4ac88cabc4a17c7cf0e4a7e2aa16f3522 Mon Sep 17 00:00:00 2001 From: wangdengjia Date: Mon, 9 May 2022 16:16:45 +0800 Subject: [PATCH] IssueNo:#I56HVU Description:Turn off the watchdog during scanning third app Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangdengjia Change-Id: Idfd3a09ad0d7d7f96c4e4f61a29f5a752efe23f4 --- services/bundlemgr_lite/src/gt_bundle_manager_service.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp index 34ce128..d9ea48e 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -301,6 +301,7 @@ void GtManagerService::InstallPreBundle(List systemPathList, } // scan system apps and third system apps + DisableServiceWdg(); ScanSystemApp(uninstallRecord, &systemPathList_); if (uninstallRecord != nullptr) { cJSON_Delete(uninstallRecord); @@ -308,6 +309,7 @@ void GtManagerService::InstallPreBundle(List systemPathList, // scan third apps ScanThirdApp(INSTALL_PATH, &systemPathList_); + EnableServiceWdg(); for (auto node = systemPathList.Begin(); node != systemPathList.End(); node = node->next_) { ToBeInstalledApp *toBeInstalledApp = node->value_; if (!BundleUtil::IsFile(toBeInstalledApp->path) || @@ -825,9 +827,7 @@ void GtManagerService::TransformJsToBc(const char *codePath, const char *bundleJ return; } - DisableServiceWdg(); EXECRES result = walk_directory(jsPath); - EnableServiceWdg(); HILOG_INFO(HILOG_MODULE_AAFWK, "[BMS] transform js to bc, result is %{public}d", result); if (result != EXCE_ACE_JERRY_EXEC_OK) { result = walk_del_bytecode(jsPath); @@ -1000,6 +1000,7 @@ void GtManagerService::QueryPreAppInfo(const char *appDir, PreAppList *list) } char *fileName = reinterpret_cast(AdapterMalloc(MAX_NAME_LEN + 1)); if (fileName == nullptr) { + closedir(dir); return; } while ((ent = readdir(dir)) != nullptr) { @@ -1035,6 +1036,7 @@ void GtManagerService::QueryPreAppInfo(const char *appDir, PreAppList *list) AdapterFree(appPath); } AdapterFree(fileName); + closedir(dir); } void GtManagerService::InsertPreAppInfo(const char *filePath, PreAppList *list)