diff --git a/interfaces/innerkits/form_manager/include/form_constants.h b/interfaces/innerkits/form_manager/include/form_constants.h index 796d214f81f2ffa58b6aaec3babb59ee898d9bcd..51a1fd8269b3f47d7655ee338a09f34fe93057d3 100644 --- a/interfaces/innerkits/form_manager/include/form_constants.h +++ b/interfaces/innerkits/form_manager/include/form_constants.h @@ -44,6 +44,9 @@ namespace Constants { const std::string ACTION_UPDATEATTIMER = "form_update_at_timer"; const std::string KEY_WAKEUP_TIME = "wakeUpTime"; const std::string KEY_ACTION_TYPE = "form_update_action_type"; + const std::string ABS_CODE_PATH = "/data/app/el1/bundle/public"; + const std::string LOCAL_CODE_PATH = "/data/storage/el1/bundle"; + const std::string LOCAL_BUNDLES = "/data/bundles"; const int TYPE_RESET_LIMIT = 1; const int TYPE_STATIC_UPDATE = 2; const int TYPE_DYNAMIC_UPDATE = 3; diff --git a/services/formmgr/src/form_mgr_adapter.cpp b/services/formmgr/src/form_mgr_adapter.cpp index ed8dd2c6584c703f27d26e955c66ebfa00c1b0db..1534979cd2131dc40c14b5f792d255acf0d2d35c 100644 --- a/services/formmgr/src/form_mgr_adapter.cpp +++ b/services/formmgr/src/form_mgr_adapter.cpp @@ -14,6 +14,7 @@ */ #include +#include #include "appexecfwk_errors.h" #include "app_log_wrapper.h" @@ -1209,7 +1210,9 @@ ErrCode FormMgrAdapter::CreateFormItemInfo(const BundleInfo &bundleInfo, if (formInfo.moduleName == item.moduleName) { itemInfo.AddHapSourceDirs(item.moduleSourceDir); } - itemInfo.AddModuleInfo(item.moduleName, item.moduleSourceDir); + auto moduleSourceDir = std::regex_replace(item.moduleSourceDir, std::regex(Constants::ABS_CODE_PATH), + Constants::LOCAL_BUNDLES); + itemInfo.AddModuleInfo(item.moduleName, moduleSourceDir); } return ERR_OK; } @@ -1247,7 +1250,7 @@ int FormMgrAdapter::SetNextRefreshTime(const int64_t formId, const int64_t nextT APP_LOGE("%{public}s, not self form:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF; } - + // check bundleName if (bundleName != formRecord.bundleName) { APP_LOGE("%{public}s, not match bundleName:%{public}s", __func__, bundleName.c_str());