From 25c48f9904e5a9c709f97087229e3bc4c9b75a56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=83=A1=E4=BC=A0=E5=86=9B?= <1224667075@qq.com> Date: Sat, 28 Sep 2024 23:37:24 +0000 Subject: [PATCH] Merge #1048 into sdk602patch0626 from refs/changes/1048/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 增加在ble断连后ANCS无法重新发现服务,直接尝试订阅,实测有改善消息通知失效问题(补 ) * refs/changes/1048/head: (3 commits squashed) - 增加在ble断连后ANCS无法重新发现服务,直接尝试订阅,实测有改善消息通知失效问题(补 ) - 修改省电模式改为进入省电模式后必须手动再开启通话和蓝牙 #395 - 日历增加上拉图标 #775 Signed-off-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1048 --- .../nativeui/calendar/include/CalendarView.h | 7 +++ .../nativeui/calendar/src/CalendarView.cpp | 54 ++++++++++++++++++- .../ble_service/bleservice/bleService.h | 4 ++ .../peripheral/config/include/ConfigModelC.h | 4 ++ .../peripheral/config/src/ConfigModel.cpp | 13 ++++- .../drivers/peripheral/utils/custom_utils.c | 5 ++ 6 files changed, 85 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/calendar/include/CalendarView.h b/code/sdk/application/wearable/fd230app/nativeui/calendar/include/CalendarView.h index 188ee0e5b..003a872c3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/calendar/include/CalendarView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/calendar/include/CalendarView.h @@ -44,6 +44,13 @@ private: UILabel *week_label[7]{nullptr}; UILabel *day_label[31]{nullptr}; UIImageView *imageview{nullptr}; + + UIImageAnimatorView *PullUpAnimatorView{nullptr}; // 上拉动画 + + ImageAnimatorInfo PullUpimageAnimatorInfo[70]{0}; + + const ImageInfo** PullUpimageAnimator_imageInfo{nullptr}; + uint32_t show_y=0; uint32_t show_m=0; uint32_t show_d=0; diff --git a/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarView.cpp b/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarView.cpp index dad82df23..ee3f7319f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarView.cpp @@ -7,6 +7,7 @@ #include "calendar/include/CalendarView.h" #include "calendar/include/CalendarModel.h" +#include "uicomponents/UIComponents.h" #include "wearable_log.h" #include "UiConfig.h" @@ -18,6 +19,18 @@ static CalendarView *g_pMainView_CalendarView = nullptr; static char *dial_id_str[]={"7","8","9","C","%","4","5","6","÷","x","1","2","3","-","+","","0",".","=",""}; +static constexpr int16_t PULLUP_ANIMATOR_VIEW_X = 213; +static constexpr int16_t PULLUP_ANIMATOR_VIEW_Y = 380; +static constexpr int16_t PULLUP_ANIMATOR_VIEW_W = 40; +static constexpr int16_t PULLUP_ANIMATOR_VIEW_H = 40; +static constexpr int16_t PULLUP_ANIMATOR_VIEW_NUM_FRAMES = 70; +static constexpr int16_t PULLUP_ANIMATOR_VIEW_TIME = 100; + + +static constexpr const char *PullUpPaths = "/user/res/weather/PullUp/PullUp_"; + +static constexpr const char *stepPaths = "/user/res/step/"; + CalendarView::CalendarView() { @@ -66,6 +79,15 @@ CalendarView::~CalendarView() day_label[i] =nullptr; } } + + if (PullUpAnimatorView != nullptr) + { + PullUpAnimatorView->Stop(); + delete PullUpAnimatorView; + PullUpAnimatorView = nullptr; + } + + FreeImageInfoArray(PullUpimageAnimator_imageInfo,PullUpPaths, PULLUP_ANIMATOR_VIEW_NUM_FRAMES); delete group; group =nullptr; @@ -314,7 +336,37 @@ bool CalendarView::Label_init() } day_label[i]->SetVisible(true); } - + + PullUpimageAnimator_imageInfo =CreateImageInfoArray(PullUpPaths, PULLUP_ANIMATOR_VIEW_NUM_FRAMES); + if (PullUpAnimatorView == nullptr) + { + PullUpAnimatorView = new UIImageAnimatorView(); + if (PullUpAnimatorView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PullUpAnimatorView new fail"); + return false; + } + for (uint8_t i = 0; i < PULLUP_ANIMATOR_VIEW_NUM_FRAMES; i++) + { + //PullUpimageAnimatorInfo[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(PullUpPathsArray[i]); + //PullUpimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO; + PullUpimageAnimatorInfo[i].imageInfo = PullUpimageAnimator_imageInfo[i]; + //PullUpPathsArray[i]; + PullUpimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO; + PullUpimageAnimatorInfo[i].pos.x = PULLUP_ANIMATOR_VIEW_X; + PullUpimageAnimatorInfo[i].pos.y = PULLUP_ANIMATOR_VIEW_Y; + PullUpimageAnimatorInfo[i].width = PULLUP_ANIMATOR_VIEW_W; + PullUpimageAnimatorInfo[i].height = PULLUP_ANIMATOR_VIEW_H; + } + PullUpAnimatorView->SetPosition(PULLUP_ANIMATOR_VIEW_X, PULLUP_ANIMATOR_VIEW_Y, PULLUP_ANIMATOR_VIEW_W, PULLUP_ANIMATOR_VIEW_H); + PullUpAnimatorView->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + PullUpAnimatorView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + PullUpAnimatorView->SetImageAnimatorSrc(PullUpimageAnimatorInfo, PULLUP_ANIMATOR_VIEW_NUM_FRAMES, PULLUP_ANIMATOR_VIEW_TIME); + PullUpAnimatorView->SetRepeat(true); + PullUpAnimatorView->Start(); + } + group->Add(PullUpAnimatorView); + return true; } diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.h b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.h index d15462d48..ff5cb03fe 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.h @@ -66,6 +66,10 @@ void send_pair_succ(bd_addr_t *addr); errcode_t svr_ble_read_data_value_updata_noyify(void); +void ble_test_ANCS(void); + +void ble_test_ANCS_notify(uint8_t type); + #ifdef __cplusplus } #endif diff --git a/code/sdk/drivers/peripheral/config/include/ConfigModelC.h b/code/sdk/drivers/peripheral/config/include/ConfigModelC.h index 003da1c7d..6d998b528 100644 --- a/code/sdk/drivers/peripheral/config/include/ConfigModelC.h +++ b/code/sdk/drivers/peripheral/config/include/ConfigModelC.h @@ -81,6 +81,10 @@ bool cm_get_HFP_switch(void); bool cm_get_A2DP_switch(void); +void cm_set_HFP_switch(bool value); + + void cm_set_A2DP_switch(bool value); + void cm_set_timezone_quarters(int16_t timezone_quarters); diff --git a/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp b/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp index 386b99d4b..6810e6b80 100644 --- a/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp +++ b/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp @@ -806,7 +806,7 @@ namespace OHOS { set_condigData_Bool(CONFIGMODEL_ITEM_HFP,value); } - + //获取HFP开启状态 bool ConfigModel::GetHFPState(void) { @@ -1575,6 +1575,17 @@ bool mmi_play_vibrate_is_permitted(void) return true; } +void cm_set_HFP_switch(bool value) +{ + OHOS::ConfigModel::GetInstance()->set_condigData_Bool(OHOS::ConfigModel::CONFIGMODEL_ITEM_HFP,value); +} + + void cm_set_A2DP_switch(bool value) +{ + OHOS::ConfigModel::GetInstance()->set_condigData_Bool(OHOS::ConfigModel::CONFIGMODEL_ITEM_A2DP,value); +} + + // stop play music void mmi_stop_music_play(void) { diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 3f7c02ddb..1f4859b9b 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -37,6 +37,7 @@ #include "producttest/include/testTPC.h" #include "system/include/SystemPresenterC.h" #include "producttest/include/testPresenterC.h" +#include "ConfigModelC.h" #endif #include #include @@ -2368,6 +2369,10 @@ void uapi_enter_power_saving_mode(void) //关br 保持ble连接 uapi_close_br_scan(); + cm_set_HFP_switch(false); + + cm_set_A2DP_switch(false); + //关闭cat1 if(uapi_dev_runtime_get_cat1_powerstat()) { -- 2.17.1