#1237,Android app提示解绑失败后手表出现绿屏,出现3次bug 1561/2
authorluozheng <1732036298@qq.com>
Tue, 24 Dec 2024 02:33:50 +0000 (10:33 +0800)
committerluozheng <1732036298@qq.com>
Tue, 24 Dec 2024 02:33:50 +0000 (10:33 +0800)
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c
code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h
code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c
code/sdk/application/wearable/service/msg_center/include/notify/pairing_notification.h
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp

index f437c6c..294fef8 100644 (file)
@@ -727,7 +727,9 @@ void clearPaireFlag(uint8_t flag)
     \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
index 75ce71c..d5196b6 100644 (file)
@@ -98,6 +98,7 @@ typedef enum {
     TOPIC_EVENT_SLEEPNOTE, //睡眠通知
     TOPIC_EVENT_DEBUGOUTPUT,//开发调试专用窗口
     TOPIC_EVENT_ASSISTANT_NOTE,//语音助手结束
+    TOPIC_EVENT_SHUTDOWN_ANIMATIOR,//关机Animator
     TOPIC_END_NUM = 20000,
 } TopicNum;
 
index 77a8747..7404f17 100644 (file)
@@ -76,6 +76,7 @@ static const TopicToCore topicToCoreArray[] = {
     {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},
index ae032a7..3e76830 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @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
@@ -14,6 +14,8 @@ namespace OHOS
     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);
index 0ed4c27..9925903 100644 (file)
@@ -153,6 +153,7 @@ const PriorityMapper PRI_MAPPER[] = {
     {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;
@@ -234,6 +235,7 @@ void MsgCenterSubscribe()
     MsgCenterSubscribeTopic(TOPIC_EVENT_MESSAGENOTE);
     MsgCenterSubscribeTopic(TOPIC_EVENT_SLEEPNOTE);
     MsgCenterSubscribeTopic(TOPIC_EVENT_DEBUGOUTPUT);
+    MsgCenterSubscribeTopic(TOPIC_EVENT_SHUTDOWN_ANIMATIOR);
 }
 
 static OHOS::UIViewGroup* ShowGoalNotify(void)
@@ -326,6 +328,11 @@ static OHOS::UIViewGroup* showtransmitNotify(void)
     return OHOS::transmittingShow();
 }
 
+//关机动画
+static OHOS::UIViewGroup* showShutdownAnimatorNotify(void)
+{
+    return OHOS::showShutDownAnimation();
+}
 //无法呼叫sos
 static OHOS::UIViewGroup* showSOSNotify(void)
 {
@@ -335,7 +342,7 @@ 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;
 }
 /*显示睡眠提醒*/
@@ -386,7 +393,7 @@ void MsgCenterNotifyONtimeProc(const Topic topic, Request* req)
     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, "保存每小时站立数据");
@@ -1140,7 +1147,7 @@ void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req)
     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
 
@@ -1197,7 +1204,7 @@ void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req)
     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);
     }
    
     }
@@ -1492,6 +1499,17 @@ void MsgCenterNotifyDebugOutProc(const Topic topic, Request *req)
         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)
 {
@@ -1904,6 +1922,7 @@ static MsgCenterNotifyTable g_msgCenterNotifyTable[] = {
     {TOPIC_EVENT_MESSAGENOTE,MsgCenterNotifyMessageProc},
     {TOPIC_EVENT_SLEEPNOTE,MsgCenterNotifySleepProc},
     {TOPIC_EVENT_DEBUGOUTPUT,MsgCenterNotifyDebugOutProc},
+    {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,MsgCenterNotifyShutDownAnimatorProc},
 };
 
 static MsgCenterNotifyTable *MsgCenterGetNotifyTblCb(uint8_t idx)
index 2e08881..5837abb 100644 (file)
@@ -2,7 +2,7 @@
  * @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"
@@ -79,6 +79,9 @@ namespace OHOS
     ShutDownImageAnimatorView *p_ShutDownImageAnimatorView{nullptr}; // 关机动画
     UIViewGroup *ShutDownImageAnimatorGroupView{nullptr};
 
+    ShutDownImageAnimatorView *shutDownImageAnimatorView{nullptr}; // 关机动画
+    UIViewGroup *shutDownImageAnimatorGroupView{nullptr};
+
     PairingViewEventListener::PairingViewEventListener()
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PairingViewEventListener::PairingViewEventListener");
@@ -992,4 +995,33 @@ namespace OHOS
             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