\r
UnbindSucessCmd(1);//1确认解绑;\r
\r
- do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_RESTORE_FACTORY_SETTING, NULL, 0);//恢复出厂\r
+ // do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_RESTORE_FACTORY_SETTING, NULL, 0);//恢复出厂\r
+ uint8_t shutdowflag = 2;//恢复出厂\r
+ CustomEventPublish(TOPIC_EVENT_SHUTDOWN_ANIMATIOR, &shutdowflag, sizeof(shutdowflag));\r
//uapi_reboot_device();\r
}\r
void clearPaireCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totaldata,uint8_t crcvalue)//发送清除配对指令\r
TOPIC_EVENT_SLEEPNOTE, //睡眠通知
TOPIC_EVENT_DEBUGOUTPUT,//开发调试专用窗口
TOPIC_EVENT_ASSISTANT_NOTE,//语音助手结束
+ TOPIC_EVENT_SHUTDOWN_ANIMATIOR,//关机Animator
TOPIC_END_NUM = 20000,
} TopicNum;
{TOPIC_EVENT_MESSAGE_UPDATA,A_CORE_MASK, 1},
{TOPIC_EVENT_SLEEPNOTE,A_CORE_MASK, 1},
{TOPIC_EVENT_DEBUGOUTPUT,A_CORE_MASK, 1},
+ {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,A_CORE_MASK, 1},
#ifdef SUPPORT_CAT1_MODEM
{TOPIC_EVENT_CAT1_INCOMMING, A_CORE_MASK, 1},
{TOPIC_EVENT_CAT1_CALLCONNTED, A_CORE_MASK, 1},
/*
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-22 09:48:07
- * @LastEditors: SnickerSun snickersun@163.com
- * @LastEditTime: 2024-10-10 21:51:27
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-12-23 18:15:47
* @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/include/notify/pairing_notification.h
*/
#ifndef PAIRING_NOTIFICATION_H
UIViewGroup *CreateDeviceBindingView(void);
UIViewGroup *CreateDeviceUnBindingView(void);
UIViewGroup *CreateDeviceUnbindingRequestGroupView(void);
+ UIViewGroup *showShutDownAnimation(void);
+ void set_shutDownAnimation_falg(uint8_t falg);
void FreeDeviceBindingView(void);
void FreeDeviceUnBindingView(void);
{TOPIC_EVENT_MESSAGE_UPDATA,PRIORITY_TWO},//消息更新提醒 [3]
{TOPIC_EVENT_SLEEPNOTE,PRIORITY_THREE},//睡眠弹窗 [3]
{TOPIC_EVENT_DEBUGOUTPUT,PRIORITY_ONE},//开发调试专用窗口
+ {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,PRIORITY_ONE},//关机动画
};
bool g_pressFlag = false;
MsgCenterSubscribeTopic(TOPIC_EVENT_MESSAGENOTE);
MsgCenterSubscribeTopic(TOPIC_EVENT_SLEEPNOTE);
MsgCenterSubscribeTopic(TOPIC_EVENT_DEBUGOUTPUT);
+ MsgCenterSubscribeTopic(TOPIC_EVENT_SHUTDOWN_ANIMATIOR);
}
static OHOS::UIViewGroup* ShowGoalNotify(void)
return OHOS::transmittingShow();
}
+//关机动画
+static OHOS::UIViewGroup* showShutdownAnimatorNotify(void)
+{
+ return OHOS::showShutDownAnimation();
+}
//无法呼叫sos
static OHOS::UIViewGroup* showSOSNotify(void)
{
/*显示消息提醒*/
static OHOS::UIViewGroup *showMessageNotify(void) {
OHOS::UIViewGroup *view = OHOS::CreateMessageView();
- // printf("showMessageNotify %p",view);
+ printf("showMessageNotify %p",view);
return view;
}
/*显示睡眠提醒*/
AlarmClockEventData* time=(AlarmClockEventData*)req->data;
// The alarm notification is not displayed if the incoming call notification is already being processed
cywee_save_data();
-
+
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "保存每小时步数");
step_history_save(time->value);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "保存每小时站立数据");
else
#endif
{
- do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0);
+ do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0);
}
#ifdef SUPPORT_CAT1_HFP_AG_SERV
else
#endif
{
- do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0);
+ do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0);
}
}
NotificationManager::GetInstance()->ShowNotify(showDebugOutputNotify, (uint16_t)topic, true);
}
}
+
+//关机动画
+void MsgCenterNotifyShutDownAnimatorProc(const Topic topic, Request* req)
+{
+ unused(topic);
+ uint8_t* data=(uint8_t*)req->data;
+ set_shutDownAnimation_falg(data[0]);
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyShutDownAnimatorProc,shutdown_flag = %d",*data);
+ NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE);
+ NotificationManager::GetInstance()->ShowNotify(showShutdownAnimatorNotify, (uint16_t)topic, true);
+}
//每日训练数据刷新
void MsgCenterNotifyActivityProc(const Topic topic, Request* req)
{
{TOPIC_EVENT_MESSAGENOTE,MsgCenterNotifyMessageProc},
{TOPIC_EVENT_SLEEPNOTE,MsgCenterNotifySleepProc},
{TOPIC_EVENT_DEBUGOUTPUT,MsgCenterNotifyDebugOutProc},
+ {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,MsgCenterNotifyShutDownAnimatorProc},
};
static MsgCenterNotifyTable *MsgCenterGetNotifyTblCb(uint8_t idx)
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-22 10:04:36
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-11-05 14:57:06
+ * @LastEditTime: 2024-12-23 18:25:27
* @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp
*/
#include "notification_manager.h"
ShutDownImageAnimatorView *p_ShutDownImageAnimatorView{nullptr}; // 关机动画
UIViewGroup *ShutDownImageAnimatorGroupView{nullptr};
+ ShutDownImageAnimatorView *shutDownImageAnimatorView{nullptr}; // 关机动画
+ UIViewGroup *shutDownImageAnimatorGroupView{nullptr};
+
PairingViewEventListener::PairingViewEventListener()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PairingViewEventListener::PairingViewEventListener");
g_timer = NULL;
}
}
+ static uint8_t shutDownAnimation_falg = -1; //关机动画标志位
+ void set_shutDownAnimation_falg(uint8_t falg)
+ {
+ shutDownAnimation_falg = falg;
+ }
+ /*
+ * @brief 显示关机动画
+ */
+ UIViewGroup *showShutDownAnimation(void)
+ {
+ if (shutDownImageAnimatorView == nullptr)
+ {
+ shutDownImageAnimatorView = new ShutDownImageAnimatorView();
+ if (shutDownImageAnimatorView == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "shutDownImageAnimatorView new fail!!");
+ return nullptr;
+ }
+ shutDownImageAnimatorGroupView = shutDownImageAnimatorView->ShutDownAnimatorViewInit();
+ if (shutDownImageAnimatorGroupView == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "shutDownImageAnimatorGroupView new fail!!");
+ return nullptr;
+ }
+ shutDownImageAnimatorView->ShutDownImageAnimator_Start(shutDownAnimation_falg);
+ RootView::GetInstance()->ClearOnKeyActListener();
+ }
+ return shutDownImageAnimatorGroupView;
+ }
}
\ No newline at end of file