From: Caisking <3449750381@qq.com> Date: Mon, 4 Nov 2024 12:38:04 +0000 (+0800) Subject: 系统:增加vote运行状态 X-Git-Tag: fd230_release_V1.3.102~131^2~3 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=ce2d711e124229aa3421cc9eb21011de02fe92f9;p=mirrors%2FFD230.git 系统:增加vote运行状态 --- diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h index 3be8b491d..8720702b1 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h @@ -46,6 +46,7 @@ namespace OHOS std::string get_popup_windows_log(void); std::string get_system_screen_time(void); std::string get_uart_at_status(void); + std::string get_current_vote_status(void); private: DebugOutputViewEventListener(); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index 0f7303707..6fedbaa32 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -149,6 +149,8 @@ namespace OHOS debugOutputItemInfo[index++] = {index, "current_screen_time"}; //串口状态服务 debugOutputItemInfo[index++] = {index, "uart_service_status"}; + //Vote状态服务 + debugOutputItemInfo[index++] = {index, "vote_service_status"}; usedLen = index; /* -------------------------------- Add data -------------------------------- */ for (uint8_t i = 0; i < usedLen; i++) @@ -565,6 +567,13 @@ namespace OHOS bool status = logModel->get_uart_status(); return std::string("uart_at_status:") + std::to_string(status); } + //获取vote状态 + std::string DebugOutputViewEventListener::get_current_vote_status() { + // 获取系统日志实例 + char buf[256]; + get_vote_status(buf); + return std::string(buf); + } bool DebugOutputViewEventListener::OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) { std::string viewId = view.GetViewId(); @@ -664,6 +673,9 @@ namespace OHOS toggleButton->SetVisible(true); } } + break; + case 14: + str = get_current_vote_status(); break; default: str = "--"; diff --git a/code/sdk/application/wstp/at_service/app/app_at_process.c b/code/sdk/application/wstp/at_service/app/app_at_process.c index 8696c175f..f0450438c 100755 --- a/code/sdk/application/wstp/at_service/app/app_at_process.c +++ b/code/sdk/application/wstp/at_service/app/app_at_process.c @@ -1274,7 +1274,6 @@ static void pm_print_veto_info(void) for (i = 0; i < PM_ID_MAX; i++) { // wstp_print("sub_counts[%d] = %d\r\n", i, pm_veto_ptr->veto_counts.sub_counts[i]); wstp_print("sub_counts[%d] %s = %d\r\n", i,get_pm_id_name(i), pm_veto_ptr->veto_counts.sub_counts[i]); - } } diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 833419c57..651145d4a 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -24,6 +24,8 @@ #include "power_display_service.h" #include "los_base.h" #include "tcxo.h" +#include +#include "pm_veto.h" // #include "config/include/ConfigModelC.h" #ifdef SUPPORT_TCPIP @@ -1285,6 +1287,25 @@ void uapi_set_screen_on_api(void) { // display_api->set_screen_set_keepon_timeout(5000); } +//获取vote正在执行的状态 +errcode_t get_vote_status(char*str) +{ + uint8_t i = 0; + uint8_t falg = 0; + pm_veto_t *pm_veto_ptr = pm_veto_get_info(); + for (i = 0; i < PM_ID_MAX; i++) { + if (pm_veto_ptr->veto_counts.sub_counts[i] == 1) { + sprintf(str, "%s %s", str, get_pm_id_name(i)); + falg = 1; + } + } + if (falg==0) { + str = "没有正在进行的服务"; + } + PRINT("***************get_vote_status***************\n %s\n", str); + return ERRCODE_SUCC; +} + /*系统声音设置*/ void uapi_systemVolumeSet(int32_t sounding) { diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 726ff863f..6926468af 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -86,6 +86,8 @@ void print_current_time(void); errcode_t uapi_get_WeekStr(char *p_week); /*设置屏幕亮屏*/ void uapi_set_screen_on_api(void); +/*获取Vote状态*/ +errcode_t get_vote_status(char *str); /** * @brief 日期格式选项枚举