1 Star 0 Fork 2

heppen/customization_config_policy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-customization-config_policy.patch 4.49 KB
一键复制 编辑 原始数据 按行查看 历史
chrisshangguan 提交于 2023-06-16 17:53 . add config_policy
diff --git a/config_policy.gni b/config_policy.gni
index c4a6a69..1d0388e 100644
--- a/config_policy.gni
+++ b/config_policy.gni
@@ -16,5 +16,5 @@ declare_args() {
config_policy_fs_prefix = ""
# Whether support napi so
- support_config_policy_napi = true
+ support_config_policy_napi = false
}
diff --git a/frameworks/config_policy/BUILD.gn b/frameworks/config_policy/BUILD.gn
index 96ed151..effa0f9 100644
--- a/frameworks/config_policy/BUILD.gn
+++ b/frameworks/config_policy/BUILD.gn
@@ -53,7 +53,7 @@ if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") {
"etc:customization_etc",
"//third_party/bounds_checking_function:libsec_shared",
]
- external_deps = [ "init:libbegetutil" ]
+ # external_deps = [ "init:libbegetutil" ]
subsystem_name = "customization"
part_name = "config_policy"
diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c
index 1eb483c..f821693 100644
--- a/frameworks/config_policy/src/config_policy_utils.c
+++ b/frameworks/config_policy/src/config_policy_utils.c
@@ -22,9 +22,18 @@
#include "config_policy_impl.h"
#ifndef __LITEOS__
-#include "init_param.h"
+/* #include "init_param.h" */
#endif
+#define SystemGetParameter SystemReadParamStub
+static int SystemReadParamStub(const char *name, char *value, unsigned int *len)
+{
+ (void)name;
+ (void)value;
+ (void)len;
+ return -1;
+}
+
static const size_t MIN_APPEND_LEN = 32;
// ':' split different x rules, example:":relPath,mode[,extra][:]"
// ',' split different param for x rules
@@ -93,7 +102,6 @@ static char *CustGetSystemParam(const char *name)
{
char *value = NULL;
unsigned int len = 0;
-
if (SystemGetParameter(name, NULL, &len) != 0 || len == 0) {
return NULL;
}
diff --git a/frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp b/frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp
index f486dd8..bd84ab0 100644
--- a/frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp
+++ b/frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp
@@ -14,7 +14,7 @@
*/
#include "hisysevent_adapter.h"
-#include "hisysevent.h"
+// #include "hisysevent.h"
#include "hilog/log.h"
namespace OHOS {
@@ -22,23 +22,24 @@ namespace Customization {
namespace ConfigPolicy {
using namespace OHOS::HiviewDFX;
static constexpr HiLogLabel LABEL = { LOG_CORE, 0xD001E00, "ReportConfigPolicyEvent" };
-const std::string DOMAIN_STR = std::string(HiSysEvent::Domain::CUSTOMIZATION_CONFIG);
+// const std::string DOMAIN_STR = std::string(HiSysEvent::Domain::CUSTOMIZATION_CONFIG);
void ReportConfigPolicyEvent(ReportType reportType, const std::string &apiName, const std::string &msgInfo)
{
- int ret;
- if (reportType == ReportType::CONFIG_POLICY_FAILED) {
- ret = HiSysEvent::Write(DOMAIN_STR, "CONFIG_POLICY_FAILED", HiSysEvent::EventType::FAULT, "APINAME", apiName,
- "MSG", msgInfo);
- } else {
- ret =
- HiSysEvent::Write(DOMAIN_STR, "CONFIG_POLICY_EVENT", HiSysEvent::EventType::STATISTIC, "APINAME", apiName);
- }
+ return;
+ // int ret;
+ // if (reportType == ReportType::CONFIG_POLICY_FAILED) {
+ // ret = HiSysEvent::Write(DOMAIN_STR, "CONFIG_POLICY_FAILED", HiSysEvent::EventType::FAULT, "APINAME", apiName,
+ // "MSG", msgInfo);
+ // } else {
+ // ret =
+ // HiSysEvent::Write(DOMAIN_STR, "CONFIG_POLICY_EVENT", HiSysEvent::EventType::STATISTIC, "APINAME", apiName);
+ // }
- if (ret != 0) {
- HiLog::Error(LABEL, "hisysevent write failed! ret %{public}d, apiName %{public}s, errMsg %{public}s", ret,
- apiName.c_str(), msgInfo.c_str());
- }
+ // if (ret != 0) {
+ // HiLog::Error(LABEL, "hisysevent write failed! ret %{public}d, apiName %{public}s, errMsg %{public}s", ret,
+ // apiName.c_str(), msgInfo.c_str());
+ // }
}
} // namespace ConfigPolicy
} // namespace Customization
diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn
index 2640cea..bf4c27f 100644
--- a/interfaces/kits/js/BUILD.gn
+++ b/interfaces/kits/js/BUILD.gn
@@ -28,9 +28,8 @@ ohos_shared_library("configpolicy") {
deps = [ "//base/customization/config_policy/frameworks/config_policy:configpolicy_util" ]
external_deps = [
- "hisysevent_native:libhisysevent",
+ # "hisysevent_native:libhisysevent",
"hiviewdfx_hilog_native:libhilog",
- "napi:ace_napi",
]
relative_install_dir = "module"
subsystem_name = "customization"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/heppen/customization_config_policy.git
git@gitee.com:heppen/customization_config_policy.git
heppen
customization_config_policy
customization_config_policy
master

搜索帮助