From 6eba03cba99cfa72e4e8ff0f9c6fa45674a060b1 Mon Sep 17 00:00:00 2001 From: zhong_ning Date: Thu, 15 Jul 2021 22:56:21 +0800 Subject: [PATCH] modify l2 init Signed-off-by: zhong_ning --- services/etc/init.cfg | 5 +++- services/etc/init.usb.configfs.cfg | 32 +++++++++++----------- services/log/init_log.h | 3 ++ services/param/client/param_request.c | 14 +++++----- services/param/include/param_manager.h | 1 + services/param/manager/param_trie.c | 4 +-- services/param/service/param_service.c | 4 +-- services/param/trigger/trigger_manager.c | 4 +-- services/param/trigger/trigger_processor.c | 6 ++-- services/src/init_read_cfg.c | 1 + 10 files changed, 41 insertions(+), 33 deletions(-) diff --git a/services/etc/init.cfg b/services/etc/init.cfg index 69485729..80028317 100755 --- a/services/etc/init.cfg +++ b/services/etc/init.cfg @@ -28,6 +28,9 @@ }, { "name" : "init", "cmds" : [ + "load_param /vendor/build.prop", + "load_param /vendor/default.prop", + "load_param /vendor/odm/etc/build.prop", "copy /proc/cmdline /dev/urandom", "copy /system/etc/prop.default /dev/urandom", "symlink /proc/self/fd/0 /dev/stdin", @@ -174,7 +177,7 @@ "export DOWNLOAD_CACHE /data/cache", "setrlimit RLIMIT_NICE 40 40", "setrlimit RLIMIT_NOFILE 32768 32768", - "write /sys/class/leds/vibrator/trigger \"transient\"", + "write /sys/class/leds/vibrator/trigger transient", "write /dev/cpu_variant:${ro.bionic.arch} ${ro.bionic.cpu_variant}", "chmod 0444 /dev/cpu_variant:${ro.bionic.arch}", "write /dev/cpu_variant:${ro.bionic.2nd_arch} ${ro.bionic.2nd_cpu_variant}", diff --git a/services/etc/init.usb.configfs.cfg b/services/etc/init.usb.configfs.cfg index 14eb2236..b80b4302 100755 --- a/services/etc/init.usb.configfs.cfg +++ b/services/etc/init.usb.configfs.cfg @@ -3,7 +3,7 @@ "name" : "param:sys.usb.config=none && param:sys.usb.configfs=1", "condition" : "sys.usb.config=none && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/UDC \"none\"", + "write /config/usb_gadget/g1/UDC none", "stop adbd", "setparam sys.usb.ffs.ready 0", "write /config/usb_gadget/g1/bDeviceClass 0", @@ -31,7 +31,7 @@ "name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=adb && param:sys.usb.configfs=1", "condition" : "sys.usb.ffs.ready=1 && sys.usb.config=adb && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"adb\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration adb", "symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", "setparam sys.usb.state ${sys.usb.config}" @@ -40,7 +40,7 @@ "name" : "param:sys.usb.config=mtp && param:sys.usb.configfs=1", "condition" : "sys.usb.config=mtp && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"mtp\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration mtp", "symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", "setparam sys.usb.state ${sys.usb.config}" @@ -55,7 +55,7 @@ "name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=mtp,adb && param:sys.usb.configfs=1", "condition" : "sys.usb.ffs.ready=1 && sys.usb.config=mtp,adb && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"mtp_adb\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration mtp_adb", "symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1", "symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", @@ -65,7 +65,7 @@ "name" : "param:sys.usb.config=ptp && param:sys.usb.configfs=1", "condition" : "sys.usb.config=ptp && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"ptp\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration ptp", "symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", "setparam sys.usb.state ${sys.usb.config}" @@ -80,7 +80,7 @@ "name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=ptp,adb && param:sys.usb.configfs=1", "condition" : "sys.usb.ffs.ready=1 && sys.usb.config=ptp,adb && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"ptp_adb\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration ptp_adb", "symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1", "symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", @@ -90,7 +90,7 @@ "name" : "param:sys.usb.config=accessory && param:sys.usb.configfs=1", "condition" : "sys.usb.config=accessory && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"accessory\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration accessory", "symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", "setparam sys.usb.state ${sys.usb.config}" @@ -105,7 +105,7 @@ "name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=accessory,adb && param:sys.usb.configfs=1", "condition" : "sys.usb.ffs.ready=1 && sys.usb.config=accessory,adb && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"accessory_adb\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration accessory_adb", "symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1", "symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", @@ -115,7 +115,7 @@ "name" : "param:sys.usb.config=audio_source && param:sys.usb.configfs=1", "condition" : "sys.usb.config=audio_source && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"audiosource\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration audiosource", "symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f1", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", "setparam sys.usb.state ${sys.usb.config}" @@ -130,7 +130,7 @@ "name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=audio_source,adb && param:sys.usb.configfs=1", "condition" : "sys.usb.ffs.ready=1 && sys.usb.config=audio_source,adb && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"audiosource_adb\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration audiosource_adb", "symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f1", "symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", @@ -140,7 +140,7 @@ "name" : "param:sys.usb.config=accessory,audio_source && param:sys.usb.configfs=1", "condition" : "sys.usb.config=accessory,audio_source && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"accessory_audiosource\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration accessory_audiosource", "symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1", "symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", @@ -156,7 +156,7 @@ "name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=accessory,audio_source,adb && param:sys.usb.configfs=1", "condition" : "sys.usb.ffs.ready=1 && sys.usb.config=accessory,audio_source,adb && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"accessory_audiosource_adb\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration accessory_audiosource_adb", "symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1", "symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2", "symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3", @@ -167,7 +167,7 @@ "name" : "param:sys.usb.config=midi && param:sys.usb.configfs=1", "condition" : "sys.usb.config=midi && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"midi\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration midi", "symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", "setparam sys.usb.state ${sys.usb.config}" @@ -182,7 +182,7 @@ "name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=midi,adb && param:sys.usb.configfs=1", "condition" : "sys.usb.ffs.ready=1 && sys.usb.config=midi,adb && sys.usb.configfs=1", "cmds" : [ - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"midi_adb\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration midi_adb", "symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1", "symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", @@ -193,7 +193,7 @@ "condition" : "sys.usb.config=rndis && sys.usb.configfs=1", "cmds" : [ "mkdir /config/usb_gadget/g1/functions/rndis.gs4", - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"rndis\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration rndis", "symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", "setparam sys.usb.state ${sys.usb.config}" @@ -209,7 +209,7 @@ "condition" : "sys.usb.ffs.ready=1 && sys.usb.config=rndis,adb && sys.usb.configfs=1", "cmds" : [ "mkdir /config/usb_gadget/g1/functions/rndis.gs4", - "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration \"rndis_adb\"", + "write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration rndis_adb", "symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1", "symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2", "write /config/usb_gadget/g1/UDC ${sys.usb.controller}", diff --git a/services/log/init_log.h b/services/log/init_log.h index 5e2bfe58..f46bf8e8 100644 --- a/services/log/init_log.h +++ b/services/log/init_log.h @@ -50,9 +50,11 @@ typedef enum InitLogLevel { #define INIT_LOGE(fmt, ...) InitToHiLog(INIT_LOG_TAG, LOG_ERROR, "%s : "fmt, (__FUNCTION__), ##__VA_ARGS__) #define INIT_LOGF(fmt, ...) InitToHiLog(INIT_LOG_TAG, LOG_FATAL, "%s : "fmt, (__FUNCTION__), ##__VA_ARGS__) +#define STARTUP_LOGD(LABEL, fmt, ...) InitToHiLog(LABEL, LOG_DEBUG, "%s : "fmt, (__FUNCTION__), ##__VA_ARGS__) #define STARTUP_LOGI(LABEL, fmt, ...) InitToHiLog(LABEL, LOG_INFO, "%s : "fmt, (__FUNCTION__), ##__VA_ARGS__) #define STARTUP_LOGE(LABEL, fmt, ...) InitToHiLog(LABEL, LOG_ERROR, "%s : "fmt, (__FUNCTION__), ##__VA_ARGS__) + void InitToHiLog(const char *tag, LogLevel logLevel, const char *fmt, ...); void SetHiLogLevel(LogLevel logLevel); @@ -64,6 +66,7 @@ void SetHiLogLevel(LogLevel logLevel); #define INIT_LOGE(fmt, ...) InitLog(INIT_LOG_TAG, INIT_ERROR, (__FILE_NAME__), (__LINE__), fmt"\n", ##__VA_ARGS__) #define INIT_LOGF(fmt, ...) InitLog(INIT_LOG_TAG, INIT_FATAL, (__FILE_NAME__), (__LINE__), fmt"\n", ##__VA_ARGS__) +#define STARTUP_LOGD(LABEL, fmt, ...) InitLog(LABEL, INIT_DEBUG, (__FILE_NAME__), (__LINE__), fmt "\n", ##__VA_ARGS__) #define STARTUP_LOGI(LABEL, fmt, ...) InitLog(LABEL, INIT_INFO, (__FILE_NAME__), (__LINE__), fmt "\n", ##__VA_ARGS__) #define STARTUP_LOGE(LABEL, fmt, ...) InitLog(LABEL, INIT_ERROR, (__FILE_NAME__), (__LINE__), fmt "\n", ##__VA_ARGS__) diff --git a/services/param/client/param_request.c b/services/param/client/param_request.c index bf8af809..e5585666 100644 --- a/services/param/client/param_request.c +++ b/services/param/client/param_request.c @@ -30,7 +30,7 @@ static ParamWorkSpace g_paramWorkSpaceReadOnly = {ATOMIC_VAR_INIT(0), {}, {}, {} static void OnWrite(uv_write_t *req, int status) { - PARAM_LOGI("OnWrite status %d", status); + PARAM_LOGD("OnWrite status %d", status); } static void OnReceiveAlloc(uv_handle_t* handle, size_t suggestedSize, uv_buf_t* buf) @@ -38,13 +38,13 @@ static void OnReceiveAlloc(uv_handle_t* handle, size_t suggestedSize, uv_buf_t* // 这里需要按实际回复大小申请内存,不需要大内存 buf->base = (char *)malloc(sizeof(ResponseMsg)); buf->len = sizeof(ResponseMsg); - PARAM_LOGI("OnReceiveAlloc handle %p %zu", handle, suggestedSize); + PARAM_LOGD("OnReceiveAlloc handle %p %zu", handle, suggestedSize); } static void OnReceiveResponse(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf) { RequestNode *req = ParamEntry(handle, RequestNode, handle); - PARAM_LOGI("OnReceiveResponse %p", handle); + PARAM_LOGD("OnReceiveResponse %p", handle); if (nread <= 0 || buf == NULL || handle == NULL || buf->base == NULL) { if (buf != NULL && buf->base != NULL) { free(buf->base); @@ -57,7 +57,7 @@ static void OnReceiveResponse(uv_stream_t *handle, ssize_t nread, const uv_buf_t } ResponseMsg *response = (ResponseMsg *)(buf->base); PARAM_CHECK(response != NULL, return, "The response is null"); - PARAM_LOGI("OnReceiveResponse %p cmd %d result: %d", handle, response->type, response->result); + PARAM_LOGD("OnReceiveResponse %p cmd %d result: %d", handle, response->type, response->result); switch (response->type) { case SET_PARAM: req->result = response->result; @@ -66,7 +66,7 @@ static void OnReceiveResponse(uv_stream_t *handle, ssize_t nread, const uv_buf_t PARAM_LOGE("not supported the command: %d", response->type); break; } - PARAM_LOGE("Close handle %p", handle); + PARAM_LOGD("Close handle %p", handle); free(buf->base); uv_close((uv_handle_t*)handle, NULL); uv_stop(req->loop); @@ -76,7 +76,7 @@ static void OnConnection(uv_connect_t *connect, int status) { PARAM_CHECK(status >= 0, return, "Failed to conntect status %s", uv_strerror(status)); RequestNode *request = ParamEntry(connect, RequestNode, connect); - PARAM_LOGI("Connect to server handle %p", &(request->handle)); + PARAM_LOGD("Connect to server handle %p", &(request->handle)); uv_buf_t buf = uv_buf_init((char*)&request->msg, request->msg.contentSize + sizeof(request->msg)); int ret = uv_write2(&request->wr, (uv_stream_t*)&(request->handle), &buf, 1, (uv_stream_t*)&(request->handle), OnWrite); PARAM_CHECK(ret >= 0, return, "Failed to uv_write2 porperty"); @@ -107,7 +107,7 @@ int SystemSetParameter(const char *name, const char *value) int ret = CheckParamName(name, 0); PARAM_CHECK(ret == 0, return ret, "Illegal param name"); - PARAM_LOGI("StartRequest %s", name); + PARAM_LOGD("StartRequest %s", name); u_int32_t msgSize = sizeof(RequestMsg) + strlen(name) + strlen(value) + 2; RequestNode *request = (RequestNode *)malloc(sizeof(RequestNode) + msgSize); PARAM_CHECK(request != NULL, return -1, "Failed to malloc for connect"); diff --git a/services/param/include/param_manager.h b/services/param/include/param_manager.h index 96e75434..dc969651 100644 --- a/services/param/include/param_manager.h +++ b/services/param/include/param_manager.h @@ -66,6 +66,7 @@ typedef enum { #define PARAM_LOGI(fmt, ...) STARTUP_LOGI(LABEL, fmt, ##__VA_ARGS__) #define PARAM_LOGE(fmt, ...) STARTUP_LOGE(LABEL, fmt, ##__VA_ARGS__) +#define PARAM_LOGD(fmt, ...) STARTUP_LOGD(LABEL, fmt, ##__VA_ARGS__) #define PARAM_CHECK(retCode, exper, ...) \ if (!(retCode)) { \ diff --git a/services/param/manager/param_trie.c b/services/param/manager/param_trie.c index f93bb650..cfe7ee75 100644 --- a/services/param/manager/param_trie.c +++ b/services/param/manager/param_trie.c @@ -82,7 +82,7 @@ int InitWorkSpace_(WorkSpace *workSpace, int mode, int prot, u_int32_t spaceSize return PARAM_CODE_INVALID_PARAM, "Invalid param %s", workSpace->fileName); PARAM_CHECK(workSpace->compareTrieNode != NULL, return PARAM_CODE_INVALID_PARAM, "Invalid param %s", workSpace->fileName); - PARAM_LOGI("InitWorkSpace %s ", workSpace->fileName); + PARAM_LOGD("InitWorkSpace %s ", workSpace->fileName); CheckAndCreateDir(workSpace->fileName); int fd = open(workSpace->fileName, mode, 00777); //0444); @@ -111,7 +111,7 @@ int InitWorkSpace_(WorkSpace *workSpace, int mode, int prot, u_int32_t spaceSize workSpace->area = (WorkArea*)areaAddr; workSpace->rootNode = GetTrieNode(workSpace, &workSpace->area->firstNode); } - PARAM_LOGI("InitWorkSpace success, readOnly %d currOffset %u firstNode %u dataSize %u", + PARAM_LOGD("InitWorkSpace success, readOnly %d currOffset %u firstNode %u dataSize %u", readOnly, workSpace->area->currOffset, workSpace->area->firstNode, workSpace->area->dataSize); return 0; } diff --git a/services/param/service/param_service.c b/services/param/service/param_service.c index b37197d2..6e089c78 100644 --- a/services/param/service/param_service.c +++ b/services/param/service/param_service.c @@ -110,7 +110,7 @@ static int ProcessParamSet(RequestMsg *msg) int ret = GetSubStringInfo(msg->content, msg->contentSize, '=', info, sizeof(info)/sizeof(info[0])); PARAM_CHECK(ret >= 2, return ret, "Failed to get name from content %s", msg->content); - PARAM_LOGI("ProcessParamSet name %s value: %s", info[0].value, info[1].value); + PARAM_LOGD("ProcessParamSet name %s value: %s", info[0].value, info[1].value); ret = WriteParamWithCheck(&g_paramWorkSpace, &msg->securitylabel, info[0].value, info[1].value); PARAM_CHECK(ret == 0, return ret, "Failed to set param %d name %s %s", ret, info[0].value, info[1].value); ret = WritePersistParam(info[0].value, info[1].value); @@ -135,7 +135,7 @@ static void OnReceiveAlloc(uv_handle_t *handle, size_t suggestedSize, uv_buf_t* static void OnWriteResponse(uv_write_t *req, int status) { // 发送成功,释放请求内存 - PARAM_LOGI("OnWriteResponse status %d", status); + PARAM_LOGD("OnWriteResponse status %d", status); ResponseNode *node = (ResponseNode*)req; free(node); } diff --git a/services/param/trigger/trigger_manager.c b/services/param/trigger/trigger_manager.c index 4c78c6f0..685bd0a2 100644 --- a/services/param/trigger/trigger_manager.c +++ b/services/param/trigger/trigger_manager.c @@ -228,7 +228,7 @@ int ParseTrigger(TriggerWorkSpace *workSpace, cJSON *triggerItem) PARAM_LOGE("Warning parseTrigger %s %s", name, condition); } } - PARAM_LOGI("ParseTrigger %s %u", name, offset); + PARAM_LOGD("ParseTrigger %s %u", name, offset); // 添加命令行 cJSON* cmdItems = cJSON_GetObjectItem(triggerItem, CMDS_ARR_NAME_IN_JSON); @@ -332,7 +332,7 @@ static int CheckTrigger_(TriggerWorkSpace *workSpace, static TRIGGER_MATCH triggerCheckMatch[TRIGGER_MAX] = { CheckBootTriggerMatch, CheckParamTriggerMatch, CheckOtherTriggerMatch }; - PARAM_LOGI("CheckTrigger_ content %s ", content); + PARAM_LOGD("CheckTrigger_ content %s ", content); PARAM_CHECK(calculator != NULL, return -1, "Failed to check calculator"); PARAM_CHECK(CHECK_INDEX_VALID(workSpace, type), return -1, "Invalid type %d", type); PARAM_CHECK((u_int32_t)type < sizeof(triggerCheckMatch) / sizeof(triggerCheckMatch[0]), diff --git a/services/param/trigger/trigger_processor.c b/services/param/trigger/trigger_processor.c index 99486cf8..7b97f3d2 100644 --- a/services/param/trigger/trigger_processor.c +++ b/services/param/trigger/trigger_processor.c @@ -30,7 +30,7 @@ static TriggerWorkSpace g_triggerWorkSpace = {}; static int DoCmdExecute(TriggerNode *trigger, const char *cmdName, const char *command) { PARAM_CHECK(trigger != NULL && cmdName != NULL && command != NULL, return -1, "Invalid param"); - PARAM_LOGI("DoCmdExecute trigger %s cmd %s %s", trigger->name, cmdName, command); + PARAM_LOGD("DoCmdExecute trigger %s cmd %s %s", trigger->name, cmdName, command); if (strncmp(cmdName, TRIGGER_CMD, strlen(TRIGGER_CMD)) == 0) { DoTriggerExec(command); return 0; @@ -155,7 +155,7 @@ void PostParamTrigger(const char *name, const char *value) void PostTrigger(EventType type, const char *content, u_int32_t contentLen) { - PARAM_LOGI("PostTrigger %d %s", type, content); + PARAM_LOGD("PostTrigger %d %s", type, content); PARAM_CHECK(content != NULL && contentLen > 0, return, "Invalid param"); TriggerDataEvent *event = (TriggerDataEvent *)malloc(sizeof(TriggerDataEvent) + contentLen + 1); PARAM_CHECK(event != NULL, return, "Failed to alloc memory"); @@ -165,7 +165,7 @@ void PostTrigger(EventType type, const char *content, u_int32_t contentLen) memcpy_s(event->content, contentLen, content, contentLen); event->content[contentLen] = '\0'; SendTriggerEvent(event); - PARAM_LOGI("PostTrigger %d success", type); + PARAM_LOGD("PostTrigger %d success", type); } int ParseTriggerConfig(cJSON *fileRoot) diff --git a/services/src/init_read_cfg.c b/services/src/init_read_cfg.c index 7a95f567..a1621ffe 100644 --- a/services/src/init_read_cfg.c +++ b/services/src/init_read_cfg.c @@ -124,6 +124,7 @@ void InitReadCfg() LoadDefaultParams("/system/etc/prop.default"); LoadDefaultParams("/system/build.prop"); LoadDefaultParams("/system/buildz.prop"); + LoadDefaultParams("/product/build.prop"); #endif ParseInitCfg(INIT_CONFIGURATION_FILE); ParseOtherCfgs(); -- GitLab