From: Caisking <3449750381@qq.com> Date: Tue, 16 Jul 2024 01:30:20 +0000 (+0800) Subject: 修复遥控拍死机bug X-Git-Tag: release_V1.2.70_20241020_135402~807^2~7 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=2581741b954a7075daf1a9be5363fbcba719d12f;p=mirrors%2FFD230.git 修复遥控拍死机bug --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h index ac29f226f..1c82f4195 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp index f97c77475..eaa3c549c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp index ca80e54de..57bd4888f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp @@ -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() diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index 92af0fb98..1d8c127cd 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -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)) { uint8_t carmera_on = data[0]; //0退出拍照界面 1进入拍照界面 + // printf("进入拍照\r\n"); //需要加界面弹窗提示 if(carmera_on == 1)//进入拍照界面 { diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index f3b1726d5..9bce88341 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -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); } /*系统声音设置*/