From: SnickerSun Date: Thu, 28 Mar 2024 10:02:50 +0000 (+0800) Subject: 添加LowPowerAlarm Notify X-Git-Tag: release_V1.2.70_20241020_135402~1241^2~21^2~1^2 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=37a4684664a5c1fe5127d285676e87dbdef7133e;p=mirrors%2FFD230.git 添加LowPowerAlarm Notify --- diff --git a/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h b/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h index 71694573e..82d0a9fc8 100755 --- a/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h +++ b/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h @@ -48,6 +48,7 @@ typedef enum { #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION TOPIC_EVENT_CHARGE_PLUG, TOPIC_EVENT_CHARGE_UNPLUG, + TOPIC_EVENT_LOWPOWER_ALARM, #endif #ifdef SUPPORT_SPO2_NOTIFICATION TOPIC_EVENT_SPO2_UPDATE, diff --git a/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c b/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c index b41c00f25..46f02a6f3 100755 --- a/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c +++ b/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c @@ -44,6 +44,7 @@ static const TopicToCore topicToCoreArray[] = { #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION {TOPIC_EVENT_CHARGE_PLUG, A_CORE_MASK, 1}, {TOPIC_EVENT_CHARGE_UNPLUG, A_CORE_MASK, 1}, + {TOPIC_EVENT_LOWPOWER_ALARM, A_CORE_MASK, 1}, #endif #ifdef SUPPORT_CAT1_MODEM {TOPIC_EVENT_CAT1_INCOMMING, A_CORE_MASK, 1}, diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 5682646ad..e81516821 100755 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -53,6 +53,7 @@ const PriorityMapper g_pri_mapper[] = { #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION {TOPIC_EVENT_CHARGE_PLUG, PRIORITY_TWO}, {TOPIC_EVENT_CHARGE_UNPLUG, PRIORITY_TWO}, + {TOPIC_EVENT_LOWPOWER_ALARM,PRIORITY_TWO}, #endif {TOPIC_EVENT_HFP_INCOMMING, PRIORITY_ONE}, {TOPIC_EVENT_HFP_FINISHED, PRIORITY_ONE}, @@ -60,6 +61,7 @@ const PriorityMapper g_pri_mapper[] = { {TOPIC_EVENT_HFP_WATCH_ACTIVE, PRIORITY_ONE}, {TOPIC_EVENT_HFP_WATCH_TO_PHONE, PRIORITY_ONE}, {TOPIC_EVENT_HFP_PHONE_TO_WATCH, PRIORITY_ONE}, + #ifdef SUPPORT_CAT1_MODEM {TOPIC_EVENT_CAT1_INCOMMING, PRIORITY_ONE}, {TOPIC_EVENT_CAT1_CALLCONNTED, PRIORITY_ONE}, @@ -118,6 +120,7 @@ void MsgCenterSubscribe() #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_PLUG); MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_UNPLUG); + MsgCenterSubscribeTopic(TOPIC_EVENT_LOWPOWER_ALARM); #endif #ifdef SUPPORT_SPO2_NOTIFICATION_TEST MsgCenterSubscribeTopic(TOPIC_EVENT_SPO2_UPDATE); @@ -244,6 +247,23 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req) t->ChangeViewcolor(false); } } + +void MsgCenterNotifyLowPowerAlarmProc(const Topic topic, Request* req) +{ + unused(req); + unused(topic); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: LowPower Alarm !"); + //TODO: 亮屏弹窗倒计时5秒关机(不需要取消,强制关机) + // DialModelCharge::GetInstance()->UpdateChargeStuaut(0); + // SaveEleModel::GetInstance()->SetChargeStuaut(0); + + // testCHANINGView *t=testCHANINGView::GetInstance(); + // if(t!=NULL) + // { + // t->ChangeViewcolor(false); + // } +} + #endif void MsgCenterNotifyNextDayProc(const Topic topic, Request* req) { @@ -699,6 +719,7 @@ static msg_center_notify_table_t g_msg_center_notify_table[] = { #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION {TOPIC_EVENT_CHARGE_PLUG, MsgCenterNotifyChargePlugProc}, {TOPIC_EVENT_CHARGE_UNPLUG, MsgCenterNotifyChargeUnPlugProc}, + {TOPIC_EVENT_LOWPOWER_ALARM, MsgCenterNotifyLowPowerAlarmProc}, #endif #ifdef SUPPORT_SPO2_NOTIFICATION_TEST {TOPIC_EVENT_SPO2_UPDATE, MsgCenterNotifySPO2hProc},