From 4a6c21a7a6fa6d60490c374a76f4f5a499a7ba36 Mon Sep 17 00:00:00 2001 From: caochufeng Date: Sat, 23 Aug 2025 10:40:13 +0800 Subject: [PATCH] fix: add wakeup code 57 Signed-off-by: caochufeng --- services/native/profile/power_wakeup_action.json | 5 +++++ .../src/wakeup_action/wakeup_action_source_parser.cpp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/services/native/profile/power_wakeup_action.json b/services/native/profile/power_wakeup_action.json index 5778295c..49ec6470 100644 --- a/services/native/profile/power_wakeup_action.json +++ b/services/native/profile/power_wakeup_action.json @@ -18,5 +18,10 @@ "scene": "UlsrLowRsoc", "action": 1, "description": "(such as)56 is a wakeup reason by reading node through HDI interface(GetWakeupReason)" + }, + "57": { + "scene": "UlsrWakeupAlarm", + "action": 0, + "description": "(such as)57 is a wakeup reason by reading node through HDI interface(GetWakeupReason)" } } \ No newline at end of file diff --git a/services/native/src/wakeup_action/wakeup_action_source_parser.cpp b/services/native/src/wakeup_action/wakeup_action_source_parser.cpp index 0e7e232c..282badee 100644 --- a/services/native/src/wakeup_action/wakeup_action_source_parser.cpp +++ b/services/native/src/wakeup_action/wakeup_action_source_parser.cpp @@ -115,7 +115,7 @@ bool WakeupActionSourceParser::ParseSourcesProc( std::shared_ptr& parseSources, cJSON* valueObj, std::string& key) { std::string scene{""}; - uint32_t action = 0; + uint32_t action = ILLEGAL_ACTION; if (PowerMgrJsonUtils::IsValidJsonObject(valueObj)) { cJSON* sceneValue = cJSON_GetObjectItemCaseSensitive(valueObj, WakeupActionSource::SCENE_KEY); if (PowerMgrJsonUtils::IsValidJsonString(sceneValue)) { @@ -127,12 +127,12 @@ bool WakeupActionSourceParser::ParseSourcesProc( action = static_cast(actionValue->valueint); POWER_HILOGI(FEATURE_WAKEUP_ACTION, "action=%{public}u", action); if (action >= ILLEGAL_ACTION) { - action = 0; + action = ILLEGAL_ACTION; } } } - if (action != 0) { + if (action != ILLEGAL_ACTION) { std::shared_ptr wakeupActionSource = std::make_shared(scene, action); parseSources->PutSource(key, wakeupActionSource); } -- Gitee