修复遥控拍死机bug
authorCaisking <3449750381@qq.com>
Tue, 16 Jul 2024 01:30:20 +0000 (09:30 +0800)
committerCaisking <3449750381@qq.com>
Tue, 16 Jul 2024 01:30:20 +0000 (09:30 +0800)
code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h
code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp
code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c
code/sdk/drivers/peripheral/utils/custom_utils.c

index ac29f22..1c82f41 100644 (file)
@@ -1,5 +1,5 @@
 
-/*** 
+/***
  * @Date: 2024-05-09 17:46:43
  * @LastEditors: Caisking 3449750381@qq.com
  * @LastEditTime: 2024-05-09 18:04:51
@@ -18,6 +18,11 @@ namespace OHOS
         ~TakephotosModel();
         static TakephotosModel *GetInstance(void);
         void Init();
+        void SetPopStaust(PopupPhoto status);
+        PopupPhoto GetPopStaust();
+
+    private:
+        PopupPhoto popupStatus = PopupPhoto::CreamPopup;
     };
 }
 #endif
\ No newline at end of file
index f97c774..eaa3c54 100644 (file)
@@ -1,3 +1,9 @@
+/***
+ * @Date: 2024-07-06 16:27:31
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-07-15 20:30:24
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp
+ */
 /***
  * @Date: 2024-05-09 17:46:58
  * @LastEditors: Caisking 3449750381@qq.com
@@ -86,14 +92,15 @@ extern "C"
         // 进入拍照界面
         if (request->msgId == TOPIC_EVENT_ENTER_CMAERA)
         {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP," 遥控拍照 \r\n");
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " 遥控拍照 \r\n");
             uapi_set_screen_on_api(); // 亮屏
+            TakephotosModel::GetInstance()->SetPopStaust(PopupPhoto::TakePopup);
             NativeAbility::GetInstance().EnterSlice(VIEW_TAKEPHOTOS);
-            TakephotosView::GetInstance()->SetPopupViewStatus(PopupPhoto::TakePopup, true);
         }
         // 退出拍照
         if (request->msgId == TOPIC_EVENT_CANCEL_CMAERA)
         {
+            TakephotosModel::GetInstance()->SetPopStaust(PopupPhoto::CreamPopup);
             NativeAbility::GetInstance().Back();
             cameraSend(3);
         }
@@ -126,4 +133,16 @@ namespace OHOS
         TakephotosSubscribeTopic(TOPIC_EVENT_ENTER_CMAERA); // 进行消息订阅
         TakephotosSubscribeTopic(TOPIC_EVENT_CANCEL_CMAERA);
     }
+
+    // 设置弹窗状态
+    void TakephotosModel ::SetPopStaust(PopupPhoto status)
+    {
+        popupStatus = status;
+    }
+
+    // 获取弹窗状态
+    PopupPhoto TakephotosModel ::GetPopStaust()
+    {
+        return popupStatus;
+    }
 }
\ No newline at end of file
index ca80e54..57bd488 100644 (file)
@@ -1,5 +1,6 @@
 
 #include "takephotos/include/TakephotosView.h"
+#include "takephotos/include/TakephotosModel.h"
 
 #include "common/image_cache_manager.h"
 #include "UiConfig.h"
@@ -39,8 +40,8 @@ namespace OHOS
             container_->SetPosition(0, 0, 466, 466);
             container_->SetStyle(STYLE_BACKGROUND_OPA, 0);
         }
-        // 展示无记录界面。后续需要加入函数判断
-        SetPopupViewStatus(PopupPhoto::CreamPopup, true);
+        PopupPhoto staust = TakephotosModel::GetInstance()->GetPopStaust();
+        SetPopupViewStatus(staust, true);
     }
 
     /* DeInit:删除组件 */
@@ -295,6 +296,7 @@ namespace OHOS
         ShowTakeView();
         PreLoad();
         RootView::GetInstance()->Add(container_);
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TakephotosView OnStart is ok");
     }
 
     UILabel *TakephotosView::GetClileLabel()
index 92af0fb..1d8c127 100644 (file)
@@ -3544,6 +3544,7 @@ static void carmeraCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totaldat
     if(Check_CRC(data,len,crcvalue))\r
     {\r
         uint8_t carmera_on = data[0]; //0退出拍照界面 1进入拍照界面\r
+        // printf("进入拍照\r\n");\r
         //需要加界面弹窗提示\r
         if(carmera_on == 1)//进入拍照界面\r
         {\r
index f3b1726..9bce883 100644 (file)
@@ -1005,7 +1005,7 @@ void uapi_set_screen_on_api(void)
         display_api->turn_on_screen();
     }
     // 设置屏幕亮5000
-    display_api->set_screen_set_keepon_timeout(5000);
+    // display_api->set_screen_set_keepon_timeout(5000);
 }
 
 /*系统声音设置*/