From: SnickerSun Date: Fri, 11 Oct 2024 03:59:40 +0000 (+0800) Subject: patch_602_0911_to_1009 X-Git-Tag: release_V1.2.70_20241020_135402~87 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1155%2F1;p=mirrors%2FFD230.git patch_602_0911_to_1009 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h index 2fcb1eaad..8db8aa30b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h @@ -83,7 +83,6 @@ public: void OnSwipe(UISwipeView &view) override; void SetPage(int8_t id); void SetTaskPeroid(CardId cardId); - void setCallback(ZoomEffect *callback) { callback_ = callback; } void InitCardSettings(void); uint8_t GetCardSettingCount(void); @@ -116,7 +115,6 @@ private: void SetCircleProgress(void); void SetCompassRotate(void); KeyInputListener *keyActListener_{nullptr}; - ZoomEffect *callback_{nullptr}; uint8_t state_ = UICheckBox::UICheckBoxState::MAX_STATUS_NUM; int64_t playerCurrentTime_{0}; int64_t playerMusicDuration_{0}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/dial/DialVideoView.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/dial/DialVideoView.h index 7d4c1408b..6524ecb06 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/dial/DialVideoView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/dial/DialVideoView.h @@ -22,6 +22,7 @@ public: bool IsPaused(); bool IsPlayed(); bool IsStopped(); + MediaVideoPlay* GetVideoPlay(); private: FILE* fp_ = nullptr; diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/dial/DialViewGroup.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/dial/DialViewGroup.h index 8f139fbfa..69a46cd48 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/dial/DialViewGroup.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/dial/DialViewGroup.h @@ -114,7 +114,9 @@ public: void OnActive(void) override; void OnInactive(void) override; - + + MediaVideoPlay* GetVideoPlay(); + private: bool resLoadStatus{false}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp index f836bae7e..f69dc532d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp @@ -279,7 +279,7 @@ namespace OHOS /* -------------------------------------------------------------------------- */ CardId cardId = view_->GetHorCurrentCard(); - callback_->OnSwipe(view); + SetTaskPeroid(cardId); if (cardId == COMPASS) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp index dabb12302..b43e7ed71 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp @@ -254,6 +254,7 @@ namespace OHOS } } callback->isNeedClip_ = true; + callback->SetContainer(mainSwipeGroup); HorizontalViewInit(); HorViewLoad(); VerticalViewInit(); // 初始化上下拉界面 @@ -336,7 +337,7 @@ namespace OHOS } } } - presenter_->setCallback(callback); + mainSwipeGroup->SetOnSwipeListener(presenter_); mainSwipeGroup->SetOnLongPressListener(presenter_); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::InitPage over"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialVideoView.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialVideoView.cpp index 9472f94cd..13113cd1c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialVideoView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialVideoView.cpp @@ -123,4 +123,9 @@ bool DialVideoView::IsStopped() } return videoPlayer_->isExited_; } + +MediaVideoPlay* DialVideoView::GetVideoPlay() +{ + return videoPlayer_; +} } diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialViewGroup.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialViewGroup.cpp index 2406141b0..f0839bd46 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialViewGroup.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialViewGroup.cpp @@ -516,5 +516,12 @@ namespace OHOS kaleidoscope_->StopRotateAnimator(); kaleidoscope_->ClearFocus(); } +} +MediaVideoPlay* DialViewGroup::GetVideoPlay() +{ + if (video_ != nullptr) { + return video_->GetVideoPlay(); } + return nullptr; } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index df760d332..fd522a355 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -684,7 +684,8 @@ static void ScoDisconnectPro(void) // } ScoStatusCb(HFP_SCO_STATE_DISCONNECTED); - if (g_currCallState == HFP_HF_CALL_STATE_ACTIVE && g_scoFlag == HFP_SCO_STATE_DISCONNECTED) { + if ((g_currCallState == HFP_HF_CALL_STATE_ACTIVE && g_scoFlag == HFP_SCO_STATE_DISCONNECTED) || + (g_scoFlag == HFP_SCO_STATE_CONNECT_FAILURE)) { // The call is transferred from the watch to the phone. Need to close the call notification view. hfp_hf_calls_info_t call = {0}; HfpIncomingEventPublish(TOPIC_EVENT_HFP_WATCH_TO_PHONE, call); @@ -728,6 +729,12 @@ static void ScoStateChanged(const bd_addr_t *bdAddr, hfp_sco_connect_state_t sta PhoneServiceScreenCtr(0); break; + case HFP_SCO_STATE_CONNECT_FAILURE: + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoStateChanged] SCO connect failure!"); + ScoDisconnectPro(); + PhoneServiceScreenCtr(0); + break; + default: break; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h index 164879867..e4a513b61 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h @@ -54,7 +54,7 @@ private: virtual ~ApplistModel(); ApplistPresenter *presenter{nullptr}; - AppItem applist[APP_MAX_NUM] = { VIEW_INVALID, nullptr, nullptr, nullptr, nullptr }; + AppItem applist[APP_MAX_NUM] = { VIEW_INVALID, nullptr, nullptr, nullptr, nullptr, nullptr }; BundleInfo *bundleInfos = nullptr; int32 bundleLen = 0; uint8 appLen = 0; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h index ba4860287..d71271705 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h @@ -56,10 +56,6 @@ public: void OnSwipe(UISwipeView& view) override; void SetPage(int8_t id); void SetTaskPeroid(CardId cardId); - void setCallback(ZoomEffect* callback) - { - callback_ = callback; - } void InitCardSettings(void); uint8_t GetCardSettingCount(void); @@ -74,7 +70,6 @@ private: void SetCircleProgress(void); void SetCompassRotate(void); KeyInputListener *keyActListener_{nullptr}; - ZoomEffect* callback_{nullptr}; uint8_t state_ = UICheckBox::UICheckBoxState::MAX_STATUS_NUM; int64_t playerCurrentTime_{0}; int64_t playerMusicDuration_{0}; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h index 7d4c1408b..6524ecb06 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h @@ -22,6 +22,7 @@ public: bool IsPaused(); bool IsPlayed(); bool IsStopped(); + MediaVideoPlay* GetVideoPlay(); private: FILE* fp_ = nullptr; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h index db348cc74..dcec44dcd 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h @@ -113,6 +113,8 @@ public: void OnInactive(void) override; + MediaVideoPlay* GetVideoPlay(); + private: void ProcessData(DialDataType type, DialView* view); std::unordered_map dataTypeMap_; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp index 23ca42c2e..5b422b8bc 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -174,7 +174,6 @@ void MainPresenterSample::OnSwipe(UISwipeView &view) { UNUSED(view); CardId cardId = view_->GetHorCurrentCard(); - callback_->OnSwipe(view); SetTaskPeroid(cardId); if (cardId == COMPASS) { if (!isCompassSensorOpened_) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp index 54747cdf9..ec41fa51a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp @@ -126,6 +126,7 @@ void MainViewSample::OnStart() return; } } + callback->SetContainer(mainSwipeGroup); HorizontalViewInit(); HorViewLoad(); @@ -168,7 +169,6 @@ bool MainViewSample::HorizontalViewInit(void) } } } - presenter_->setCallback(callback); mainSwipeGroup->SetOnSwipeListener(presenter_); mainSwipeGroup->SetOnLongPressListener(presenter_); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::InitPage over"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp index f8182fd92..f18e9ea9d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp @@ -122,4 +122,9 @@ bool DialVideoView::IsStopped() } return videoPlayer_->isExited_; } + +MediaVideoPlay* DialVideoView::GetVideoPlay() +{ + return videoPlayer_; +} } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp index b32dc39cd..73f84de61 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp @@ -409,4 +409,12 @@ void DialViewGroup::OnInactive(void) kaleidoscope_->ClearFocus(); } } + +MediaVideoPlay* DialViewGroup::GetVideoPlay() +{ + if (video_ != nullptr) { + return video_->GetVideoPlay(); + } + return nullptr; } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp index 091647ea8..701c9ca47 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp @@ -644,7 +644,8 @@ static void ScoDisconnectPro(void) WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[ScoDisconnectPro] start CallState:%d", g_currCallState); ScoStatusCb(HFP_SCO_STATE_DISCONNECTED); - if (g_currCallState == HFP_HF_CALL_STATE_ACTIVE && g_scoFlag == HFP_SCO_STATE_DISCONNECTED) { + if ((g_currCallState == HFP_HF_CALL_STATE_ACTIVE && g_scoFlag == HFP_SCO_STATE_DISCONNECTED) || + (g_scoFlag == HFP_SCO_STATE_CONNECT_FAILURE)) { // The call is transferred from the watch to the phone. Need to close the call notification view. hfp_hf_calls_info_t call = {0}; HfpIncomingEventPublish(TOPIC_EVENT_HFP_WATCH_TO_PHONE, call); @@ -686,6 +687,12 @@ static void ScoStateChanged(const bd_addr_t *bdAddr, hfp_sco_connect_state_t sta PhoneServiceScreenCtr(0); break; + case HFP_SCO_STATE_CONNECT_FAILURE: + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoStateChanged] SCO connect failure!"); + ScoDisconnectPro(); + PhoneServiceScreenCtr(0); + break; + default: break; } diff --git a/code/sdk/application/wearable/service/msg_center/brandy-auto-ota-cli/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-auto-ota-cli/libmsg_center.a index 1587d8f7d..700ff086e 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-auto-ota-cli/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-auto-ota-cli/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-auto-ota-ser/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-auto-ota-ser/libmsg_center.a index 23c0b7c55..514f93b39 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-auto-ota-ser/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-auto-ota-ser/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-autoota/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-autoota/libmsg_center.a index 84ab43bdc..c8022217f 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js-autoota/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-autoota/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-autootacli/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-autootacli/libmsg_center.a index 84ab43bdc..c8022217f 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js-autootacli/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-autootacli/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-cm/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-cm/libmsg_center.a index 84ab43bdc..c8022217f 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js-cm/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-cm/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-ct/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-ct/libmsg_center.a index 84ab43bdc..c8022217f 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js-ct/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-ct/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-fd230/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-fd230/libmsg_center.a index 84ab43bdc..c8022217f 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js-fd230/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-fd230/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-leakcheck/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-leakcheck/libmsg_center.a index 84ab43bdc..c8022217f 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js-leakcheck/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-leakcheck/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-obu/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-obu/libmsg_center.a index 84ab43bdc..c8022217f 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js-obu/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-obu/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-user/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-user/libmsg_center.a new file mode 100644 index 000000000..c8022217f Binary files /dev/null and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-user/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-z1/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-z1/libmsg_center.a index 84ab43bdc..c8022217f 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js-z1/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-z1/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a index 84ab43bdc..c8022217f 100755 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a index a43043afc..bac548896 100755 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp b/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp index 6a079b8ac..570ae7214 100755 --- a/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp @@ -486,16 +486,13 @@ static void msg_center_transfer_longbuf(char *data, uint8_t type) fclose(fp); file_content[file_len] = '\0'; - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "file_len = %d.\r\n", file_len); - /* send to JSI */ - if (file_len <= ROUTE_TRANS_MAX_SIZE) { - BaidumapSendMsgToJS(file_content, type); - free(file_content); - file_content = nullptr; - } else { - BaidumapFailSendMsgToJS("long distance", type); - } + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "%s: file_len = %d.\r\n", vector_navi_get_str(type), file_len); + /* send to JSI */ + BaidumapSendMsgToJS(file_content, type); + free(file_content); + file_content = nullptr; + return; } errcode_t msg_center_vector_navi_pull_up(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) @@ -849,7 +846,12 @@ static errcode_t msg_center_vector_navi_rec_common_proc(uint8_t cmd_id, uint8_t WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "%s -- > %s\r\n", vector_navi_get_str(type), tlv_payload); if (is_vector_navi_longbuf(type) && payload_len != 1) { - msg_center_transfer_longbuf(data, type); + if (payload_len == 2) { // 2,长距离的协议优化,限制为 ROUTE_TRANS_MAX_SIZE, app先读文件过滤,减少无效带宽损耗 + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "type(%d) exceeds long distance, send fail to JS.\r\n", type); + BaidumapFailSendMsgToJS(data, type); + } else { + msg_center_transfer_longbuf(data, type); + } } else if (has_two_callback(type) && payload_len == 1) { if (strcmp(data, "1") == 0) { BaidumapSendMsgToJS(data, type); diff --git a/code/sdk/application/wstp/at_service/ohosfwk/CMakeLists.txt b/code/sdk/application/wstp/at_service/ohosfwk/CMakeLists.txt index d036b0a2c..56b0b0f57 100755 --- a/code/sdk/application/wstp/at_service/ohosfwk/CMakeLists.txt +++ b/code/sdk/application/wstp/at_service/ohosfwk/CMakeLists.txt @@ -19,6 +19,9 @@ set(PRIVATE_HEADER ${ROOT_DIR}/open_source/openharmony/third_party/cJSON ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/interfaces/innerkits/include + ${ROOT_DIR}/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include + ${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include ) set(PRIVATE_DEFINES diff --git a/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp b/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp index 1da4f92e6..59498929f 100755 --- a/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp +++ b/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp @@ -18,6 +18,9 @@ #include "NativeAbility.h" #include "ability_manager.h" #include "js_fwk_common.h" +#include "global.h" +#include "gt_bundle_manager_service.h" +#include "ApplistModel.h" #define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0])) #define OHOSFWK_MAX_ARGC 8 @@ -230,6 +233,32 @@ static uint32_t OhosfwkATCmdDfxJsMemoryInfo(uint8_t *para, uint32_t paraLen, cha return ERRCODE_SUCC; } +static uint32_t OhosfwkATCmdChangeLanguage(uint8_t *para, uint32_t paraLen, char *strCommonCmd) +{ + unused(strCommonCmd); + + uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = { 0 }; + uint32_t argc = 0; + int ret = ConvertCmdToParam(para, paraLen, argv, &argc); + + if (ret != OHOSFWK_SUCCESS) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OHOSFWK ATCMD Convert Command Failed\n"); + return ERRCODE_FAIL; + } + + if (argc != 1) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OHOSFWK ATCMD Language Setting Failed\n"); + return ERRCODE_FAIL; + } + + char *languageRegion = (char *)argv[0]; + GLOBAL_ConfigLanguage(languageRegion); + + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Language changed to %s\n", languageRegion); + + return ERRCODE_SUCC; +} + static const at_cmd_table_t g_ohosfwk_cmd[] = { { (char *)"AT^OHOSFWK_AM_EXIT_JSAPP", OhosfwkATCmdAmExitJsApp, (char *)"00 00 00 00" }, { (char *)"AT^OHOSFWK_BM_INSTALL", OhosfwkATCmdBmInstall, (char *)"00 00 00 01" }, @@ -238,6 +267,7 @@ static const at_cmd_table_t g_ohosfwk_cmd[] = { { (char *)"AT^OHOSFWK_AM_CHANGENATIVESLICE", OhosfwkATCmdAmChangeNativeSlice, (char *)"00 00 00 04" }, { (char *)"AT^OHOSFWK_AM_START_JS_APP", OhosfwkATCmdAmStartJsApp, (char *)"00 00 00 05" }, { (char *)"AT^OHOSFWK_DFX_JS_MEMORY_INFO", OhosfwkATCmdDfxJsMemoryInfo, (char *)"00 00 00 06" }, + { (char *)"AT^OHOSFWK_CHANGE_LANGUAGE", OhosfwkATCmdChangeLanguage, (char *)"00 00 00 07" }, }; at_cmd_table_t *get_ohosfwk_cmd_table(uint32_t *cmd_count) diff --git a/code/sdk/drivers/chips/brandy/clocks_core/drivers/acore/clocks_switch_priv.c b/code/sdk/drivers/chips/brandy/clocks_core/drivers/acore/clocks_switch_priv.c index 05271a317..66ae49e4c 100755 --- a/code/sdk/drivers/chips/brandy/clocks_core/drivers/acore/clocks_switch_priv.c +++ b/code/sdk/drivers/chips/brandy/clocks_core/drivers/acore/clocks_switch_priv.c @@ -6,6 +6,14 @@ #include "pmu_cmu.h" #include "clocks_config_priv.h" #include "hal_pmu_vdd.h" +#include "chip_io.h" +#if defined(BUILD_APPLICATION_STANDARD) && !defined(BUILD_RECOVERY_IMAGE) +#ifdef __LITEOS__ +#include "los_exc.h" +#endif +#endif +#include "errcode.h" +#include "panic.h" clocks_pll_src_t clocks_pll_veto_type_translation(clocks_clk_src_t clk_src) { @@ -32,14 +40,36 @@ pmu_cmu_core_t clocks_pll_used_init_type_translation(clocks_clk_src_t clk_src) void clocks_pll_power_on(clocks_pll_src_t pll_src) { cmu_pll_config_t pll_cfg; + uint32_t sucess_flag = 0; + uint32_t left_reinit_times = MAX_PLL_REINIT_TIMES; switch (pll_src) { case CLOCKS_PLL_SRC_TCXO_COM_DLL2: hal_clocks_ccrg_xo_dll2_clk_en((switch_type_t)true); break; case CLOCKS_PLL_SRC_PLL: - pmu_vdd1p0_request_switch(TURN_ON); - pll_cfg = clocks_pll_cfg_get(); - pmu_cmu_pll_reinit(PMU_CMU_PLL, pll_cfg); + while (left_reinit_times--) { + pmu_vdd1p0_request_switch(TURN_ON); + pll_cfg = clocks_pll_cfg_get(); + errcode_t ret = pmu_cmu_pll_reinit(PMU_CMU_PLL, pll_cfg); + if (ret == 0) { + sucess_flag = 1; + break; + } else { + clocks_pll_power_off(CLOCKS_PLL_SRC_PLL); + } + } + + if (sucess_flag != 1) { +#if defined(BUILD_APPLICATION_STANDARD) && !defined(BUILD_RECOVERY_IMAGE) +#ifdef __LITEOS__ + LOS_PANIC("clocks_pll_power_on fail reg_ip0 = %x bit 1\n", hal_pmu_get_simo2_buck_reg()); +#else + panic(PANIC_PMU_LDO, hal_pmu_get_simo2_buck_reg()); +#endif +#else + panic(PANIC_PMU_LDO, hal_pmu_get_simo2_buck_reg()); +#endif + } break; default: break; diff --git a/code/sdk/drivers/chips/brandy/clocks_core/drivers/acore/clocks_switch_priv.h b/code/sdk/drivers/chips/brandy/clocks_core/drivers/acore/clocks_switch_priv.h index a99e9028a..0be8ab423 100755 --- a/code/sdk/drivers/chips/brandy/clocks_core/drivers/acore/clocks_switch_priv.h +++ b/code/sdk/drivers/chips/brandy/clocks_core/drivers/acore/clocks_switch_priv.h @@ -12,6 +12,7 @@ * @{ */ #define PLL_I2S_CODEC_CLKDIV 36UL +#define MAX_PLL_REINIT_TIMES 3 /** * @brief Modules in the common crg. diff --git a/code/sdk/drivers/chips/brandy/pmu/drivers/acore/pmu_cmu.c b/code/sdk/drivers/chips/brandy/pmu/drivers/acore/pmu_cmu.c index c84ae2647..69c80e13f 100755 --- a/code/sdk/drivers/chips/brandy/pmu/drivers/acore/pmu_cmu.c +++ b/code/sdk/drivers/chips/brandy/pmu/drivers/acore/pmu_cmu.c @@ -131,11 +131,12 @@ void pmu_cmu_pll_init(void) g_pll_used = true; } -void pmu_cmu_pll_reinit(pmu_cmu_core_t pll, cmu_pll_config_t pll_cfg) +errcode_t pmu_cmu_pll_reinit(pmu_cmu_core_t pll, cmu_pll_config_t pll_cfg) { UNUSED(pll); + errcode_t ret = 0; if (g_pll_used) { - return; + return ret; } uint32_t irq = osal_irq_lock(); uapi_tcxo_delay_us(120ULL); @@ -154,10 +155,11 @@ void pmu_cmu_pll_reinit(pmu_cmu_core_t pll, cmu_pll_config_t pll_cfg) hal_pmu_cmu_core_pll_cfg_control(CMU_DAC_PD, TURN_OFF); hal_pmu_cmu_core_pll_cfg_control(CMU_DSM_PD, TURN_OFF); hal_clocks_pll_module_clken(TURN_ON); - hal_pmu2_cmu_pll_lock_check(); + ret = hal_pmu2_cmu_pll_lock_check(); g_pll_used = true; osal_irq_restore(irq); uapi_tcxo_delay_us(100ULL); + return ret; } void pmu_cmu_pll_deinit(pmu_cmu_core_t pll) diff --git a/code/sdk/drivers/chips/brandy/pmu/drivers/acore/pmu_cmu.h b/code/sdk/drivers/chips/brandy/pmu/drivers/acore/pmu_cmu.h index 34cc7df7e..0a8f511e2 100755 --- a/code/sdk/drivers/chips/brandy/pmu/drivers/acore/pmu_cmu.h +++ b/code/sdk/drivers/chips/brandy/pmu/drivers/acore/pmu_cmu.h @@ -10,6 +10,7 @@ #include "chip_definitions.h" #include "platform_core.h" #include "hal_pmu_cmu.h" +#include "errcode.h" /** @defgroup connectivity_drivers_non_os_pmu_cmu PMU CMU * @ingroup connectivity_drivers_non_os_pmu @@ -87,7 +88,7 @@ void pmu_cmu_init(void); * @brief Cmu pll reinit. * @param pll_cfg PLL config. */ -void pmu_cmu_pll_reinit(pmu_cmu_core_t pll, cmu_pll_config_t pll_cfg); +errcode_t pmu_cmu_pll_reinit(pmu_cmu_core_t pll, cmu_pll_config_t pll_cfg); /** * @brief Cmu pll power off. diff --git a/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_cmu.c b/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_cmu.c index a31e9b338..c0d71b17f 100755 --- a/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_cmu.c +++ b/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_cmu.c @@ -294,9 +294,10 @@ void hal_pmu2_cmu_pll_frac_control_select(switch_type_t manual_control) hal_reg_config_bit(PMU2_PLL_FRAC_SEL_REG, manual_control, (REG16_POS)PMU2_FRAC_SEL_BIT); } -void hal_pmu2_cmu_pll_lock_check(void) +errcode_t hal_pmu2_cmu_pll_lock_check(void) { - hal_reg_status_check_timeout(PMU2_PLL_LOCK_STS_REG, PMU2_PLL_LOCK_STS_BIT, TURN_ON, PMU_CMU_PLL_LOCK_DELAY_US); + return hal_reg_status_check_timeout_no_panic( + PMU2_PLL_LOCK_STS_REG, PMU2_PLL_LOCK_STS_BIT, TURN_ON, PMU_CMU_PLL_LOCK_DELAY_US); } void hal_pmu2_cmu_pll_cfg_valid(switch_type_t valid) diff --git a/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_cmu.h b/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_cmu.h index 8c7ba0caa..b6fe0c9b4 100755 --- a/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_cmu.h +++ b/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_cmu.h @@ -9,6 +9,7 @@ #include #include "chip_io.h" #include "chip_definitions.h" +#include "errcode.h" /** @defgroup connectivity_drivers_hal_pmu_cmu PMU CMU * @ingroup connectivity_drivers_hal_pmu @@ -216,7 +217,7 @@ void hal_pmu2_cmu_pll_frac_control_select(switch_type_t manual_control); /** * @brief Get PLL lock status. */ -void hal_pmu2_cmu_pll_lock_check(void); +errcode_t hal_pmu2_cmu_pll_lock_check(void); /** * @brief PLL fbdiv/frac config valid or not. diff --git a/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_vdd.c b/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_vdd.c index b031dc19f..d744a1aa1 100755 --- a/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_vdd.c +++ b/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_vdd.c @@ -7,6 +7,7 @@ #include "soc_osal.h" #include "hal_reg_config.h" #include "platform_core.h" +#include "chip_io.h" #ifdef USE_CMSIS_OS #include "cmsis_os2.h" #ifdef __LITEOS__ @@ -110,6 +111,11 @@ void hal_pmu_simo_buck_init(void) reg16_write(PMU_SIMO2_CFG10_REG, 0x644); /* vdd1p3: 0.9V */ } +uint16_t hal_pmu_get_simo2_buck_reg(void) +{ + return readw(PMU_SIMO2_CFG3_REG); +} + void hal_pmu_vdd_enable(hal_pmu_vdd_t vdd, switch_type_t type) { if (vdd == HAL_PMU_VDD0P8 || vdd == HAL_PMU_VDD1P9) { diff --git a/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_vdd.h b/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_vdd.h index f61f8a017..a00a1ab02 100755 --- a/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_vdd.h +++ b/code/sdk/drivers/chips/brandy/pmu/hal/hal_pmu_vdd.h @@ -195,6 +195,11 @@ void hal_ulp_power_on_time_config(ulp_aon_power_on_t ulp_power, uint16_t time_va */ void hal_ulp_wakeup_time_config(ulp_aon_wakeup_t ulp_wakeup, uint16_t time_value); +/** + * @brief simo2 buck reg value + * @return reg value + */ +uint16_t hal_pmu_get_simo2_buck_reg(void); /** * @} */ diff --git a/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c b/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c index 878077f98..43c93e676 100755 --- a/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c +++ b/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c @@ -7,6 +7,7 @@ * 2022-08-01, Create file. \n */ #include "systick_porting.h" +#include "systick.h" #include "hal_systick_v150.h" #include "platform_core.h" @@ -42,28 +43,34 @@ uint64_t uapi_systick_get_time(systick_time_t time_type) volatile uint64_t now_count = 0; volatile uint64_t ret_time = 0; volatile uint64_t cost_msec = 0; - uint64_t pre_count = g_pre_systick_count; + uint32_t irq_sts = osal_irq_lock(); + uint64_t pre_count = g_pre_systick_count; + uint64_t pre_msec = g_pre_systick_msec; + uint64_t rc_clk = CLOCK_32K_CALI_FREQ; if (g_pre_systick_count == 0) { pre_count = uapi_systick_get_count(); - g_pre_systick_msec = (pre_count * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ; + pre_msec = (pre_count * OS_SYS_MS_PER_SECOND) / rc_clk; + g_pre_systick_count = pre_count; } else { now_count = uapi_systick_get_count(); - cost_msec = ((now_count - pre_count) * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ; + cost_msec = ((now_count - pre_count) * OS_SYS_MS_PER_SECOND) / rc_clk; + pre_msec = pre_msec + cost_msec; - g_pre_systick_count = now_count; - g_pre_systick_msec = g_pre_systick_msec + cost_msec; + g_pre_systick_msec = pre_msec; + g_pre_systick_count += (cost_msec * rc_clk / OS_SYS_MS_PER_SECOND); } + osal_irq_restore(irq_sts); switch (time_type) { case SYSTICK_TIME_S: - ret_time = (uint64_t)(g_pre_systick_msec / OS_SYS_MS_PER_SECOND); + ret_time = (uint64_t)(pre_msec / OS_SYS_MS_PER_SECOND); break; case SYSTICK_TIME_US: - ret_time = (uint64_t)(g_pre_systick_msec * OS_SYS_US_PER_MS); + ret_time = (uint64_t)(pre_msec * OS_SYS_US_PER_MS); break; default: - ret_time = (uint64_t)(g_pre_systick_msec); + ret_time = (uint64_t)(pre_msec); break; } diff --git a/code/sdk/drivers/drivers/driver/mmc/mmc_init.c b/code/sdk/drivers/drivers/driver/mmc/mmc_init.c index 2ddec9daa..6155f999b 100755 --- a/code/sdk/drivers/drivers/driver/mmc/mmc_init.c +++ b/code/sdk/drivers/drivers/driver/mmc/mmc_init.c @@ -53,9 +53,10 @@ extern "C" { #define EMMC_MSLEEP_20 20 #define EMMC_ACCESS_OFFSET 20 #define EMMC_SECTOR_TO_KB 2 -#define FF_VOLUME_NAME_STRS "/system/", "/user/", "/update/", "/music/" +#define FF_VOLUME_NAME_STRS "/user/", "/system/", "/update/", "/music/" uint32_t g_volume_percent[FF_VOLUMES_NUM] = { 11, 11, 8, 70 }; static const char * const g_volume_names[FF_VOLUMES_NUM] = { FF_VOLUME_NAME_STRS }; +int32_t g_fail_mount_index = 0; static struct dpal_resource sdmmc0_resources[] = { { @@ -170,6 +171,7 @@ int emmc_drv_try_mount(void) ret = mount(dev_name, g_volume_names[index], "vfat", 0, NULL); if (ret != OK) { + g_fail_mount_index = index; printf("%s, mount failed, partition:[%d]\r\n", __FUNCTION__, index); return -ENODEV; } @@ -181,10 +183,11 @@ int emmc_drv_try_mount(void) int emmc_drv_format(void) { int ret; - int index; + int index = g_fail_mount_index; + g_fail_mount_index = 0; char dev_name[64] = { 0 }; - for (index = 0; index < FF_VOLUMES_NUM; ++index) { + for (; index < FF_VOLUMES_NUM; ++index) { ret = sprintf_s(dev_name, sizeof(dev_name), "/dev/mmcblk0p%d", index); if (ret <= 0) { continue; diff --git a/code/sdk/drivers/drivers/hal/reg_config/hal_reg_config.c b/code/sdk/drivers/drivers/hal/reg_config/hal_reg_config.c index 97b8b2b26..9158bbcbd 100755 --- a/code/sdk/drivers/drivers/hal/reg_config/hal_reg_config.c +++ b/code/sdk/drivers/drivers/hal/reg_config/hal_reg_config.c @@ -10,8 +10,16 @@ #include "systick.h" #include "debug_print.h" #include "panic.h" +#include "hal_pmu_vdd.h" +#if defined(BUILD_APPLICATION_STANDARD) && !defined(BUILD_RECOVERY_IMAGE) +#ifdef __LITEOS__ +#include "los_exc.h" +#endif +#endif +#include "chip_io.h" #define CHECK_FREQUENCY 1000 +#define SYSTICK_COUNT_PER_MS 32 uint32_t g_pmu_check_reg = 0; uint32_t g_pmu_check_reg_value = 0; @@ -19,29 +27,65 @@ uint32_t g_pmu_check_reg_bit = 0; void hal_reg_status_check_timeout(uint32_t addr, uint16_t offset, switch_type_t on, uint32_t timeout) { - uint64_t time = uapi_systick_get_ms(); + uint64_t time = uapi_systick_get_count(); uint64_t check_frq = CHECK_FREQUENCY; - + uint64_t current_time; g_pmu_check_reg = addr; g_pmu_check_reg_bit = offset; while (reg16_getbit((void *)((uintptr_t)addr), offset) != on) { check_frq--; if (check_frq == 0) { - if ((time + timeout) < uapi_systick_get_ms()) { + current_time = uapi_systick_get_count(); + if ((time + (timeout * SYSTICK_COUNT_PER_MS)) < current_time) { g_pmu_check_reg_value = readl((void *)((uintptr_t)g_pmu_check_reg)); - PRINT("pmu status timeout!! pmu addr is %x, with value %x\r\n", g_pmu_check_reg, g_pmu_check_reg_value); + PRINT("pmu status timeout!! pmu addr is %x, with value %x and ldp power reg readw(0x57004148) %x\r\n", + g_pmu_check_reg, + g_pmu_check_reg_value, + hal_pmu_get_simo2_buck_reg()); + PRINT("time = %llu , timeout = %d, current_time = %llu \r\n", time, timeout, current_time); +#if defined(BUILD_APPLICATION_STANDARD) && !defined(BUILD_RECOVERY_IMAGE) +#ifdef __LITEOS__ + LOS_PANIC("PANIC_PMU_LDO panic ,reg = %x\n", g_pmu_check_reg); +#else + panic(PANIC_PMU_LDO, g_pmu_check_reg); +#endif +#else panic(PANIC_PMU_LDO, g_pmu_check_reg); +#endif } else { check_frq = CHECK_FREQUENCY; } } } - g_pmu_check_reg = 0; g_pmu_check_reg_value = 0; g_pmu_check_reg_bit = 0; } +errcode_t hal_reg_status_check_timeout_no_panic(uint32_t addr, uint16_t offset, switch_type_t on, uint32_t timeout) +{ + uint64_t time = uapi_systick_get_count(); + uint64_t check_frq = CHECK_FREQUENCY; + uint64_t current_time; + while (reg16_getbit((void *)((uintptr_t)addr), offset) != on) { + check_frq--; + if (check_frq == 0) { + current_time = uapi_systick_get_count(); + if ((time + (timeout * SYSTICK_COUNT_PER_MS)) < current_time) { + PRINT("pmu status timeout!! pmu addr is %x, with value %x and sim02_buck2 reg= %x\r\n", + addr, + readw(addr), + hal_pmu_get_simo2_buck_reg()); + PRINT("pll power on , time count before = %llu , time count current = %llu", time, current_time); + return ERRCODE_FAIL; + } else { + check_frq = CHECK_FREQUENCY; + } + } + } + return ERRCODE_SUCC; +} + void hal_reg_config_bit(uint32_t addr, switch_type_t on, REG16_POS position) { unsigned int irq_sts = osal_irq_lock(); diff --git a/code/sdk/drivers/drivers/hal/reg_config/hal_reg_config.h b/code/sdk/drivers/drivers/hal/reg_config/hal_reg_config.h index 388b66efa..dad8176c3 100755 --- a/code/sdk/drivers/drivers/hal/reg_config/hal_reg_config.h +++ b/code/sdk/drivers/drivers/hal/reg_config/hal_reg_config.h @@ -9,6 +9,7 @@ #define SRC_DRIVERS_HAL_REG_CONFIG_H #include "chip_io.h" +#include "errcode.h" /** @defgroup connectivity_drivers_hal_reg_config REG Config * @ingroup connectivity_drivers_hal @@ -24,6 +25,16 @@ */ void hal_reg_status_check_timeout(uint32_t addr, uint16_t offset, switch_type_t on, uint32_t timeout); +/** + * @brief Check register value no panic + * @param addr Register addr + * @param offset Register bit offset + * @param on Bit set/clear + * @param timeout Check timeout value + * @return check result + */ +errcode_t hal_reg_status_check_timeout_no_panic(uint32_t addr, uint16_t offset, switch_type_t on, uint32_t timeout); + /** * @brief Set register value * @param addr Register addr diff --git a/code/sdk/include/middleware/services/bts/br/bts_a2dp_sink.h b/code/sdk/include/middleware/services/bts/br/bts_a2dp_sink.h index 4b1c90060..388937d13 100644 --- a/code/sdk/include/middleware/services/bts/br/bts_a2dp_sink.h +++ b/code/sdk/include/middleware/services/bts/br/bts_a2dp_sink.h @@ -502,6 +502,48 @@ int a2dp_snk_register_callbacks(a2dp_snk_callbacks_t *func); */ int a2dp_snk_deregister_callbacks(a2dp_snk_callbacks_t *func); +/** + * @if Eng + * @brief Use this funtion to register A2DP SNK service. + * @par Description: + * Use this funtion to register A2DP SNK service. + * @param NULL + * @retval #ERRCODE_BT_SUCCESS Success. + * @retval #Other Failure. For details, see @ref errcode_bt_t + * @else + * @brief 注册A2DP SNK服务。 + * @par 说明: + * 注册A2DP SNK服务。 + * @param NULL + * @retval #ERRCODE_BT_SUCCESS 成功。 + * @retval #Other 失败,参考 @ref errcode_bt_t + * @endif + * @par Dependency: + * @li bts_a2dp_snk_source.h + */ +errcode_t a2dp_snk_service_register(void); + +/** + * @if Eng + * @brief Use this funtion to unregister A2DP SNK service. + * @par Description: + * Use this funtion to unregister A2DP SNK service. + * @param NULL + * @retval #ERRCODE_BT_SUCCESS Success. + * @retval #Other Failure. For details, see @ref errcode_bt_t + * @else + * @brief 去注册A2DP SNK服务。 + * @par 说明: + * 去注册A2DP SNK服务。 + * @param NULL + * @retval #ERRCODE_BT_SUCCESS 成功。 + * @retval #Other 失败,参考 @ref errcode_bt_t + * @endif + * @par Dependency: + * @li bts_a2dp_snk_source.h + */ +errcode_t a2dp_snk_service_unregister(void); + /** * @} */ diff --git a/code/sdk/include/middleware/services/bts/br/bts_br_gap.h b/code/sdk/include/middleware/services/bts/br/bts_br_gap.h index 416f5b6bf..a3886aff0 100755 --- a/code/sdk/include/middleware/services/bts/br/bts_br_gap.h +++ b/code/sdk/include/middleware/services/bts/br/bts_br_gap.h @@ -172,10 +172,11 @@ typedef enum { * @endif */ typedef enum { - HFP_SCO_STATE_CONNECTING = 0x01, /*!< @if Eng status of sco is connecting. @else sco正在连接。 @endif */ - HFP_SCO_STATE_CONNECTED = 0x02, /*!< @if Eng status of sco is connected. @else sco已连接。 @endif */ - HFP_SCO_STATE_DISCONNECTING = 0x03, /*!< @if Eng status of sco is disconnecting. @else sco已连接。 @endif */ - HFP_SCO_STATE_DISCONNECTED = 0x04 /*!< @if Eng status of sco is connected. @else sco已连接。 @endif */ + HFP_SCO_STATE_CONNECTING = 0x01, /*!< @if Eng status of sco is connecting. @else sco正在连接。 @endif */ + HFP_SCO_STATE_CONNECTED = 0x02, /*!< @if Eng status of sco is connected. @else sco已连接。 @endif */ + HFP_SCO_STATE_DISCONNECTING = 0x03, /*!< @if Eng status of sco is disconnecting. @else sco正在断连。 @endif */ + HFP_SCO_STATE_DISCONNECTED = 0x04, /*!< @if Eng status of sco is disconnected. @else sco已断开。 @endif */ + HFP_SCO_STATE_CONNECT_FAILURE = 0x05 /*!< @if Eng status of sco connect is failure. @else sco连接失败。 @endif */ } hfp_sco_connect_state_t; /** @@ -1455,6 +1456,29 @@ int gap_register_callbacks(gap_call_backs_t *func); */ errcode_t gap_reconnect_media_device(const bd_addr_t *addr); +/** + * @if Eng + * @brief Use this funtion to set bt flow limit. + * @par Use this funtion to set bt flow limit. + * @attention NULL + * @param [in] flow_limit flow limit max bytes,range is [3072-10240] bytes. + * @retval #true Execute successfully. + * @retval #false Execution failed. + * @par Dependency: + * @li bts_br_gap.h + * @else + * @brief 配置流控限制字节数。 + * @par 配置流控限制字节数。 + * @attention 无 + * @param [in] 流控限制字节数,范围是[3072-10240]字节数。 + * @retval #true 连接成功。 + * @retval #false 连接失败。 + * @par 依赖: + * @li bts_br_gap.h + * @endif + */ +errcode_t gap_bt_set_flow_limit(uint16_t flow_limit); + /** * @} */ diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/a2dp_snk_service.c.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/a2dp_snk_service.c.xml index 0688a090d..5ef1a3a9c 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/a2dp_snk_service.c.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/a2dp_snk_service.c.xml @@ -1,60 +1,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/gt_bundle_manager_service.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/gt_bundle_manager_service.cpp.xml index 0b41cd54a..bdf50b7f8 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/gt_bundle_manager_service.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/gt_bundle_manager_service.cpp.xml @@ -18,16 +18,15 @@ - - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/hfp_hf_service.c.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/hfp_hf_service.c.xml index 31d13ce9f..d09bec472 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/hfp_hf_service.c.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/hfp_hf_service.c.xml @@ -12,76 +12,77 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_fwk_common.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_fwk_common.cpp.xml index c8abf7dfd..fcf5c9b99 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_fwk_common.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_fwk_common.cpp.xml @@ -1,46 +1,47 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/local_device_manager.c.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/local_device_manager.c.xml index 24f7bca23..241e15687 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/local_device_manager.c.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/local_device_manager.c.xml @@ -1,94 +1,95 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/mem_util.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/mem_util.cpp.xml index 08d3265af..ece4eb061 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/mem_util.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/mem_util.cpp.xml @@ -1,2 +1,2 @@ - + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hdb/hdbcfg/mss_prim_db.xml b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hdb/hdbcfg/mss_prim_db.xml index 189bb53e3..fd6d721e0 100755 --- a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hdb/hdbcfg/mss_prim_db.xml +++ b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hdb/hdbcfg/mss_prim_db.xml @@ -1824,7 +1824,7 @@ - + @@ -1979,56 +1979,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3575,41 +3575,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3679,20 +3682,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/bt_ahi_gap.c.xml b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/bt_ahi_gap.c.xml index 3aef8abe8..391e55231 100755 --- a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/bt_ahi_gap.c.xml +++ b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/bt_ahi_gap.c.xml @@ -1,36 +1,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/bt_mpc_adpt_gap.c.xml b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/bt_mpc_adpt_gap.c.xml index 0040f1f51..488e335e9 100755 --- a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/bt_mpc_adpt_gap.c.xml +++ b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/bt_mpc_adpt_gap.c.xml @@ -1,49 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/patch_bth.c.xml b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/patch_bth.c.xml index 42e965be0..f57c77a9f 100755 --- a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/patch_bth.c.xml +++ b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/patch_bth.c.xml @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/sdk_av.c.xml b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/sdk_av.c.xml index bc290a630..42333d72a 100644 --- a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/sdk_av.c.xml +++ b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/sdk_av.c.xml @@ -1,2 +1,2 @@ - + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/sdk_hlp.c.xml b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/sdk_hlp.c.xml index f883b78ea..a8b8232f3 100755 --- a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/sdk_hlp.c.xml +++ b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/sdk_hlp.c.xml @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_audio_manager_wrapper.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_audio_manager_wrapper.a index ddc954de8..e010b28a2 100755 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_audio_manager_wrapper.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_audio_manager_wrapper.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_brandy_service.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_brandy_service.a index 11fadca12..aa0fdfb2e 100755 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_brandy_service.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_brandy_service.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_sdk.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_sdk.a index b31ab9d87..becd14040 100755 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_sdk.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/freertos/br/libbt_host_sdk.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_audio_manager_wrapper.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_audio_manager_wrapper.a index 3d7ba6d01..a23ae4624 100755 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_audio_manager_wrapper.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_audio_manager_wrapper.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_service.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_service.a index f451d2fec..77b32fa61 100755 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_service.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_service.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_sdk.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_sdk.a index 86a539834..07f39ef6f 100755 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_sdk.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_sdk.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_audio_manager_wrapper.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_audio_manager_wrapper.a index 08d29c576..636ff18b6 100644 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_audio_manager_wrapper.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_audio_manager_wrapper.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_brandy_service.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_brandy_service.a index ddf58f0e6..c4e279d69 100755 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_brandy_service.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_brandy_service.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_sdk.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_sdk.a index a3c43bf9e..993e67a35 100755 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_sdk.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_sdk.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/CMakeLists.txt b/code/sdk/middleware/services/gpu/api/rm/CMakeLists.txt index 459881269..c6faaf16d 100644 --- a/code/sdk/middleware/services/gpu/api/rm/CMakeLists.txt +++ b/code/sdk/middleware/services/gpu/api/rm/CMakeLists.txt @@ -23,6 +23,7 @@ set(PUBLIC_DEFINES set(PRIVATE_DEFINES CONFIG_VG_RUN_LINUX + CONFIG_VAU_DFX_ERROR ) # use this when you want to add ccflags like -include xxx diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-auto-ota-cli/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-auto-ota-cli/libgfx_rm.a index b561e81a9..7f6b27ee9 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-auto-ota-cli/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-auto-ota-cli/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-auto-ota-ser/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-auto-ota-ser/libgfx_rm.a index ad93d8538..38a1bdda1 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-auto-ota-ser/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-auto-ota-ser/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autoota/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autoota/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autoota/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autoota/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autootacli/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autootacli/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autootacli/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autootacli/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-cm/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-cm/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-cm/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-cm/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ct/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ct/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ct/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ct/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-leakcheck/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-leakcheck/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-leakcheck/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-leakcheck/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-obu/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-obu/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-obu/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-obu/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-r/libgfx_rm.a index ccac945e2..8101de3e8 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-r/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-r/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-user/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-user/libgfx_rm.a new file mode 100644 index 000000000..18778c101 Binary files /dev/null and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-user/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-z1/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-z1/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-z1/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-z1/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js/libgfx_rm.a index 4347741a3..18778c101 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-target1-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-target1-r/libgfx_rm.a index f82ee73f4..4d105b6ee 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-target1-r/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-target1-r/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-target1/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-target1/libgfx_rm.a index 99705e699..8519b170a 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-target1/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-target1/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-target3-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-target3-r/libgfx_rm.a index 5730c169d..abca2ebe1 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-target3-r/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-target3-r/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-target3/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-target3/libgfx_rm.a index 4ce2807bb..5c37168f7 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-target3/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-target3/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-target4-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-target4-r/libgfx_rm.a index 782640b3e..065416358 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-target4-r/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-target4-r/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-target4/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-target4/libgfx_rm.a index 30510b278..79dba85dc 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-target4/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-target4/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-target5-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-target5-r/libgfx_rm.a index 88583111e..d0791818f 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-target5-r/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-target5-r/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-target5/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-target5/libgfx_rm.a index 6cff65178..f249d23f3 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-target5/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-target5/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-xts/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-xts/libgfx_rm.a index 47b9d40c1..b8fac2d87 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-xts/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-xts/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/testsuite-brandy-sdk/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/testsuite-brandy-sdk/libgfx_rm.a index cd4bc8646..6f327fd3b 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/testsuite-brandy-sdk/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/testsuite-brandy-sdk/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-auto-ota-cli/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-auto-ota-cli/libdisplay_gfx.a index 253ac7e82..fe56ad63e 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-auto-ota-cli/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-auto-ota-cli/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-auto-ota-ser/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-auto-ota-ser/libdisplay_gfx.a index 11f94461b..2870cd7ce 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-auto-ota-ser/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-auto-ota-ser/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autoota/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autoota/libdisplay_gfx.a index 9727828a5..464b21c8c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autoota/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autoota/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autootacli/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autootacli/libdisplay_gfx.a index 9727828a5..464b21c8c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autootacli/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autootacli/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-cm/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-cm/libdisplay_gfx.a index 9727828a5..464b21c8c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-cm/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-cm/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-ct/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-ct/libdisplay_gfx.a index 9727828a5..464b21c8c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-ct/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-ct/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-fd230/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-fd230/libdisplay_gfx.a index 9727828a5..464b21c8c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-fd230/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-fd230/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-leakcheck/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-leakcheck/libdisplay_gfx.a index 9727828a5..464b21c8c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-leakcheck/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-leakcheck/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-obu/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-obu/libdisplay_gfx.a index 9727828a5..464b21c8c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-obu/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-obu/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-user/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-user/libdisplay_gfx.a new file mode 100644 index 000000000..464b21c8c Binary files /dev/null and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-user/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-z1/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-z1/libdisplay_gfx.a index 9727828a5..464b21c8c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-z1/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-z1/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a index 9727828a5..464b21c8c 100755 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a index 2113c203a..d07e16643 100755 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a index 655e25318..c32afcc96 100755 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a index 220209d86..39ebbd227 100755 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a index b91217121..517fcce86 100755 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a b/code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a index 542fd6b61..a88b988ec 100755 Binary files a/code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a and b/code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a differ diff --git a/code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a b/code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a index 22fc4d0e4..37f9bb121 100755 Binary files a/code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a and b/code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-auto-ota-cli/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-auto-ota-cli/libuikit_ext.a index 33533dffc..089e99197 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-auto-ota-cli/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-auto-ota-cli/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-auto-ota-ser/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-auto-ota-ser/libuikit_ext.a index 800ab8702..69e38e73f 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-auto-ota-ser/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-auto-ota-ser/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-autoota/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-autoota/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js-autoota/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-autoota/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-autootacli/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-autootacli/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js-autootacli/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-autootacli/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-cm/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-cm/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js-cm/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-cm/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-ct/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-ct/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js-ct/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-ct/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-fd230/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-fd230/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js-fd230/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-fd230/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-leakcheck/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-leakcheck/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js-leakcheck/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-leakcheck/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-obu/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-obu/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js-obu/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-obu/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-user/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-user/libuikit_ext.a new file mode 100644 index 000000000..aa7a1f3f6 Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-user/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-z1/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-z1/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js-z1/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-z1/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a index 807b8f29e..aa7a1f3f6 100755 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a index 3e3086944..30de184b6 100755 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a index 3d2a2692a..45899dba9 100755 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h index 535696cb8..3847daf1e 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h @@ -9,6 +9,7 @@ #define UI_CARD_SWIPE_H #include "components/ui_card_page.h" #include "components/ui_image_view.h" +#include "components/ui_view_group.h" namespace OHOS { class CardSwipe : public HeapBase { @@ -28,7 +29,12 @@ public: * @since 1.0 * @version 1.0 */ - virtual void CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) {} + virtual void CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) + { + if (!IsStarted()) { + StartEffect(); + } + } /* * * @brief Swipe algorithm when drag card. @@ -38,9 +44,70 @@ public: * @since 1.0 * @version 1.0 */ - virtual void CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) {} + virtual void CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) + { + if (!IsStarted()) { + StartEffect(); + } + } + + /* * + * @brief Begin card swipe effect + * @since 1.0 + * @version 1.0 + */ + virtual void StartEffect() + { + isStarted_ = true; + }; + + /* * + * @brief End card swipe effect + * @since 1.0 + * @version 1.0 + */ + virtual void StopEffect() + { + isStarted_ = false; + }; + + /* * + * @brief Return whether swipe effect is started. + * @since 1.0 + * @version 1.0 + */ + bool IsStarted() + { + return isStarted_; + } + + /* * + * @brief Set container view (UICrossView) which is used to produce effect. + * @since 1.0 + * @version 1.0 + */ + void SetContainer(UIViewGroup* view) + { + container_ = view; + } + + /* * + * @brief Enable clipping card page into a circle. + * @since 1.0 + * @version 1.0 + */ + void EnableClip(bool enable) + { + isNeedClip_ = enable; + } bool isNeedClip_ = false; + +protected: + UIViewGroup* container_ = nullptr; + +private: + bool isStarted_ = false; }; } #endif diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h index 77d459ecd..e55563061 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h @@ -219,6 +219,7 @@ public: } private: + using UIViewGroup::Remove; uint16_t blurRadius_ = 10; void UpdateCardPageIndex(); static constexpr uint16_t INVALID_VIEW_INDEX = 0xff; @@ -236,6 +237,7 @@ private: UISwipeView::OnSwipeListener *swipeListener_ = nullptr; bool isNeedClip_ = false; std::shared_ptr exists_; + bool waitProcessRes_ = false; void RemoveAllInner(UISwipeView& view); void ProcessRes(void); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_transform_group.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_transform_group.h index 6ff2e112d..410cbb4cd 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_transform_group.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_transform_group.h @@ -71,7 +71,6 @@ public: private: void ReMeasure() override; void DeleteMirrorView(); - TransformMap labelTextTransMap_; }; } // namespace OHOS #endif // GRAPHIC_UI_TRANSFORM_GROUP_H \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_menu_item.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_menu_item.cpp index 77679c6d4..9bd12fbec 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_menu_item.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_menu_item.cpp @@ -41,20 +41,25 @@ UIMenuItem::~UIMenuItem() void UIMenuItem::SetScaleCenter() { int16_t itemOrigX = GetContentRect().GetX(); + int16_t itemOrigY = GetContentRect().GetY(); if (transAlignMode_ == ScaleAlignMode::ALIGN_TEXT_LEFT) { textScaleCenter_ = Vector2{0.0, textOrigRect_.GetHeight() / 2.0f}; - imgScaleCenter_ = Vector2{textOrigRect_.GetLeft() - imgOrigRect_.GetLeft(), textScaleCenter_.y_}; - itemScaleCenter_ = Vector2{textOrigRect_.GetLeft() - itemOrigX, textScaleCenter_.y_}; + imgScaleCenter_ = Vector2{textOrigRect_.GetLeft() - imgOrigRect_.GetLeft(), + textOrigRect_.GetTop() + textScaleCenter_.y_ - imgOrigRect_.GetTop()}; + itemScaleCenter_ = Vector2{textOrigRect_.GetLeft() - itemOrigX, + textOrigRect_.GetTop() + textScaleCenter_.y_ - itemOrigY}; } else if (transAlignMode_ == ScaleAlignMode::ALIGN_IMAGE_LEFT) { imgScaleCenter_ = Vector2{0.0, imgOrigRect_.GetHeight() / 2.0f}; - textScaleCenter_ = Vector2{imgOrigRect_.GetLeft() - textOrigRect_.GetLeft(), imgScaleCenter_.y_}; - itemScaleCenter_ = Vector2{imgOrigRect_.GetLeft() - itemOrigX, imgScaleCenter_.y_}; + textScaleCenter_ = Vector2{imgOrigRect_.GetLeft() - textOrigRect_.GetLeft(), + imgOrigRect_.GetTop() + imgScaleCenter_.y_ - textOrigRect_.GetTop()}; + itemScaleCenter_ = Vector2{imgOrigRect_.GetLeft() - itemOrigX, + imgOrigRect_.GetTop() + imgScaleCenter_.y_ - itemOrigY}; } else if (transAlignMode_ == ScaleAlignMode::ALIGN_ITEM_CENTER) { itemScaleCenter_ = Vector2{GetWidth() / 2.0f, GetHeight() / 2.0f}; textScaleCenter_ = Vector2{itemOrigX + itemScaleCenter_.x_ - textOrigRect_.GetLeft(), - itemScaleCenter_.y_}; + itemOrigY + itemScaleCenter_.y_ - textOrigRect_.GetTop()}; imgScaleCenter_ = Vector2{itemOrigX + itemScaleCenter_.x_ - imgOrigRect_.GetLeft(), - itemScaleCenter_.y_}; + itemOrigY + itemScaleCenter_.y_ - imgOrigRect_.GetTop()}; } } @@ -99,7 +104,7 @@ void UIMenuItem::ReMeasure() if (label_ != nullptr) { transMap.SetTransMapRect(textOrigRect_); transMap.Scale(transMap.GetScaleCoef(), Vector3{textScaleCenter_.x_, textScaleCenter_.y_, 0.0}); - label_->SetTextTransformMap(transMap); + label_->SetTransformMap(transMap); } } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/hor_swipe_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/hor_swipe_view.h index a672154fc..6284392b9 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/hor_swipe_view.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/hor_swipe_view.h @@ -58,6 +58,16 @@ public: swipeCallback_ = callback; } + /* * + * @brief Return swipe callback. + * @since 1.0 + * @version 1.0 + */ + CardSwipe* GetSwipeCallback() + { + return swipeCallback_; + } + /* * * @brief Set the start point for drag. * @since 1.0 diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.cpp index 2820da3eb..251cfa2f5 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.cpp @@ -13,7 +13,7 @@ namespace OHOS { static constexpr int16_t CAMERA_DISTANCE = 600; static constexpr int16_t EASE_RANGE = 100; -void CardFlipEffect::OnSwipe(UISwipeView& view) +void CardFlipEffect::StopEffect() { if (preLeftCard != nullptr) { preLeftCard->SetVisible(true); @@ -23,6 +23,8 @@ void CardFlipEffect::OnSwipe(UISwipeView& view) visibleCard_ = nullptr; container_->UIViewGroup::Remove(&img_); } + + CardSwipe::StopEffect(); } void CardFlipEffect::CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOffset) @@ -106,11 +108,13 @@ void CardFlipEffect::CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOff void CardFlipEffect::CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) { + CardSwipe::CardSwipeAlg(leftCard, rightCard, xOffset); CommonAlg(leftCard, rightCard, xOffset); } void CardFlipEffect::CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) { + CardSwipe::CardSwipeAlg(leftCard, rightCard, xOffset); CommonAlg(leftCard, rightCard, xOffset); } } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.h index 14a06be12..cb3a34d2b 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.h @@ -10,24 +10,19 @@ #include "components/ui_cross_view.h" namespace OHOS { -class CardFlipEffect : public CardSwipe, public UISwipeView::OnSwipeListener { +class CardFlipEffect : public CardSwipe { public: CardFlipEffect(void) {} ~CardFlipEffect() override {} void CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) override; void CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) override; - void OnSwipe(UISwipeView& view) override; - void SetContainer(UICrossView* view) - { - container_ = view; - } + void StopEffect() override; private: UIImageView img_; UIView* visibleCard_ = nullptr; UIView* preLeftCard = nullptr; UIView* preRightCard = nullptr; - UICrossView* container_ = nullptr; void CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOffset); }; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/cube_effect.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/cube_effect.cpp index 748f45e13..93ac2ca81 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/cube_effect.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/cube_effect.cpp @@ -23,7 +23,7 @@ static constexpr int16_t CAMERA_DISTANCE = 500; static constexpr int16_t ROTATE_RANGE_MAX = 90; } -void CubeEffect::OnSwipe(UISwipeView& view) +void CubeEffect::StopEffect() { if (preLeftCard != nullptr) { preLeftCard->ResetTransParameter(); @@ -38,6 +38,8 @@ void CubeEffect::OnSwipe(UISwipeView& view) container_->UIViewGroup::Remove(&rightImg_); rightImg_.ResetTransParameter(); } + + CardSwipe::StopEffect(); } void CubeEffect::TransformCard(UIView* leftCard, UIView* rightCard, int16_t xOffset) @@ -152,11 +154,13 @@ void CubeEffect::CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOffset) void CubeEffect::CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) { + CardSwipe::CardSwipeAlg(leftCard, rightCard, xOffset); CommonAlg(leftCard, rightCard, xOffset); } void CubeEffect::CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) { + CardSwipe::CardSwipeAlg(leftCard, rightCard, xOffset); CommonAlg(leftCard, rightCard, xOffset); } } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/cube_effect.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/cube_effect.h index 751d99e2f..34659ac05 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/cube_effect.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/cube_effect.h @@ -18,25 +18,19 @@ #include "components/ui_cross_view.h" namespace OHOS { -class CubeEffect : public CardSwipe, public UISwipeView::OnSwipeListener { +class CubeEffect : public CardSwipe { public: CubeEffect(void) {} ~CubeEffect() override {} void CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) override; void CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) override; - void OnSwipe(UISwipeView& view) override; - - void SetContainer(UICrossView* view) - { - container_ = view; - } + void StopEffect() override; private: UIImageView leftImg_; UIImageView rightImg_; UIView* preLeftCard = nullptr; UIView* preRightCard = nullptr; - UICrossView* container_ = nullptr; void CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOffset); void TransformCard(UIView* leftCard, UIView* rightCard, int16_t xOffset); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.cpp index 79ac0ce4d..6469cf91c 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.cpp @@ -8,7 +8,7 @@ #include "imgdecode/image_load.h" namespace OHOS { -void TurnPageEffect::OnSwipe(UISwipeView& view) +void TurnPageEffect::StopEffect() { if (preLeftCard != nullptr) { RemoveFromContainer(); @@ -20,6 +20,8 @@ void TurnPageEffect::OnSwipe(UISwipeView& view) FreeInfo(); } + + CardSwipe::StopEffect(); } void TurnPageEffect::CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOffset) @@ -54,11 +56,13 @@ void TurnPageEffect::CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOff void TurnPageEffect::CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) { + CardSwipe::CardSwipeAlg(leftCard, rightCard, xOffset); CommonAlg(leftCard, rightCard, xOffset); } void TurnPageEffect::CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) { + CardSwipe::CardSwipeAlg(leftCard, rightCard, xOffset); CommonAlg(leftCard, rightCard, xOffset); } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h index 9a21bcf1b..475a6a921 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h @@ -12,7 +12,7 @@ #include "components/ui_cross_view.h" namespace OHOS { -class TurnPageEffect : public CardSwipe, public UISwipeView::OnSwipeListener { +class TurnPageEffect : public CardSwipe { public: TurnPageEffect(void) { @@ -24,11 +24,7 @@ public: } void CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) override; void CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) override; - void OnSwipe(UISwipeView& view) override; - void SetContainer(UICrossView* view) - { - container_ = view; - } + void StopEffect() override; private: TurnPageView turnPageView_; @@ -37,7 +33,6 @@ private: bool added_ = false; UIView* preLeftCard = nullptr; UIView* preRightCard = nullptr; - UICrossView* container_ = nullptr; ImageInfo *leftInfo_ = nullptr; ImageInfo *rightInfo_ = nullptr; bool lastPage_ = false; // false for left, true for right diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_view.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_view.cpp index b13870b6d..17426eb5d 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_view.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_view.cpp @@ -92,7 +92,16 @@ void TurnPageView::DrawPartialRect(BufferInfo& gfxDstBuffer, const Rect& invalid opt.opacity = opa; src.rect = transform.GetTransMapRect(); - opt.transMap.SetMatrix(transform.GetTransformMatrix()); + Matrix4 matrix = transform.GetTransformMatrix(); + opt.transMap.SetMatrix(matrix); + // adjust src rect using dstRect for only translate matrix + if (FloatEqual(matrix[0][0], 1.0f) && FloatEqual(matrix[0][1], 0.0f) && + FloatEqual(matrix[0][3], 0.0f) && FloatEqual(matrix[1][0], 0.0f) && // 3: index + FloatEqual(matrix[1][1], 1.0f) && FloatEqual(matrix[1][3], 0.0f) && // 3: index + FloatEqual(matrix[3][3], 1.0f)) { // 3: index + src.rect.SetWidth(dstRect.GetWidth()); + src.rect.SetHeight(dstRect.GetHeight()); + } BaseGfxEngine::GetInstance()->Blit(gfxDstBuffer, {0, 0}, src, dstRect, opt); } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.cpp index a775595a3..8b76b6a31 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.cpp @@ -10,7 +10,7 @@ #include "zoom_effect.h" namespace OHOS { -void ZoomEffect::OnSwipe(UISwipeView& view) +void ZoomEffect::StopEffect() { if (preLeftCard != nullptr) { preLeftCard->ResetTransParameter(); @@ -21,6 +21,8 @@ void ZoomEffect::OnSwipe(UISwipeView& view) preRightCard->ResetTransParameter(); preRightCard = nullptr; } + + CardSwipe::StopEffect(); } void ZoomEffect::CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOffset) @@ -67,11 +69,13 @@ void ZoomEffect::CommonAlg(UIView* leftCard, UIView* rightCard, int16_t xOffset) void ZoomEffect::CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) { + CardSwipe::CardSwipeAlg(leftCard, rightCard, xOffset); CommonAlg(leftCard, rightCard, xOffset); } void ZoomEffect::CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) { + CardSwipe::CardSwipeAlg(leftCard, rightCard, xOffset); CommonAlg(leftCard, rightCard, xOffset); } } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h index 2787f1e6d..64d414a9b 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h @@ -10,13 +10,13 @@ #include "components/ui_cross_view.h" namespace OHOS { -class ZoomEffect : public CardSwipe, public UISwipeView::OnSwipeListener { +class ZoomEffect : public CardSwipe { public: ZoomEffect(void) {} ~ZoomEffect() override {} void CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) override; void CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) override; - void OnSwipe(UISwipeView& view) override; + void StopEffect() override; private: UIView* preLeftCard = nullptr; diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/ui_test_clock_dial.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/ui_test_clock_dial.cpp index c3730a28c..14f2bc732 100755 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/ui_test_clock_dial.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/ui_test_clock_dial.cpp @@ -41,7 +41,6 @@ void SwipeListener::OnSwipe(UISwipeView& view) UNUSED(view); int page = UITestClockDial::GetInstance()->GetHorCurrentPage(); UITestClockDial::GetInstance()->PreLoad(page); - calback_->OnSwipe(view); return; } @@ -65,15 +64,16 @@ void UITestClockDial::SetUp() return; } - if (calback == nullptr) { - calback = new ZoomEffect(); - if (calback == nullptr) { + if (callback == nullptr) { + callback = new ZoomEffect(); + if (callback == nullptr) { delete mainSwipeGroup; mainSwipeGroup = nullptr; - GRAPHIC_LOGE("SwipeCallback new fail\n"); + GRAPHIC_LOGE("callback new fail\n"); return; } } + callback->SetContainer(mainSwipeGroup); HorizontalViewInit(); HorViewLoad(); @@ -83,7 +83,7 @@ void UITestClockDial::SetUp() mainSwipeGroup->SetAnimatorTime(50); // 50: animator drag time(ms); mainSwipeGroup->SetLoopState(true); mainSwipeGroup->EnableScreenCap(true); - mainSwipeGroup->RegisterSwipeCallback(calback); + mainSwipeGroup->RegisterSwipeCallback(callback); mainSwipeGroup->SetHorCurrentPage(mainClockView->GetViewIndex()); } @@ -143,6 +143,11 @@ void UITestClockDial::TearDown() delete listener; listener = nullptr; } + + if (callback != nullptr) { + delete callback; + callback = nullptr; + } } const UIView* UITestClockDial::GetTestView() @@ -175,7 +180,6 @@ bool UITestClockDial::HorizontalViewInit(void) pageStatus[maxPage - 1] = true; } listener = new SwipeListener(); - listener->SetCallback(calback); mainSwipeGroup->SetOnSwipeListener(listener); GRAPHIC_LOGD("UITestClockDial::InitPage over\n"); return true; diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/ui_test_clock_dial.h b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/ui_test_clock_dial.h index 00d6e6353..5ff88fffb 100755 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/ui_test_clock_dial.h +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_clock_dial/ui_test_clock_dial.h @@ -40,13 +40,6 @@ public: SwipeListener(void) {} ~SwipeListener() override {} void OnSwipe(UISwipeView& view) override; - - void SetCallback(ZoomEffect* calback) - { - calback_ = calback; - } -private: - ZoomEffect* calback_{nullptr}; }; class UITestClockDial : public UITest { @@ -88,7 +81,7 @@ private: bool pageStatus[static_cast(CardId::MAX_CARD)]{false}; UICrossView *mainSwipeGroup{nullptr}; SwipeListener *listener{nullptr}; - ZoomEffect* calback{nullptr}; + ZoomEffect* callback{nullptr}; bool HorizontalViewInit(void); void VerticalViewInit(void); diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp index dfbba8eee..ecd8083e4 100755 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp @@ -248,7 +248,6 @@ void UITestCross::SetUp() container_->SetLoopState(true); container_->EnableScreenCap(true); container_->RegisterSwipeCallback(callback_); - container_->SetOnSwipeListener(callback_); #ifdef _WIN32 container_->SetHorCurrentPage(card1_->GetViewIndex()); card1_->SetCoverable(true); diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/scale_item_adapter.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/scale_item_adapter.cpp index dff318e6e..4c487a688 100644 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/scale_item_adapter.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/scale_item_adapter.cpp @@ -25,53 +25,71 @@ namespace OHOS { class ItemContainer : public UITransformGroup { public: - ItemContainer() : image_(nullptr), label_(nullptr) + ItemContainer() : leftImg_(nullptr), label_(nullptr), rightImg_(nullptr) { SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); } ~ItemContainer() override + { + ClearRes(); + } + + void ClearRes() { RemoveAll(); - if (image_ != nullptr) { - delete image_; - image_ = nullptr; + if (leftImg_ != nullptr) { + delete leftImg_; + leftImg_ = nullptr; } if (label_ != nullptr) { delete label_; label_ = nullptr; } + if (rightImg_ != nullptr) { + delete rightImg_; + rightImg_ = nullptr; + } } bool InitContainer() { - if (image_ == nullptr) { - image_ = new UIImageView(); - if (image_ == nullptr) { + if (leftImg_ == nullptr) { + leftImg_ = new UIImageView(); + if (leftImg_ == nullptr) { return false; } } - image_->SetResizeMode(UIImageView::ImageResizeMode::CENTER); + leftImg_->SetResizeMode(UIImageView::ImageResizeMode::CENTER); if (label_ == nullptr) { label_ = new UILabelExt(); if (label_ == nullptr) { - delete image_; - image_ = nullptr; + ClearRes(); return false; } } label_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); // 40: item font size + if (rightImg_ == nullptr) { + rightImg_ = new UIImageView(); + if (rightImg_ == nullptr) { + ClearRes(); + return false; + } + } + rightImg_->SetResizeMode(UIImageView::ImageResizeMode::CENTER); + Add(label_); - Add(image_); + Add(leftImg_); + Add(rightImg_); return true; } - UIImageView* GetImageView() + UIImageView* GetLeftImageView() { - return image_; + return leftImg_; } UILabelExt* GetLabelView() @@ -79,11 +97,18 @@ public: return label_; } + UIImageView* GetRightImgView() + { + return rightImg_; + } + ItemContainer(const ItemContainer &) = delete; ItemContainer &operator=(const ItemContainer &) = delete; + private: - UIImageView* image_; + UIImageView* leftImg_; UILabelExt* label_; + UIImageView* rightImg_; }; ScaleItemAdapter::~ScaleItemAdapter() @@ -182,29 +207,43 @@ UIView* ScaleItemAdapter::GetView(UIView* inView, int16_t index) } item->Resize(width_, height_); - UIImageView* image = item->GetImageView(); - image->SetPosition(imageRect_.GetX(), imageRect_.GetY(), imageRect_.GetWidth(), imageRect_.GetHeight()); + UIImageView* leftImg = item->GetLeftImageView(); + leftImg->SetPosition(imageRect_.GetX(), imageRect_.GetY(), imageRect_.GetWidth(), imageRect_.GetHeight()); UILabelExt* label = item->GetLabelView(); label->SetPosition(labelRect_.GetX(), labelRect_.GetY(), labelRect_.GetWidth(), labelRect_.GetHeight()); + + UIImageView* rightImg = item->GetRightImgView(); + rightImg->SetPosition(labelRect_.GetX() + labelRect_.GetWidth(), + imageRect_.GetY(), imageRect_.GetWidth(), imageRect_.GetHeight()); } else { item = static_cast(inView); } if (item != nullptr) { - if (node->data_->imgInfo == nullptr) { - node->data_->imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(node->data_->resId, LIST_FPS); - } - UIImageView* image = item->GetImageView(); - if (image != nullptr) { - image->SetSrc(node->data_->imgInfo); + UIImageView* leftImg = item->GetLeftImageView(); + if (leftImg != nullptr) { + if (node->data_->imgInfo == nullptr) { + node->data_->imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(node->data_->resId, LIST_FPS); + } + leftImg->SetSrc(node->data_->imgInfo); } + UILabelExt* label = item->GetLabelView(); if (label != nullptr) { label->SetText(node->data_->txt); label->SetLineBreakMode(node->data_->lineBreakMode); label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); } + + UIImageView* rightImg = item->GetRightImgView(); + if (rightImg != nullptr) { + if (arrowImg_ == nullptr) { + arrowImg_ = ImageCacheManager::GetInstance().LoadSingleRes(RES_PATH"left_arrow.bin"); + } + rightImg->SetSrc(arrowImg_); + } + item->SetViewIndex(index); } return item; diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/scale_item_adapter.h b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/scale_item_adapter.h index bd1c5e97c..b8053b155 100644 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/scale_item_adapter.h +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/scale_item_adapter.h @@ -28,7 +28,7 @@ struct ItemDataNode { class ScaleItemAdapter : public AbstractAdapter { public: - ScaleItemAdapter() : width_(0), height_(0) {} + ScaleItemAdapter() : width_(0), height_(0), arrowImg_(nullptr) {} ~ScaleItemAdapter() override; UIView* GetView(UIView* inView, int16_t index) override; @@ -46,6 +46,7 @@ private: uint16_t height_; Rect imageRect_; Rect labelRect_; + ImageInfo* arrowImg_; }; } // namespace OHOS #endif // SCALE_ITEM_ADAPTER_H diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/ui_test_scale_list.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/ui_test_scale_list.cpp index 30cef91da..1e0005abe 100644 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/ui_test_scale_list.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_transform_list/ui_test_scale_list.cpp @@ -23,9 +23,9 @@ static const int16_t LIST_WIDTH = 454; static const int16_t LIST_HEIGHT = 454; static const uint16_t ITEM_WIDTH = 400; static const uint16_t ITEM_HEIGHT = 100; -static const uint16_t IMAGE_WIDTH = 100; -static const uint16_t IMAGE_HEIGHT = 100; -static const uint16_t LABEL_WIDTH = 350; +static const uint16_t IMAGE_WIDTH = 50; +static const uint16_t IMAGE_HEIGHT = 50; +static const uint16_t LABEL_WIDTH = 300; static const uint16_t LABEL_HEIGHT = 100; static const uint16_t SCALE_FACTOR = 400; static ItemDataNode g_itemNode[] = { @@ -116,7 +116,7 @@ void UITestScaleList::UIScaleListTest() } adapter_->ItemResize(ITEM_WIDTH, ITEM_HEIGHT); adapter_->SetLabelPosition(IMAGE_WIDTH, 0, LABEL_WIDTH, LABEL_HEIGHT); - adapter_->SetImagePosition(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT); + adapter_->SetImagePosition(0, 25, IMAGE_WIDTH, IMAGE_HEIGHT); // 25:image start pos y adapter_->SetData(data_); if (list_ == nullptr) { diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/text.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/text.cpp index 4fd1de0d5..8b94c250e 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/text.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/text.cpp @@ -234,11 +234,11 @@ void Text::Draw(BufferInfo& gfxDstBuffer, } OpacityType opa = DrawUtils::GetMixOpacity(opaScale, style.textOpa_); for (int i = 0; i < lineCount; i++) { - if (pos.y > mask.GetBottom()) { + if (pos.y > coords.GetBottom()) { return; } int16_t nextLine = pos.y + lineHeight; - if (nextLine >= mask.GetTop()) { + if (nextLine >= coords.GetTop()) { pos.x = LineStartPos(coords, textLine_[i].linePixelWidth); LabelLineInfo labelLine{pos, offset, mask, lineHeight, textLine_[i].lineBytes, 0, opa, style, &text_[lineBegin], textLine_[i].lineBytes, diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp index 958253c0d..b2f151497 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp @@ -13,12 +13,12 @@ * limitations under the License. */ +#include #include "hal_tick.h" #include "components/ui_label.h" #include "font/ui_font.h" #include "gfx_utils/graphic_log.h" #include "themes/theme_manager.h" -#include "cmath" namespace OHOS { class LabelAnimator : public Animator, public AnimatorCallback { @@ -137,7 +137,6 @@ private: uint32_t time = HALTick::GetInstance().GetElapseTime(startTime_); float x0 = startPos_; float x1 = 1.0 * labelWidth_ - textWidth_; -#if 1 float factor = 1000; // 1000: slow down the speed float v = speed_ / factor; v = x1 - x0 > 0 ? v : -v; @@ -151,31 +150,12 @@ private: } else { x = -v * (t - t1) + x1; } -#else - float factor = 200000; // slow down the speed - float t = time * speed_ / factor; - float t1 = 1.0; - float period = 2.0; - while (t < 0) { - t += period; - } - while (t > period) { - t -= period; - } - float x = 0; - if (t >=0 && t < t1) { - x = (x1 - x0) * t / t1 + x0; - } else { - x = (x0 - x1) * (t - t1) / t1 + x1; - } -#endif UILabel *label = dynamic_cast(view); if (label != nullptr) { label->offsetX_ = MATH_ROUND(x); label->Invalidate(); } - // printf("offsetX: %d time %d\n", label->offsetX_, time); } static constexpr uint8_t ANIM_WAIT_COUNT = 50; @@ -351,13 +331,6 @@ void UILabel::SetHeight(int16_t height) RefreshLabel(); } } - -void UILabel::SetTextTransformMap(TransformMap& transMap) -{ - InitLabelText(); - labelText_->SetTransformMap(transMap); -} - void UILabel::RefreshLabel() { Invalidate(); @@ -488,11 +461,20 @@ void UILabel::SetRollSpeed(uint16_t speed) void UILabel::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) { InitLabelText(); - UIView::OnDraw(gfxDstBuffer, invalidatedArea); + uint8_t opa = GetMixOpaScale(); + BaseGfxEngine::GetInstance()->DrawRect(gfxDstBuffer, GetRect(), invalidatedArea, *style_, opa); Style style = GetStyleConst(); style.textColor_ = GetTextColor(); - OpacityType opa = GetMixOpaScale(); + Rect origContentRect = GetOrigRect(); + if (transMap_ != nullptr) { + transMap_->SetTransMapRect(origContentRect); + labelText_->SetTransformMap(*transMap_); + } + origContentRect.SetX(origContentRect.GetX() + style_->paddingLeft_ + style_->borderWidth_); + origContentRect.SetY(origContentRect.GetY() + style_->paddingTop_ + style_->borderWidth_); + origContentRect.SetWidth(GetWidth()); + origContentRect.SetHeight(GetHeight()); labelText_->OnDraw(gfxDstBuffer, invalidatedArea, GetOrigRect(), - GetContentRect(), offsetX_, style, ellipsisIndex_, opa); + origContentRect, offsetX_, style, ellipsisIndex_, opa); } } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/draw/draw_utils.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/draw/draw_utils.cpp index 943688dea..3a101158c 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/draw/draw_utils.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/draw/draw_utils.cpp @@ -303,7 +303,12 @@ void DrawUtils::DrawLetterVectorPath(BufferInfo& gfxDstBuffer, const LabelLetter originX = originX - path.advance; posX = posX - path.advance; } - if ((posX + letterW < letterInfo.mask.GetLeft()) || (posX > letterInfo.mask.GetRight()) || + + if (letterInfo.transMap != nullptr) { + if (!letterInfo.transMap->GetBoxRect().IsIntersect(letterInfo.mask)) { + return; + } + } else if ((posX + letterW < letterInfo.mask.GetLeft()) || (posX > letterInfo.mask.GetRight()) || (posY + letterH < letterInfo.mask.GetTop()) || (posY > letterInfo.mask.GetBottom())) { return; } diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_label.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_label.h index b3c67ebc5..af4e3c7ee 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_label.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_label.h @@ -410,15 +410,6 @@ public: */ void SetHeight(int16_t height) override; - /** - * @brief Sets the transform for this label text. - * - * @param transMap Indicates the transformation matrix. - * @since 1.0 - * @version 1.0 - */ - void SetTextTransformMap(TransformMap& transMap); - void ReMeasure() override; std::string GetGuiInfo() const override; diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/brandy/policy_default_config.h b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/brandy/policy_default_config.h index e3ea34fb0..382a06903 100755 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/brandy/policy_default_config.h +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/brandy/policy_default_config.h @@ -232,28 +232,28 @@ static StrategyConfig g_defaultInputStrategies[] = { }; static AudioStrategy g_defaultPriorityToStrategies[][OUTPUT_STRATEGY_MAP_COLUMN_SIZE] = { - {STRATEGY_NONE, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_REJECT, + {STRATEGY_NONE, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_DELAY, STRATEGY_DELAY}, {STRATEGY_EXCLUSIVE, STRATEGY_NONE, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_DELAY, STRATEGY_DELAY}, - {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_NONE, STRATEGY_REJECT, STRATEGY_REJECT, + {STRATEGY_EXCLUSIVE, STRATEGY_MIX, STRATEGY_NONE, STRATEGY_REJECT, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_DELAY, STRATEGY_DELAY}, {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_NONE, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_DELAY, STRATEGY_DELAY}, {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_NONE, - STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_MIX}, + STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_MIX}, {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, - STRATEGY_NONE, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_DELAY}, + STRATEGY_NONE, STRATEGY_REJECT, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_DELAY}, + {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, + STRATEGY_EXCLUSIVE, STRATEGY_NONE, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_DELAY}, {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, - STRATEGY_EXCLUSIVE, STRATEGY_NONE, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_DELAY}, - {STRATEGY_EXCLUSIVE, STRATEGY_MIX, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_MIX, STRATEGY_NONE, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_MIX}, {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_NONE, STRATEGY_MIX, STRATEGY_MIX}, {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, - STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_NONE, STRATEGY_EXCLUSIVE}, + STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_NONE, STRATEGY_EXCLUSIVE}, {STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, - STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_NONE}, + STRATEGY_EXCLUSIVE, STRATEGY_EXCLUSIVE, STRATEGY_MIX, STRATEGY_MIX, STRATEGY_REJECT, STRATEGY_NONE}, }; static AudioStrategy g_defaultInputPriorityToStrategies[][INPUT_STRATEGY_MAP_COLUMN_SIZE] = { diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c index ee97596ec..ccc6cc1c0 100755 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c @@ -668,6 +668,11 @@ static int32_t GetRoutedDeviceForStream(AudioRoutedStreamDescriptor *routedStrea static void GetMixWeight(InterruptElement *interruptEl, float materStreamTypeVolume) { + // 如果是来电铃声则不进行声音的削弱,保证和通话都同时混音存在 + if (interruptEl->routedStreamDesc.streamDesc.streamType == AUDIO_STREAM_RING) { + interruptEl->routedStreamDesc.mixWeight = 1; + return; + } float curStreamTypeVolume = interruptEl->routedStreamDesc.streamDesc.streamTypeVolume; if (!StreamMgrGetTypeVolume(interruptEl->streamType, &curStreamTypeVolume)) { ALOGI("get nv volume failed!, streamType:%x", interruptEl->streamType); @@ -731,7 +736,9 @@ static void DeleteDelayStreamFromList(const InterruptElement *interruptEl, List { for (ListIterator it = ListIterBegin(list); it != ListIterEnd(list);) { InterruptElement *curInterruptEl = (InterruptElement *)ListIterData(it); - if (curInterruptEl->streamType == interruptEl->streamType) { + // 判断当前的流类型是否已经创建了流,如果已经创建了流则不进行焦点的删除,没有则需要进行焦点的删除 + if (curInterruptEl->streamType == interruptEl->streamType && + !StreamMgrIsCreateStreamByType(curInterruptEl->streamType)) { it = ListIterErase(list, it); break; } else { diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/include/stream_manager.h b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/include/stream_manager.h index 0f5f1fe26..645d27aed 100755 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/include/stream_manager.h +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/include/stream_manager.h @@ -185,6 +185,8 @@ int32_t StreamManagerSetParam(AudioLinkDirection direction, const char *param, u int32_t StreamManagerGetParam(AudioLinkDirection direction, char *param, uint32_t len); +bool StreamMgrIsCreateStreamByType(AudioStreamType streamType); + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c index 5ce62d53f..ee7b0c506 100755 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c @@ -577,6 +577,10 @@ static bool IsCurrentStreamMute(AudioStreamType streamType) static bool IsAllStreamDestroyed(AudioStreamType streamType) { + if (streamType != AUDIO_STREAM_VOICE_CALL_BT_SCO && + streamType != AUDIO_STREAM_VOICE_CALL_VOIP) { + return true; + } for (int32_t i = 0; i < CONCURRENT_ACTIVE_STREAM_MAX_NUM; i++) { StreamSimpleInfo curStreamInfo = g_streamMgrContext.simpleInfos[i]; if (curStreamInfo.streamType != streamType) { @@ -1331,6 +1335,30 @@ int32_t StreamManagerGetParam(AudioLinkDirection direction, char *param, uint32_ return ret; } +bool StreamMgrIsCreateStreamByType(AudioStreamType streamType) +{ + bool isFound = false; + for (uint32_t i = 0; i < MAX_STREAM_IN_NUM; i++) { + StreamSimpleInfo curStreamInfo = g_streamMgrContext.curInputStreamInfo[i]; + if (curStreamInfo.streamType == streamType && + curStreamInfo.streamId != -1) { + isFound = true; + break; + } + } + if (!isFound) { + for (uint32_t i = 0; i < CONCURRENT_ACTIVE_STREAM_MAX_NUM; i++) { + StreamSimpleInfo curStreamInfo = g_streamMgrContext.simpleInfos[i]; + if (curStreamInfo.streamType == streamType && + curStreamInfo.streamId != -1) { + isFound = true; + break; + } + } + } + return isFound; +} + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/include/audio_module.h b/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/include/audio_module.h index 23c96bbde..2b83b5058 100755 --- a/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/include/audio_module.h +++ b/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/include/audio_module.h @@ -376,6 +376,24 @@ public: */ static JSIValue OnTimeUpdateSetter(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + /** + * the getter of stream type + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSIValue StreamTypeGetter(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + /** + * the setter of stream type + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSIValue StreamTypeSetter(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + private: static JSIValue GetEventCallback(const AudioEventListener *listener); diff --git a/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/include/audio_player.h b/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/include/audio_player.h index 30105485e..1f061c442 100755 --- a/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/include/audio_player.h +++ b/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/include/audio_player.h @@ -18,6 +18,7 @@ #include "jsi.h" #include "player.h" +#include "audio_base_type.h" #include "media_thread_adapt.h" namespace OHOS { @@ -117,6 +118,8 @@ public: bool SetVolume(double volume); + bool SetStreamType(AudioStreamType streamType); + bool SetMuted(bool muted); int32_t SetAudioSessionId(uint32_t sessionId); @@ -179,6 +182,7 @@ private: bool isRunning_; bool isSysSrc_; MediaThreadIdHandle updateTimeProcess_; + AudioStreamType streamType_ = AUDIO_STREAM_MUSIC; }; } // namespace ACELite } // namespace OHOS diff --git a/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/src/audio_module.cpp b/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/src/audio_module.cpp index 174b29fac..98a0e8bf5 100755 --- a/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/src/audio_module.cpp +++ b/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/src/audio_module.cpp @@ -28,6 +28,7 @@ static Audio::AudioManager& g_amInstance = Audio::AudioManager::GetInstance(); static bool recordPlayerStatus = false; +static AudioStreamType g_streamType = AUDIO_STREAM_MUSIC; static int *interruptType; void AudioModule::ActivateAudioInterrupt() @@ -35,7 +36,7 @@ void AudioModule::ActivateAudioInterrupt() if (interrupt == nullptr) { interruptType = new int; interrupt = new Audio::AudioInterrupt(); - interrupt->streamType = AUDIO_STREAM_MUSIC; + interrupt->streamType = g_streamType; interrupt->sessionID = g_amInstance.MakeSessionId(); interrupt->interruptListener = std::make_shared(); g_amInstance.ActivateAudioInterrupt(*interrupt); @@ -55,6 +56,7 @@ void AudioModule::DeactivateAudioInterrupt() delete interruptType; interruptType = nullptr; } + g_streamType = AUDIO_STREAM_MUSIC; } void InterruptAsyncExecuteCallback(void *arg) @@ -196,6 +198,7 @@ JSIValue AudioModule::SrcSetter(const JSIValue thisVal, const JSIValue *args, ui char *src = JSI::ValueToString(args[0]); bool autoPlay = AudioPlayer::GetInstance()->GetAutoPlay(); bool ret = AudioPlayer::GetInstance()->SetSrc(src, false); + AudioPlayer::GetInstance()->SetStreamType(g_streamType); AudioPlayer::GetInstance()->SetAudioSessionId(interrupt->sessionID); if (autoPlay) { AudioPlayer::GetInstance()->Play(); @@ -213,6 +216,7 @@ JSIValue AudioModule::SrcInnerSetter(const JSIValue thisVal, const JSIValue *arg char *src = JSI::ValueToString(args[0]); bool autoPlay = AudioPlayer::GetInstance()->GetAutoPlay(); bool ret = AudioPlayer::GetInstance()->SetSrc(src, true); + AudioPlayer::GetInstance()->SetStreamType(g_streamType); AudioPlayer::GetInstance()->SetAudioSessionId(interrupt->sessionID); if (autoPlay) { AudioPlayer::GetInstance()->Play(); @@ -413,6 +417,23 @@ JSIValue AudioModule::OnTimeUpdateSetter(const JSIValue thisVal, const JSIValue return JSI::CreateBoolean(true); } +JSIValue AudioModule::StreamTypeGetter(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + + return JSI::CreateNumber((double)g_streamType); +} + +JSIValue AudioModule::StreamTypeSetter(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + if (argsSize < 1) { + MEDIA_ERR_LOG("1 argument is required."); + return JSI::CreateBoolean(false); + } + double streamType = JSI::ValueToNumber(args[0]); + g_streamType = (AudioStreamType)streamType; + return JSI::CreateBoolean(true); +} + JSIValue AudioModule::GetEventCallback(const AudioEventListener *listener) { return (listener == nullptr) ? JSI::CreateUndefined() : listener->GetCallback(); @@ -458,6 +479,7 @@ void InitAudioModule(JSIValue exports) JSI::SetModuleAPI(exports, "reset", AudioModule::Reset); JSI::SetModuleAPI(exports, "getPlayState", AudioModule::GetPlayState); + AudioModule::DefineProperty(exports, "streamType", AudioModule::StreamTypeGetter, AudioModule::StreamTypeSetter); AudioModule::DefineProperty(exports, "src", AudioModule::SrcGetter, AudioModule::SrcSetter); AudioModule::DefineProperty(exports, "srcInner", AudioModule::SrcInnerGetter, AudioModule::SrcInnerSetter); AudioModule::DefineProperty(exports, "currentTime", AudioModule::CurrentTimeGetter, AudioModule::CurrentTimeSetter); diff --git a/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/src/audio_player.cpp b/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/src/audio_player.cpp index ac804a0f7..0f6a2b5a3 100755 --- a/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/src/audio_player.cpp +++ b/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player_lite/js/builtin/src/audio_player.cpp @@ -233,10 +233,10 @@ bool AudioPlayer::CreatePlayer() return false; } if (muted_) { - g_amInstance.SetVolume(AUDIO_STREAM_MUSIC, 0); + g_amInstance.SetVolume(streamType_, 0); } else { double volume = GetVolume() * MAX_VOLUME; - if (!g_amInstance.SetVolume(AUDIO_STREAM_MUSIC, volume)) { + if (!g_amInstance.SetVolume(streamType_, volume)) { MEDIA_ERR_LOG("fail to reset volume"); } } @@ -406,7 +406,7 @@ const char *AudioPlayer::GetStatus() const double AudioPlayer::GetVolume() { - int32_t volume = g_amInstance.GetVolume(AUDIO_STREAM_MUSIC); + int32_t volume = g_amInstance.GetVolume(streamType_); volume_ = static_cast(volume) / MAX_VOLUME; return volume_; } @@ -506,7 +506,7 @@ bool AudioPlayer::SetVolume(double volume) return false; } float parsedVolume = static_cast(volume * MAX_VOLUME); - bool succ = g_amInstance.SetVolume(AUDIO_STREAM_MUSIC, parsedVolume); + bool succ = g_amInstance.SetVolume(streamType_, parsedVolume); if (!succ) { MEDIA_ERR_LOG("fail to set volume."); return false; @@ -515,10 +515,20 @@ bool AudioPlayer::SetVolume(double volume) return true; } +bool AudioPlayer::SetStreamType(AudioStreamType streamType) +{ + if (player_->SetAudioStreamType(streamType) != 0) { + MEDIA_ERR_LOG("fail to SetAudioStreamType streamType = %x.", streamType); + return false; + } + streamType_ = streamType; + return true; +} + bool AudioPlayer::SetMuted(bool muted) { double volume = muted ? 0.0 : (GetVolume() * MAX_VOLUME); - if (!g_amInstance.SetVolume(AUDIO_STREAM_MUSIC, volume)) { + if (!g_amInstance.SetVolume(streamType_, volume)) { MEDIA_ERR_LOG("fail to set volume."); return false; } diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/player_sample_wrapper.cpp b/code/sdk/middleware/services/media/foundation/sample/wrapper/player_sample_wrapper.cpp index 22b1dea4c..01d4d0457 100755 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/player_sample_wrapper.cpp +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/player_sample_wrapper.cpp @@ -683,6 +683,9 @@ static void PlayerStreamExit(SampleParam *sampleParam) MediaMutexDestroy(&sampleParam->testSample.mutex); MediaThreadCondDestroy(&sampleParam->testSample.cond); sampleParam->taskAlive.store(false); + if (!sampleParam->testSample.isStop) { + MediaThreadSetDetach(sampleParam->playTask, true); + } } void WaitPlayCompletedOrStop(SampleParam *sampleParam) @@ -961,6 +964,7 @@ static int32_t PlaySampleSwitchSong(SampleParam *sampleParam) MediaThreadCondSignal(sampleParam->testSample.cond); MediaMutexUnLock(sampleParam->testSample.mutex); WaitPlayerTaskEnd(sampleParam); + sampleParam->taskAlive.store(true); if (strncmp(sampleParam->control, "prevsong", strlen("prevsong")) == 0) { if (g_currentSongIndex == 0) { g_currentSongIndex = g_totalSongEntries - 1; @@ -1170,7 +1174,8 @@ static void WaitPlayerTaskEnd(SampleParam *sampleParam) continue; } if (sampleParam->playTask == g_playerTask[i].playTask && - sampleParam->streamType == g_playerTask[i].streamType) { + sampleParam->streamType == g_playerTask[i].streamType && + sampleParam->testSample.isStop) { MediaMutexUnLock(g_playerTaskMutex); MediaThreadJoin(&sampleParam->playTask); MediaMutexLock(g_playerTaskMutex); @@ -1216,7 +1221,7 @@ static void StorePlayerTaskInfo(SampleParam *sampleParam) int32_t PlayerSample(int32_t argc, const char** argv) { - SourceType sourceType = SourceType::SOURCE_TYPE_FD; + SourceType sourceType = SourceType::SOURCE_TYPE_URI; int32_t ret = PlayerSampleInit(&g_sampleParam, argc, argv, sourceType); if (ret != 0) { return ret; @@ -1225,8 +1230,6 @@ int32_t PlayerSample(int32_t argc, const char** argv) argv[0], strlen(argv[0]) + 1) != EOK) { MEDIA_ERR_LOG("memcpy_s failed, g_sampleParam->control:%s", g_sampleParam->control); } - MEDIA_INFO_LOG("argv[0]:%s", argv[0]); - /* todo :Modifying playback keywords */ if (strncmp(g_sampleParam->control, "xx", strlen("xx")) == 0) { if (g_sampleParam->taskAlive.load()) { MEDIA_ERR_LOG("playerTask exists, Enter the stop command first"); @@ -1276,7 +1279,7 @@ FREE: int32_t TonePlayerSampleTest(int32_t argc, const char *argv[]) { - SourceType sourceType = SourceType::SOURCE_TYPE_FD; + SourceType sourceType = SourceType::SOURCE_TYPE_URI; int32_t ret = PlayerSampleInit(&g_tonePlayersampleParam, argc, argv, sourceType); if (ret != 0) { return ret; @@ -1285,8 +1288,6 @@ int32_t TonePlayerSampleTest(int32_t argc, const char *argv[]) argv[0], strlen(argv[0]) + 1) != EOK) { MEDIA_ERR_LOG("memcpy_s failed, g_tonePlayersampleParam->control:%s", g_tonePlayersampleParam->control); } - MEDIA_INFO_LOG("argv[0]:%s", argv[0]); - /* todo :Modifying playback keywords */ if (strncmp(g_tonePlayersampleParam->control, "xx", strlen("xx")) == 0) { if (g_tonePlayersampleParam->taskAlive.load()) { MEDIA_ERR_LOG("playerTask exists, Enter the stop command first"); diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp index 62a4c9557..f8c0b9093 100644 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp @@ -172,11 +172,6 @@ static bool InitPlayerResources(MediaVideoPlay *videoPlay) } videoPlay->player_ = player; - - videoPlay->isPlaybackCompleted_ = false; - videoPlay->interruptHintStop_ = false; - videoPlay->playError_ = false; - return true; } @@ -366,20 +361,22 @@ void *MediaVideoPlay::VideoPlayThread(void *arg) MEDIA_ERR_LOG("requset audio focus failed\n"); return nullptr; } - int32_t ret = RunVideoPlay(videoPlay); if (ret != 0) { MEDIA_ERR_LOG("run video play failed\n"); - (void)ReleaseAudioFocus(videoPlay); - return nullptr; } success = ReleaseAudioFocus(videoPlay); if (!success) { MEDIA_ERR_LOG("release audio focus failed\n"); - return nullptr; } - MEDIA_ERR_LOG("exit all!\n"); + MediaMutexLock(videoPlay->mutex_); + if (!videoPlay->isPlaybackStopped_ && videoPlay->IsSyncExitMode()) { + videoPlay->SetSyncExitMode(false); + MediaThreadSetDetach(videoPlay->threadHandle_, true); + } + MediaMutexUnLock(videoPlay->mutex_); + MEDIA_INFO_LOG("exit all!\n"); return nullptr; } @@ -406,22 +403,34 @@ MediaVideoPlay::~MediaVideoPlay() play = nullptr; } +void MediaVideoPlay::ResetVideoPlayState(void) +{ + isExited_ = false; + isPlaybackCompleted_ = false; + isPlaybackStopped_ = false; + interruptHintStop_ = false; + playError_ = false; + isSyncExitMode_ = true; + isPause_ = false; + isPlayed_ = false; +} + int32_t MediaVideoPlay::StartVideoPlay(void) { if (isEntered_) { MEDIA_INFO_LOG("video play is not stop, can not start!"); return MEDIA_OK; } - isExited_ = false; isEntered_ = true; + ResetVideoPlayState(); MediaThreadattr attr = { "VideoPlayThread", 0x2000, THREAD_SCHED_INVALID, 0, true }; if (isSyncExitMode_) { - MediaThreadJoin(&threadHandle_); attr.detached = false; } threadHandle_ = MediaThreadCreate(VideoPlayThread, this, &attr); - if (threadHandle_ == NULL) { + if (threadHandle_ == nullptr) { MEDIA_ERR_LOG("create thread failed\n"); + isEntered_ = false; return MEDIA_ERR; } play = this; @@ -496,7 +505,6 @@ int32_t MediaVideoPlay::GetDumpInfo(PlayerDebugInfo *playerInfo) int32_t MediaVideoPlay::StopVideoPlay(void) { - MEDIA_ERR_LOG("StopVideoPlay start!"); MediaMutexLock(mutex_); if (isPlaybackStopped_ || isPlaybackCompleted_ || interruptHintStop_) { if (isLoop_) { @@ -513,12 +521,14 @@ int32_t MediaVideoPlay::StopVideoPlay(void) } isPlaybackStopped_ = true; MediaThreadCondSignal(cond_); - MediaMutexUnLock(mutex_); if (isSyncExitMode_) { + MediaMutexUnLock(mutex_); MediaThreadJoin(&threadHandle_); - isPlaybackStopped_ = false; dynamic_cast(surface_)->ClearBuffers(); // clear buffers safely in sync mode to reduce peak memory + play = nullptr; + return MEDIA_OK; } + MediaMutexUnLock(mutex_); play = nullptr; return MEDIA_OK; } @@ -537,25 +547,21 @@ void MediaVideoPlay::SetVideoPlayLoop(bool isLoop) void MediaVideoPlay::SetSyncExitMode(bool isSyncExitMode) { - MediaMutexLock(mutex_); if (!isEntered_) { isSyncExitMode_ = isSyncExitMode; } - MediaMutexUnLock(mutex_); +} + +bool MediaVideoPlay::IsSyncExitMode() +{ + return isSyncExitMode_; } void MediaVideoPlay::DestroyVideoPlaySource(void) { - needSendBackgroundFrame_ = false; - StopVideoPlay(); - uint32_t count = 0; - while (!IsExitCompletely()) { - count++; - if (count == WAIT_VIDEO_EXIT_MAX_RETRY_COUNT) { - MEDIA_ERR_LOG("media video play exit timeout\n"); - break; - } - usleep(WAIT_VIDEO_EXIT_SUCCESS_US); + if (isEntered_) { + needSendBackgroundFrame_ = false; + StopVideoPlay(); } } }; diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h index 2643ad4b4..549ec2245 100644 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h @@ -37,6 +37,7 @@ public: int32_t GetDumpInfo(PlayerDebugInfo *playerInfo); void SetVideoPlayLoop(bool isLoop); void SetSyncExitMode(bool isSyncExitMode); + bool IsSyncExitMode(void); bool IsExitCompletely(void); Surface *surface_ = nullptr; AudioInterrupt interrupt_; @@ -63,6 +64,7 @@ public: static MediaVideoPlay *play; private: bool isSyncExitMode_ = true; + void ResetVideoPlayState(void); static void *VideoPlayThread(void *arg); void DestroyVideoPlaySource(void); }; diff --git a/code/sdk/middleware/services/media/foundation/utils/include/media_thread_adapt.h b/code/sdk/middleware/services/media/foundation/utils/include/media_thread_adapt.h index 0bebc5456..6f8c93f04 100755 --- a/code/sdk/middleware/services/media/foundation/utils/include/media_thread_adapt.h +++ b/code/sdk/middleware/services/media/foundation/utils/include/media_thread_adapt.h @@ -79,6 +79,8 @@ void MediaThreadCondTimeWait(MediaThreadCondHandle condHandle, MediaMutexHandle */ void MediaThreadCondDestroy(MediaThreadCondHandle *condHandle); +void MediaThreadSetDetach(MediaThreadIdHandle thdId, bool detach); + #ifdef __cplusplus }; #endif diff --git a/code/sdk/middleware/services/media/foundation/utils/src/media_thread_adapt.cpp b/code/sdk/middleware/services/media/foundation/utils/src/media_thread_adapt.cpp index f44abc9b3..328dd5dfd 100755 --- a/code/sdk/middleware/services/media/foundation/utils/src/media_thread_adapt.cpp +++ b/code/sdk/middleware/services/media/foundation/utils/src/media_thread_adapt.cpp @@ -243,40 +243,40 @@ static uint32_t MediaGetThreadManagerIdxFromIdHandle(MediaThreadIdHandle id) } #define THREAD_EVENT_EXIT_FLAG 0x45584954U /* EXIT ascii */ +#ifdef CMSIS_SUPPORT +static void MediaThreadFunc(void *arg) +#else static void *MediaThreadFunc(void *arg) +#endif { if (arg == nullptr) { +#ifdef CMSIS_SUPPORT + return; +#else return nullptr; +#endif } - + MediaThreadMember *member = (MediaThreadMember *)arg; + member->process(member->argument); MediaMutexLock(g_mediaThreadManagerLock); - MediaThreadMember member = {}; - if (memcpy_s(&member, sizeof(MediaThreadMember), arg, sizeof(MediaThreadMember)) != EOK) { - MediaMutexUnLock(g_mediaThreadManagerLock); - return nullptr; + if (member->detached) { + uint32_t idx = MediaGetThreadManagerIdxFromIdHandle(member->subId); + if (idx < THREAD_MANAGER_MAX_CNT) { + g_mediaThreadManager[idx] = nullptr; + } + free(arg); } - MediaMutexUnLock(g_mediaThreadManagerLock); - - member.process(member.argument); - #ifdef CMSIS_SUPPORT #ifndef CMSIS_SUPPORT_JOIN - if (!member.detached) { - osThreadFlagsSet(member.mainId, THREAD_EVENT_EXIT_FLAG); + else { + osThreadFlagsSet(member->mainId, THREAD_EVENT_EXIT_FLAG); } #endif #endif - if (member.detached) { - MediaMutexLock(g_mediaThreadManagerLock); - uint32_t idx = MediaGetThreadManagerIdxFromIdHandle(member.subId); - if (idx < THREAD_MANAGER_MAX_CNT) { - g_mediaThreadManager[idx] = nullptr; - } - free(arg); - MediaMutexUnLock(g_mediaThreadManagerLock); - } - + MediaMutexUnLock(g_mediaThreadManagerLock); +#ifndef CMSIS_SUPPORT return nullptr; +#endif } static int32_t MediaDoCreateThread(MediaThreadMember *member, const MediaThreadattr *attr) @@ -294,8 +294,6 @@ static int32_t MediaDoCreateThread(MediaThreadMember *member, const MediaThreada osThreadAttr_t taskAttr = { attr->name, attrBits, nullptr, 0, nullptr, attr->stackSize, osPriorityNormal, 0, 0 }; - // Allocate the memory of the thread to the psram. - // taskAttr.stack_mem = memalign(0x10, attr->stackSize); MediaSetCmsisThreadPriorityAttr(&taskAttr, attr->prioty); subId = osThreadNew((osThreadFunc_t)MediaThreadFunc, member, &taskAttr); } @@ -492,6 +490,17 @@ void MediaThreadCondDestroy(MediaThreadCondHandle *condHandle) #endif } +void MediaThreadSetDetach(MediaThreadIdHandle thdId, bool detach) +{ + MediaMutexLock(g_mediaThreadManagerLock); + uint32_t idx = MediaGetThreadManagerIdxFromIdHandle(thdId); + if (idx < THREAD_MANAGER_MAX_CNT) { + MediaThreadMember *member = g_mediaThreadManager[idx]; + member->detached = detach; + } + MediaMutexUnLock(g_mediaThreadManagerLock); +} + #ifdef __cplusplus }; #endif diff --git a/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_out.c b/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_out.c index 0ea866480..20f831efd 100755 --- a/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_out.c +++ b/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_out.c @@ -105,6 +105,7 @@ typedef struct SubPortOutContext { /* record track context */ SubPortTrackOutContext *portTrack[AO_DEV_MAX_TRACK_NUM]; #endif + MediaHalMutexHandle createTrackMutex; } SubPortOutContext; typedef struct { @@ -272,41 +273,54 @@ static int32_t SubPortTrackOutManagerFreeTrack(int32_t trackId) return MEDIA_HAL_ERR; } -static void SubPortTrackOutInit(SubPortTrackOutContext *portTrackOutCtx, const struct PortPluginAttr *inputAttr) +static int32_t SubPortTrackOutInit(SubPortTrackOutContext **portTrackOutCtx, const struct PortPluginAttr *inputAttr) { + SubPortTrackOutContext *subPortTrackOutCtx = (SubPortTrackOutContext *)malloc(sizeof(SubPortTrackOutContext)); + if (subPortTrackOutCtx == NULL) { + MEDIA_HAL_LOGE(MODULE_NAME, "malloc failed"); + return MEDIA_HAL_NO_MEM; + } + + if (memset_s(subPortTrackOutCtx, sizeof(SubPortTrackOutContext), 0, sizeof(SubPortTrackOutContext)) != EOK) { + MEDIA_HAL_LOGE(MODULE_NAME, "memset_s failed"); + free(subPortTrackOutCtx); + return MEDIA_HAL_ERR; + } #ifdef AUDIO_SDK_SUPPORT - portTrackOutCtx->inputAttr = *inputAttr; + subPortTrackOutCtx->inputAttr = *inputAttr; /* The default bit width is 16 bits. The 24-bit width is processed separately. */ - portTrackOutCtx->inputAttr.bitWidth = AUDIO_BIT_WIDTH_16_BIT; - - portTrackOutCtx->common.audioPin = PIN_OUT_SPEAKER; - portTrackOutCtx->common.GetFrameCount = NULL; - portTrackOutCtx->common.GetLatency = AudioPrimarySubPortOutGetLatency; - portTrackOutCtx->common.EnableTrack = AudioPrimarySubPortOutEnableTrack; - portTrackOutCtx->common.DisableTrack = AudioPrimarySubPortOutDisableTrack; - portTrackOutCtx->common.PauseTrack = AudioPrimarySubPortOutPauseTrack; - portTrackOutCtx->common.ResumeTrack = AudioPrimarySubPortOutResumeTrack; - portTrackOutCtx->common.FlushTrack = AudioPrimarySubPortOutFlushTrack; - portTrackOutCtx->common.AcquireFrame = NULL; - portTrackOutCtx->common.SendFrame = AudioPrimarySubPortOutSendFrame; - portTrackOutCtx->common.GetPosition = AudioPrimarySubPortOutGetPosition; - portTrackOutCtx->common.SetMute = AudioPrimarySubPortOutTrackSetMute; - portTrackOutCtx->common.GetMute = AudioPrimarySubPortOutTrackGetMute; - portTrackOutCtx->common.SetVolume = AudioPrimarySubPortOutTrackSetVolume; - portTrackOutCtx->common.GetVolume = AudioPrimarySubPortOutTrackGetVolume; - portTrackOutCtx->common.Invoke = AudioPrimarySubPortOutInvoke; - portTrackOutCtx->common.RegCallback = AudioPrimarySubPortOutRegCallback; - portTrackOutCtx->volumeToggleConfig.toggle_valid = false; - portTrackOutCtx->volumeToggleConfig.toggle_count = 0; - portTrackOutCtx->notifyToggleConfig.toggle_valid = false; - portTrackOutCtx->notifyToggleConfig.toggle_count = 0; + subPortTrackOutCtx->inputAttr.bitWidth = AUDIO_BIT_WIDTH_16_BIT; + + subPortTrackOutCtx->common.audioPin = PIN_OUT_SPEAKER; + subPortTrackOutCtx->common.GetFrameCount = NULL; + subPortTrackOutCtx->common.GetLatency = AudioPrimarySubPortOutGetLatency; + subPortTrackOutCtx->common.EnableTrack = AudioPrimarySubPortOutEnableTrack; + subPortTrackOutCtx->common.DisableTrack = AudioPrimarySubPortOutDisableTrack; + subPortTrackOutCtx->common.PauseTrack = AudioPrimarySubPortOutPauseTrack; + subPortTrackOutCtx->common.ResumeTrack = AudioPrimarySubPortOutResumeTrack; + subPortTrackOutCtx->common.FlushTrack = AudioPrimarySubPortOutFlushTrack; + subPortTrackOutCtx->common.AcquireFrame = NULL; + subPortTrackOutCtx->common.SendFrame = AudioPrimarySubPortOutSendFrame; + subPortTrackOutCtx->common.GetPosition = AudioPrimarySubPortOutGetPosition; + subPortTrackOutCtx->common.SetMute = AudioPrimarySubPortOutTrackSetMute; + subPortTrackOutCtx->common.GetMute = AudioPrimarySubPortOutTrackGetMute; + subPortTrackOutCtx->common.SetVolume = AudioPrimarySubPortOutTrackSetVolume; + subPortTrackOutCtx->common.GetVolume = AudioPrimarySubPortOutTrackGetVolume; + subPortTrackOutCtx->common.Invoke = AudioPrimarySubPortOutInvoke; + subPortTrackOutCtx->common.RegCallback = AudioPrimarySubPortOutRegCallback; + subPortTrackOutCtx->volumeToggleConfig.toggle_valid = false; + subPortTrackOutCtx->volumeToggleConfig.toggle_count = 0; + subPortTrackOutCtx->notifyToggleConfig.toggle_valid = false; + subPortTrackOutCtx->notifyToggleConfig.toggle_count = 0; MEDIA_HAL_LOGD(MODULE_NAME, "success"); #else MEDIA_HAL_UNUSED(portTrackOutCtx); MEDIA_HAL_UNUSED(inputAttr); #endif + *portTrackOutCtx = subPortTrackOutCtx; + return MEDIA_HAL_OK; } #ifdef AUDIO_SDK_SUPPORT @@ -325,9 +339,10 @@ static uapi_snd_aef_profile ConvertAudioCategoryToAudioEffectProfile(const enum static int32_t AODevOpen(SubPortOutContext *portOutCtx, const enum AudioCategory audioCategory) { #ifdef AUDIO_SDK_SUPPORT + MediaHalInitStaticMutexLock(&g_subPortTrackOutLock); MediaHalMutexLock(g_subPortTrackOutLock); if (g_subPortTrackOutSndRefCount == 0) { - int32_t ret; + int32_t ret = MEDIA_HAL_OK; uapi_snd_attr sndAttr = {}; MEDIA_HAL_DOFUNC_TIME(ret = uapi_snd_get_default_attr(portOutCtx->sndDevId, &sndAttr)); if (ret != MEDIA_HAL_OK) { @@ -704,6 +719,7 @@ int32_t AudioPrimarySubPortOutPauseTrack(AudioHandle trackHandle) int32_t ret; #ifdef MINI_MEMORY_SUPPORT + MediaHalMutexLock(portTrackOutCtx->subPortCtx->createTrackMutex); ret = AudioSDKStopInternal(portTrackOutCtx); CHK_FAILED_NO_RETURN(ret, MEDIA_HAL_OK, "audio stop failed"); ret = AudioSDKDetachInternal(portTrackOutCtx); @@ -711,6 +727,7 @@ int32_t AudioPrimarySubPortOutPauseTrack(AudioHandle trackHandle) ret = AudioSDKCloseInternal(portTrackOutCtx); CHK_FAILED_NO_RETURN(ret, MEDIA_HAL_OK, "audio close failed"); portTrackOutCtx->isReleased = true; + MediaHalMutexUnLock(portTrackOutCtx->subPortCtx->createTrackMutex); #else MEDIA_HAL_DOFUNC_TIME(ret = uapi_snd_track_pause(portTrackOutCtx->trackHandle)); CHK_FAILED_RETURN(ret, MEDIA_HAL_OK, ret, "sound track pause failed"); @@ -806,8 +823,13 @@ int32_t AudioPrimarySubPortOutResumeTrack(AudioHandle trackHandle) int32_t ret; #ifdef MINI_MEMORY_SUPPORT + MediaHalMutexLock(portTrackOutCtx->subPortCtx->createTrackMutex); ret = AudioSDKOpenInternal(portTrackOutCtx); - CHK_FAILED_RETURN(ret, MEDIA_HAL_OK, ret, "audio open failed"); + if (ret != MEDIA_HAL_OK) { + MEDIA_HAL_LOGE(MODULE_NAME, "audio open failed"); + MediaHalMutexUnLock(portTrackOutCtx->subPortCtx->createTrackMutex); + return ret; + } ret = AudioSDKAttachInternal(portTrackOutCtx); if (ret != MEDIA_HAL_OK) { MEDIA_HAL_LOGE(MODULE_NAME, "audio attach failed"); @@ -826,6 +848,7 @@ int32_t AudioPrimarySubPortOutResumeTrack(AudioHandle trackHandle) MEDIA_HAL_LOGE(MODULE_NAME, "register adp event failed"); goto AUDIO_STOP; } + MediaHalMutexUnLock(portTrackOutCtx->subPortCtx->createTrackMutex); #else MEDIA_HAL_DOFUNC_TIME(ret = uapi_snd_track_resume(portTrackOutCtx->trackHandle)); CHK_FAILED_RETURN(ret, MEDIA_HAL_OK, ret, "sound track resume failed"); @@ -834,8 +857,6 @@ int32_t AudioPrimarySubPortOutResumeTrack(AudioHandle trackHandle) #else MEDIA_HAL_UNUSED(trackHandle); #endif - - MEDIA_HAL_LOGD(MODULE_NAME, "success"); return MEDIA_HAL_OK; #ifdef MINI_MEMORY_SUPPORT @@ -845,6 +866,7 @@ AUDIO_DETACH: (void)AudioSDKDetachInternal(portTrackOutCtx); AUDIO_CLOSE: (void)AudioSDKCloseInternal(portTrackOutCtx); + MediaHalMutexUnLock(portTrackOutCtx->subPortCtx->createTrackMutex); return ret; #endif } @@ -1006,12 +1028,12 @@ int32_t AudioPrimarySubPortOutTrackSetVolume(AudioHandle trackHandle, float volu CHK_FAILED_RETURN(ret, MEDIA_HAL_OK, ret, "uapi_snd_set_track_volume failed"); portTrackOutCtx->volume = volume; + MEDIA_HAL_LOGI(MODULE_NAME, "set volume %d success", tmpVolume); #else MEDIA_HAL_UNUSED(trackHandle); MEDIA_HAL_UNUSED(volume); #endif - MEDIA_HAL_LOGI(MODULE_NAME, "set volume %f success", volume); return MEDIA_HAL_OK; } @@ -1152,7 +1174,11 @@ int32_t AudioPrimarySubPortOutCreate(AudioHandle *portHandle) ret = MEDIA_HAL_ERR; goto FREE_PORT; } - + portOutCtx->createTrackMutex = MediaHalMutexCreate(NULL); + if (portOutCtx->createTrackMutex == NULL) { + MEDIA_HAL_LOGE(MODULE_NAME, "create mutex failed"); + goto FREE_PORT; + } portOutCtx->sndDevId = sndDevId; *portHandle = portOutCtx; #else @@ -1179,6 +1205,8 @@ int32_t AudioPrimarySubPortOutDestroy(AudioHandle portHandle) (void)SubPortTrackOutManagerDeInit(); + MediaHalMutexDestroy(&portOutCtx->createTrackMutex); + free(portOutCtx); #else MEDIA_HAL_UNUSED(portHandle); @@ -1200,26 +1228,18 @@ int32_t AudioPrimarySubPortOutCreateTrack(AudioHandle portHandle, const struct P AudioHandle *trackHandle) { SubPortOutContext *portOutCtx = (SubPortOutContext *)portHandle; - + MediaHalMutexLock(portOutCtx->createTrackMutex); int32_t sndTrackId = SubPortTrackOutManagerGetFreeTrack(); - CHK_COND_RETURN(sndTrackId == INVALID_ID, MEDIA_HAL_INVALID_PARAM, "no free sound track"); - - int32_t ret; - SubPortTrackOutContext *portTrackOutCtx = (SubPortTrackOutContext *)malloc(sizeof(SubPortTrackOutContext)); - if (portTrackOutCtx == NULL) { - MEDIA_HAL_LOGI(MODULE_NAME, "malloc failed"); - ret = MEDIA_HAL_NO_MEM; - goto FREE_TRACK; + if (sndTrackId == INVALID_ID) { + MEDIA_HAL_LOGE(MODULE_NAME, "no free sound track"); + MediaHalMutexUnLock(portOutCtx->createTrackMutex); + return MEDIA_HAL_INVALID_PARAM; } - - if (memset_s(portTrackOutCtx, sizeof(SubPortTrackOutContext), 0, sizeof(SubPortTrackOutContext)) != EOK) { - MEDIA_HAL_LOGE(MODULE_NAME, "memset_s failed"); - ret = MEDIA_HAL_ERR; - goto FREE_TRACK_CTX; + SubPortTrackOutContext *portTrackOutCtx = NULL; + int32_t ret = SubPortTrackOutInit(&portTrackOutCtx, inputAttr); + if (ret != MEDIA_HAL_OK || portTrackOutCtx == NULL) { + goto FREE_TRACK; } - - SubPortTrackOutInit(portTrackOutCtx, inputAttr); - #ifdef AUDIO_SDK_SUPPORT ret = AODevOpen(portOutCtx, portTrackOutCtx->inputAttr.type); if (ret != MEDIA_HAL_OK) { @@ -1240,7 +1260,7 @@ int32_t AudioPrimarySubPortOutCreateTrack(AudioHandle portHandle, const struct P portOutCtx->portTrack[sndTrackId] = portTrackOutCtx; *trackHandle = &portTrackOutCtx->common; #endif - MEDIA_HAL_LOGD(MODULE_NAME, "success"); + MediaHalMutexUnLock(portOutCtx->createTrackMutex); return MEDIA_HAL_OK; AO_DEV_CLOSE: @@ -1253,6 +1273,7 @@ FREE_TRACK: #ifdef AUDIO_SDK_SUPPORT (void)SubPortTrackOutManagerFreeTrack(sndTrackId); #endif + MediaHalMutexUnLock(portOutCtx->createTrackMutex); return ret; } @@ -1275,9 +1296,12 @@ int32_t AudioPrimarySubPortOutDestroyTrack(AudioHandle portHandle, AudioHandle t { SubPortOutContext *portOutCtx = (SubPortOutContext *)portHandle; SubPortTrackOutContext *portTrackOutCtx = (SubPortTrackOutContext *)trackHandle; - - bool isValid = PrimaryPortIsValidTrack(portOutCtx, portTrackOutCtx); - CHK_FAILED_RETURN(isValid, true, MEDIA_HAL_INVALID_PARAM, "track is invalid"); + MediaHalMutexLock(portOutCtx->createTrackMutex); + if (!PrimaryPortIsValidTrack(portOutCtx, portTrackOutCtx)) { + MEDIA_HAL_LOGE(MODULE_NAME, "track is invalid"); + MediaHalMutexUnLock(portOutCtx->createTrackMutex); + return MEDIA_HAL_INVALID_PARAM; + } #ifdef AUDIO_SDK_SUPPORT int32_t ret = MEDIA_HAL_ERR; @@ -1298,7 +1322,7 @@ int32_t AudioPrimarySubPortOutDestroyTrack(AudioHandle portHandle, AudioHandle t ret = SubPortTrackOutManagerFreeTrack(portTrackOutCtx->sndTrackId); CHK_FAILED_NO_RETURN(ret, MEDIA_HAL_OK, "SubPortTrackOutManagerFreeTrack failed"); #endif - + MediaHalMutexUnLock(portOutCtx->createTrackMutex); if (portTrackOutCtx->inputAttr.extraData != NULL) { free(portTrackOutCtx->inputAttr.extraData); portTrackOutCtx->inputAttr.extraData = NULL; diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-auto-ota-cli/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-auto-ota-cli/libx_vfs_private.a index ef880f2fb..fab1f8b3f 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-auto-ota-cli/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-auto-ota-cli/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-auto-ota-ser/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-auto-ota-ser/libx_vfs_private.a index 9b01f98e3..41190481f 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-auto-ota-ser/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-auto-ota-ser/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autoota/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autoota/libx_vfs_private.a index 54aaff3d7..e94333adf 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autoota/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autoota/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autootacli/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autootacli/libx_vfs_private.a index 54aaff3d7..e94333adf 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autootacli/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autootacli/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-cm/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-cm/libx_vfs_private.a index 54aaff3d7..e94333adf 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-cm/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-cm/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-ct/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-ct/libx_vfs_private.a index 54aaff3d7..e94333adf 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-ct/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-ct/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-fd230/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-fd230/libx_vfs_private.a index 54aaff3d7..e94333adf 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-fd230/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-fd230/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-leakcheck/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-leakcheck/libx_vfs_private.a index 54aaff3d7..e94333adf 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-leakcheck/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-leakcheck/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-obu/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-obu/libx_vfs_private.a index 54aaff3d7..e94333adf 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-obu/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-obu/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-r/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-r/libx_vfs_private.a index bcb9c68b6..423debcc3 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-r/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-r/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-user/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-user/libx_vfs_private.a new file mode 100644 index 000000000..e94333adf Binary files /dev/null and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-user/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-z1/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-z1/libx_vfs_private.a index 54aaff3d7..e94333adf 100644 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-z1/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-z1/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js/libx_vfs_private.a index 54aaff3d7..e94333adf 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-native-js/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-target1-r/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-target1-r/libx_vfs_private.a index 20997206e..872b5e663 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-target1-r/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-target1-r/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-target1/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-target1/libx_vfs_private.a index f860b0bff..7ac9d5959 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-target1/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-target1/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-target3-r/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-target3-r/libx_vfs_private.a index b4bba35f1..cf99d9322 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-target3-r/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-target3-r/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-target3/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-target3/libx_vfs_private.a index f27331968..aa577d55c 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-target3/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-target3/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-target4-r/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-target4-r/libx_vfs_private.a index a086e0514..2602c3c0c 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-target4-r/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-target4-r/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-target4/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-target4/libx_vfs_private.a index 075398e0d..55749991c 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-target4/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-target4/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-target5-r/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-target5-r/libx_vfs_private.a index 618de3ff4..b5e94948f 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-target5-r/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-target5-r/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-target5/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-target5/libx_vfs_private.a index 9d753ef36..7f2fb9452 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-target5/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-target5/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-xts-r/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-xts-r/libx_vfs_private.a index b610a44b0..207600ee1 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-xts-r/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-xts-r/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-xts/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-xts/libx_vfs_private.a index 0f5adb494..73796117e 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/brandy-xts/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/brandy-xts/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/testsuite-brandy-sdk/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/testsuite-brandy-sdk/libx_vfs_private.a index fcf3d99b7..bc04e2b54 100755 Binary files a/code/sdk/middleware/utils/fs/vfs/testsuite-brandy-sdk/libx_vfs_private.a and b/code/sdk/middleware/utils/fs/vfs/testsuite-brandy-sdk/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-auto-ota-cli/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-auto-ota-cli/libfs_yaffs2.a index 1cf0bc695..4a272dfd8 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-auto-ota-cli/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-auto-ota-cli/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-auto-ota-ser/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-auto-ota-ser/libfs_yaffs2.a index a74ab7332..b7524ed21 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-auto-ota-ser/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-auto-ota-ser/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autoota/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autoota/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autoota/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autoota/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autootacli/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autootacli/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autootacli/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autootacli/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-cm/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-cm/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-cm/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-cm/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-ct/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-ct/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-ct/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-ct/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-fd230/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-fd230/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-fd230/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-fd230/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-leakcheck/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-leakcheck/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-leakcheck/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-leakcheck/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-obu/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-obu/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-obu/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-obu/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-r/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-r/libfs_yaffs2.a index 41f28ea0d..b71cd15ce 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-r/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-r/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-user/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-user/libfs_yaffs2.a new file mode 100644 index 000000000..5d415bd2c Binary files /dev/null and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-user/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-z1/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-z1/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100644 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-z1/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-z1/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js/libfs_yaffs2.a index 5ae1a87ce..5d415bd2c 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-target1-r/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-target1-r/libfs_yaffs2.a index a0846371d..83646502d 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-target1-r/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-target1-r/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-target1/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-target1/libfs_yaffs2.a index ec9c60453..1215af7cb 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-target1/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-target1/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-target3-r/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-target3-r/libfs_yaffs2.a index 3709bc3be..0501401cf 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-target3-r/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-target3-r/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-target3/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-target3/libfs_yaffs2.a index 9272dcaf2..c34a14114 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-target3/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-target3/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-target4-r/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-target4-r/libfs_yaffs2.a index 68aaae6c5..97a5e66f3 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-target4-r/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-target4-r/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-target4/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-target4/libfs_yaffs2.a index abe70ce5b..0205ed2a3 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-target4/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-target4/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-target5-r/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-target5-r/libfs_yaffs2.a index 2e6dc12d6..7c32b881a 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-target5-r/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-target5-r/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-target5/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-target5/libfs_yaffs2.a index 43186e711..ad5e09d46 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-target5/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-target5/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-xts-r/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-xts-r/libfs_yaffs2.a index 32c2de08b..4a0c3da05 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-xts-r/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-xts-r/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-xts/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-xts/libfs_yaffs2.a index da076b71b..a798bdafc 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/brandy-xts/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/brandy-xts/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/testsuite-brandy-sdk/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/testsuite-brandy-sdk/libfs_yaffs2.a index 4d9a96aa3..d3ab2f372 100755 Binary files a/code/sdk/middleware/utils/fs/yaffs2/testsuite-brandy-sdk/libfs_yaffs2.a and b/code/sdk/middleware/utils/fs/yaffs2/testsuite-brandy-sdk/libfs_yaffs2.a differ diff --git a/code/sdk/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/src/global.c b/code/sdk/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/src/global.c index fd0febdfc..1f2aef852 100755 --- a/code/sdk/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/src/global.c +++ b/code/sdk/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/src/global.c @@ -120,40 +120,31 @@ void GLOBAL_ValueFree(void *value) } } -int32_t GLOBAL_GetValueById(uint32_t id, const char *path, char **value) +static int32_t GLOBAL_GetValueByIdInternal(uint32_t id, const char *path, const char *locale, char **value) { - if (path == NULL || path[0] == '\0' || value == NULL) { - return MC_FAILURE; - } - - char tempLocale[MAX_LOCALE_LENGTH] = {'\0'}; - int32_t ret = strcpy_s(tempLocale, MAX_LOCALE_LENGTH, g_locale); - if (ret != EOK) { - return MC_FAILURE; - } - char realResourcePath[PATH_MAX] = {'\0'}; GlobalUtilsImpl *utilsImpl = GetGlobalUtilsImpl(); if (utilsImpl->CheckFilePath(path, realResourcePath, PATH_MAX) == MC_FAILURE) { return MC_FAILURE; } - uint32_t idHeaderOffset = utilsImpl->GetOffsetByLocale(realResourcePath, tempLocale, MAX_LOCALE_LENGTH); + uint32_t idHeaderOffset = utilsImpl->GetOffsetByLocale(realResourcePath, locale, MAX_LOCALE_LENGTH); IdHeader idHeader = {0, NULL}; int32_t file = open(realResourcePath, O_RDONLY, S_IRUSR | S_IRGRP | S_IROTH); if (file < 0) { return MC_FAILURE; } - ret = utilsImpl->GetIdHeaderByOffset(file, idHeaderOffset, &idHeader); + int32_t ret = utilsImpl->GetIdHeaderByOffset(file, idHeaderOffset, &idHeader); if (ret != MC_SUCCESS) { close(file); return ret; } + int32_t result = MC_FAILURE; IdItem idItem = {0, INVALID_RES_TYPE, 0, 0, NULL, 0, NULL}; for (uint32_t i = 0; i < idHeader.count; i++) { if (idHeader.idParams[i].id == id) { - int32_t ret = utilsImpl->GetIdItem(file, idHeader.idParams[i].offset, &idItem); + ret = utilsImpl->GetIdItem(file, idHeader.idParams[i].offset, &idItem); if (ret != MC_SUCCESS) { close(file); free(idHeader.idParams); @@ -167,18 +158,19 @@ int32_t GLOBAL_GetValueById(uint32_t id, const char *path, char **value) FreeValue(value); return MC_FAILURE; } + result = MC_SUCCESS; break; } } close(file); free(idHeader.idParams); FreeIdItem(&idItem); - return MC_SUCCESS; + return result; } -int32_t GLOBAL_GetValueByName(const char *name, const char *path, char **value) +int32_t GLOBAL_GetValueById(uint32_t id, const char *path, char **value) { - if (name == NULL || strlen(name) == 0 || path == NULL || strlen(path) == 0 || value == NULL) { + if (path == NULL || path[0] == '\0' || value == NULL) { return MC_FAILURE; } @@ -187,26 +179,39 @@ int32_t GLOBAL_GetValueByName(const char *name, const char *path, char **value) if (ret != EOK) { return MC_FAILURE; } + + char *locales[] = {tempLocale, ""}; + for (int i = 0; i < 2; i++) { // 2 current language and the default. + if (GLOBAL_GetValueByIdInternal(id, path, locales[i], value) == MC_SUCCESS) { + return MC_SUCCESS; + } + } + return MC_FAILURE; +} + +static int32_t GLOBAL_GetValueByNameInternal(const char *name, const char *path, const char *locale, char **value) +{ char realResourcePath[PATH_MAX] = {'\0'}; GlobalUtilsImpl *utilsImpl = GetGlobalUtilsImpl(); if (utilsImpl->CheckFilePath(path, realResourcePath, PATH_MAX) == MC_FAILURE) { return MC_FAILURE; } - uint32_t idHeaderOffset = utilsImpl->GetOffsetByLocale(realResourcePath, tempLocale, MAX_LOCALE_LENGTH); + uint32_t idHeaderOffset = utilsImpl->GetOffsetByLocale(realResourcePath, locale, MAX_LOCALE_LENGTH); IdHeader idHeader = {0, NULL}; int32_t file = open(realResourcePath, O_RDONLY, S_IRUSR | S_IRGRP | S_IROTH); if (file < 0) { return MC_FAILURE; } - ret = utilsImpl->GetIdHeaderByOffset(file, idHeaderOffset, &idHeader); + int32_t ret = utilsImpl->GetIdHeaderByOffset(file, idHeaderOffset, &idHeader); if (ret != MC_SUCCESS) { close(file); return ret; } + int32_t result = MC_FAILURE; IdItem idItem = {0, INVALID_RES_TYPE, 0, 0, NULL, 0, NULL}; for (uint32_t i = 0; i < idHeader.count; i++) { - int32_t ret = utilsImpl->GetIdItem(file, idHeader.idParams[i].offset, &idItem); + ret = utilsImpl->GetIdItem(file, idHeader.idParams[i].offset, &idItem); if (ret != MC_SUCCESS) { close(file); free(idHeader.idParams); @@ -224,11 +229,33 @@ int32_t GLOBAL_GetValueByName(const char *name, const char *path, char **value) FreeValue(value); return MC_FAILURE; } + result = MC_SUCCESS; break; } close(file); free(idHeader.idParams); FreeIdItem(&idItem); - return MC_SUCCESS; + return result; +} + +int32_t GLOBAL_GetValueByName(const char *name, const char *path, char **value) +{ + if (name == NULL || strlen(name) == 0 || path == NULL || strlen(path) == 0 || value == NULL) { + return MC_FAILURE; + } + + char tempLocale[MAX_LOCALE_LENGTH] = {'\0'}; + int32_t ret = strcpy_s(tempLocale, MAX_LOCALE_LENGTH, g_locale); + if (ret != EOK) { + return MC_FAILURE; + } + + char *locales[] = {tempLocale, ""}; + for (int i = 0; i < 2; i++) { // 2 current language and the default. + if (GLOBAL_GetValueByNameInternal(name, path, locales[i], value) == MC_SUCCESS) { + return MC_SUCCESS; + } + } + return MC_FAILURE; } diff --git a/code/sdk/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/src/global_utils.c b/code/sdk/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/src/global_utils.c index fa75416ca..8aed6dd00 100755 --- a/code/sdk/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/src/global_utils.c +++ b/code/sdk/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/src/global_utils.c @@ -487,6 +487,7 @@ static uint32_t GetIdHeaderOffsetByLocale(const char *locale, const Key *keys, u (void)Split(locale, "_", resConfig, &count); } else { resConfig[0] = (char *)locale; + count = 1; } return GetIdHeaderOffsetByCount(resConfig, keys, configNum, count); } diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-auto-ota-cli/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-auto-ota-cli/libams.a index 11942bd6d..81999822b 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-auto-ota-cli/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-auto-ota-cli/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-auto-ota-ser/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-auto-ota-ser/libams.a index addd26ede..9bc8af1b2 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-auto-ota-ser/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-auto-ota-ser/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autoota/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autoota/libams.a index fd474142e..911e68a7a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autoota/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autoota/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autootacli/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autootacli/libams.a index fd474142e..911e68a7a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autootacli/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autootacli/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-cm/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-cm/libams.a index fd474142e..911e68a7a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-cm/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-cm/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-ct/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-ct/libams.a index fd474142e..911e68a7a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-ct/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-ct/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-fd230/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-fd230/libams.a index fd474142e..911e68a7a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-fd230/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-fd230/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-leakcheck/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-leakcheck/libams.a index fd474142e..911e68a7a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-leakcheck/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-leakcheck/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-obu/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-obu/libams.a index fd474142e..911e68a7a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-obu/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-obu/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-user/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-user/libams.a new file mode 100644 index 000000000..911e68a7a Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-user/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-z1/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-z1/libams.a index fd474142e..911e68a7a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-z1/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-z1/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a index fd474142e..911e68a7a 100755 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a index ecee40958..ff8e68d46 100755 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-auto-ota-cli/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-auto-ota-cli/libace.a index ab19c8d20..d35625224 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-auto-ota-cli/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-auto-ota-cli/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-auto-ota-ser/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-auto-ota-ser/libace.a index 99c4b38ce..43b0a6b81 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-auto-ota-ser/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-auto-ota-ser/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autoota/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autoota/libace.a index c090187f1..5cd4368ca 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autoota/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autoota/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autootacli/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autootacli/libace.a index c090187f1..5cd4368ca 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autootacli/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autootacli/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-cm/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-cm/libace.a index c090187f1..5cd4368ca 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-cm/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-cm/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ct/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ct/libace.a index c090187f1..5cd4368ca 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ct/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ct/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace.a index c090187f1..5cd4368ca 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-leakcheck/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-leakcheck/libace.a index c090187f1..5cd4368ca 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-leakcheck/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-leakcheck/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-obu/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-obu/libace.a index c090187f1..5cd4368ca 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-obu/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-obu/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-user/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-user/libace.a new file mode 100644 index 000000000..5cd4368ca Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-user/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-z1/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-z1/libace.a index c090187f1..5cd4368ca 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-z1/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-z1/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a index c090187f1..5cd4368ca 100755 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a index 4d3eb24c3..abc35578d 100755 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.cpp index c5dded922..cb9d8a2de 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.cpp @@ -1315,7 +1315,7 @@ bool Component::RegisterCommonEventListener(UIView &view, void Component::ReleaseCommonEventListeners() { RootView *rootView = RootView::GetInstance(); - if (rootView != nullptr) { + if (rootView != nullptr && rootView->GetOnKeyActListener() == onKeyInputListener_) { rootView->ClearOnKeyActListener(); } ACE_DELETE(onKeyInputListener_); diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.cpp index 655f789ce..1033718bf 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.cpp @@ -100,6 +100,7 @@ PickerViewComponent::PickerViewComponent(jerry_value_t options, jerry_value_t ch selectedColor_(Color::White()), selectedFontSize_(PICKER_SELECTED_FONT_SIZE), selectedFontFamily_(nullptr), + pickerItemHeight_(PICKER_ITEM_HEIGHT), textSelected_(0), pTextArray_(nullptr), textArraySize_(0), @@ -189,7 +190,7 @@ bool PickerViewComponent::CreateTextPicker() uiPicker = nullptr; return false; } - uiPicker->SetItemHeight(PICKER_ITEM_HEIGHT); + uiPicker->SetItemHeight(pickerItemHeight_); pickerView_ = static_cast(uiPicker); return true; } @@ -211,7 +212,7 @@ bool PickerViewComponent::CreateTimePicker() uiTimePicker = nullptr; return false; } - uiTimePicker->SetItemHeight(PICKER_ITEM_HEIGHT); + uiTimePicker->SetItemHeight(pickerItemHeight_); pickerView_ = static_cast(uiTimePicker); return true; } @@ -231,7 +232,7 @@ bool PickerViewComponent::CreateImagePicker() uiImagePicker = nullptr; return false; } - uiImagePicker->SetItemHeight(PICKER_ITEM_HEIGHT); + uiImagePicker->SetItemHeight(pickerItemHeight_); uiImagePicker->SetItemWidth(PICKER_ITEM_WIDTH); pickerView_ = uiImagePicker; return true; @@ -253,7 +254,7 @@ bool PickerViewComponent::CreateDatePicker() uiDatePicker = nullptr; return false; } - uiDatePicker->SetItemHeight(PICKER_ITEM_HEIGHT); + uiDatePicker->SetItemHeight(pickerItemHeight_); pickerView_ = static_cast(uiDatePicker); return true; } @@ -410,12 +411,10 @@ void PickerViewComponent::UpdatePickerStyles() const switch (pickerType_) { case PickerType::TEXT: { UIPicker *textPicker = reinterpret_cast(pickerView_); - if (PICKER_ITEM_HEIGHT < selectedFontSize_) { - textPicker->SetItemHeight(selectedFontSize_); - } textPicker->SetBackgroundFont(fontFamily_, fontSize_); textPicker->SetHighlightFont(selectedFontFamily_, selectedFontSize_); textPicker->SetTextColor(color_, selectedColor_); + textPicker->SetItemHeight(pickerItemHeight_); break; } case PickerType::TIME: { @@ -423,6 +422,7 @@ void PickerViewComponent::UpdatePickerStyles() const timePicker->SetBackgroundFont(fontFamily_, fontSize_); timePicker->SetHighlightFont(selectedFontFamily_, selectedFontSize_); timePicker->SetTextColor(color_, selectedColor_); + timePicker->SetItemHeight(pickerItemHeight_); break; } #ifdef FEATURE_COMPONENT_DATE_PICKER @@ -553,6 +553,10 @@ bool PickerViewComponent::ApplyPrivateStyle(const AppStyleItem *styleItem) break; case K_FONT_SIZE: fontSize_ = GetStylePixelValue(styleItem); + // reset picker item height if fontSize is larger than PICKER_SELECTED_FONT_SIZE. + if (fontSize_ > PICKER_SELECTED_FONT_SIZE) { + pickerItemHeight_ = fontSize_ + PICKER_ITEM_HEIGHT_GAP; + } break; case K_FONT_FAMILY: CopyFontFamily(fontFamily_, GetStyleStrValue(styleItem)); @@ -565,6 +569,10 @@ bool PickerViewComponent::ApplyPrivateStyle(const AppStyleItem *styleItem) break; case K_SELECTED_FONT_SIZE: selectedFontSize_ = GetStylePixelValue(styleItem); + // reset picker item height if selectedFontSize is larger than PICKER_SELECTED_FONT_SIZE. + if (selectedFontSize_ > PICKER_SELECTED_FONT_SIZE) { + pickerItemHeight_ = selectedFontSize_ + PICKER_ITEM_HEIGHT_GAP; + } break; case K_SELECTED_FONT_FAMILY: CopyFontFamily(selectedFontFamily_, GetStyleStrValue(styleItem)); diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.h index 649d06074..cdbf943cd 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.h @@ -45,6 +45,8 @@ static constexpr char DATE_PICKER_DAY[] = "day"; #endif // FEATURE_COMPONENT_DATE_PICKER static constexpr int16_t PICKER_ITEM_HEIGHT = 50; // default picker item height static constexpr uint8_t PICKER_SELECTED_FONT_SIZE = 38; // F_HYQIHEI_65S_38_4 +// the gap size add with font size to calculate picker item height. +static constexpr int16_t PICKER_ITEM_HEIGHT_GAP = 25; /** * @brief listener class for text picker onchange event. @@ -229,6 +231,7 @@ private: ColorType selectedColor_; uint8_t selectedFontSize_; char* selectedFontFamily_; + uint16_t pickerItemHeight_; // text picker-view attributes uint16_t textSelected_; diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base/log.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base/log.h index 64c73abe6..f3f0c36e3 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base/log.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base/log.h @@ -68,8 +68,8 @@ typedef enum { HILOG_MODULE_MAX } HiLogModuleType; -#ifndef HSO_SUPPORT -#if HILOG_DEBUG_ENABLE +// #ifndef HSO_SUPPORT +// #if HILOG_DEBUG_ENABLE #define HILOG_DEBUG(mod, format, ...) \ do \ { \ @@ -109,12 +109,12 @@ typedef enum { printf("R " format "\n", ##__VA_ARGS__); \ } while (0) -#else -#define HILOG_DEBUG(mod, format, ...) uapi_diag_debug_log(0, format, ##__VA_ARGS__) -#define HILOG_ERROR(mod, format, ...) uapi_diag_error_log(0, format, ##__VA_ARGS__) -#define HILOG_FATAL(mod, format, ...) uapi_diag_error_log(0, format, ##__VA_ARGS__) -#define HILOG_INFO(mod, format, ...) uapi_diag_info_log(0, format, ##__VA_ARGS__) -#define HILOG_WARN(mod, format, ...) uapi_diag_warning_log(0, format, ##__VA_ARGS__) -#define HILOG_RACE(mod, format, ...) -#endif -#endif // OHOS_AAFWK_BASE_LOG_H +// #else +// #define HILOG_DEBUG(mod, format, ...) uapi_diag_debug_log(0, format, ##__VA_ARGS__) +// #define HILOG_ERROR(mod, format, ...) uapi_diag_error_log(0, format, ##__VA_ARGS__) +// #define HILOG_FATAL(mod, format, ...) uapi_diag_error_log(0, format, ##__VA_ARGS__) +// #define HILOG_INFO(mod, format, ...) uapi_diag_info_log(0, format, ##__VA_ARGS__) +// #define HILOG_WARN(mod, format, ...) uapi_diag_warning_log(0, format, ##__VA_ARGS__) +// #define HILOG_RACE(mod, format, ...) +// #endif +// #endif // OHOS_AAFWK_BASE_LOG_H diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base/mem_util.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base/mem_util.h index 67c99afd4..cb1ae2e96 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base/mem_util.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base/mem_util.h @@ -31,6 +31,7 @@ extern "C" { void *PSRAM_Malloc(uint32_t size); void *PSRAM_Calloc(uint32_t nitems, uint32_t size); void PSRAM_Free(void *buffer); +void AceMemInfoPrint(void); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.cpp index 2cd2d4ade..d1da3942c 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.cpp @@ -26,18 +26,10 @@ namespace OHOS { namespace ACELite { NetCallBack NetWorkModule::callback_; -void NetWorkModule::TriggerCallbackListener(char *netConnectStatus, uint32_t Len) +void NetWorkModule::TriggerCallbackListener(uint8_t netConnectStatus, uint8_t type) { - if (netConnectStatus != nullptr) { - callback_.netParam.Len = Len; - char *newData = (char *)realloc(callback_.netParam.status, Len + 1); - memset_s(newData, Len + 1, 0, Len + 1); - if (newData != nullptr) { - callback_.netParam.status = newData; - memcpy_s(callback_.netParam.status, Len, netConnectStatus, Len); - } - } - callback_.netParam.Len = Len; + callback_.netParam.status = netConnectStatus; + callback_.netParam.net_type = type; if (!JsAsyncWork::DispatchAsyncWork(AsyncExecuteCallback, const_cast(&callback_.netParam))) { MEDIA_ERR_LOG("dispatch async work failed."); } @@ -48,11 +40,50 @@ static bool ValidJsValue(JSIValue value) return (value != nullptr) && (!JSI::ValueIsUndefined(value)); } +const char* GetNetworkStatusString(uint8_t type, uint8_t status) { + // 网络类型 + const char *networkType; + switch (type) { + case NETWORK_TYPE_WIFI: + networkType = "WIFI"; + break; + case NETWORK_TYPE_BLUETOOTH: + networkType = "Bluetooth"; + break; + default: + networkType = "Unknown Network Type"; + break; + } + + // 连接状态 + const char *connectionStatus; + switch (status) { + case CONNECTION_STATUS_CONNECTING: + connectionStatus = "Connecting"; + break; + case CONNECTION_STATUS_CONNECTED: + connectionStatus = "Connected"; + break; + case CONNECTION_STATUS_DISCONNECTED: + connectionStatus = "Disconnected"; + break; + default: + connectionStatus = "Unknown Status"; + break; + } + + // 静态字符串缓冲区,用于返回结果 + static char result[MAX_STATUS_LENGTH]; + snprintf(result, sizeof(result), "%s: %s", networkType, connectionStatus); + + return result; +} + void NetWorkModule::AsyncExecuteCallback(void *arg) { NetParam *netParam = static_cast(arg); if (ValidJsValue(callback_.net_connect_callback) && netParam != nullptr) { - JSIValue result = JSI::CreateString(static_cast(netParam->status)); + JSIValue result = JSI::CreateString(const_cast(GetNetworkStatusString(netParam->net_type, netParam->status))); JSIValue argv[ARGC_ONE] = {result}; JSI::CallFunction(callback_.net_connect_callback, callback_.net_connect_thisVal, argv, ARGC_ONE); JSI::ReleaseValue(result); @@ -66,11 +97,8 @@ JSIValue NetWorkModule::RegisterConnectListener(const JSIValue thisVal, const JS return JSI::CreateUndefined(); } - if (callback_.net_connect_callback != nullptr) { - HILOG_WARN(HILOG_MODULE_ACE, "net connection callback already registered"); - return JSI::CreateUndefined(); - } - + JSI::ReleaseValue(callback_.net_connect_thisVal); + JSI::ReleaseValue(callback_.net_connect_callback); callback_.net_connect_thisVal = JSI::AcquireValue(thisVal); callback_.net_connect_callback = JSI::AcquireValue(args[0]); if (callback_.net_connect_callback == nullptr) { @@ -79,7 +107,7 @@ JSIValue NetWorkModule::RegisterConnectListener(const JSIValue thisVal, const JS } // 可以在注册回调后执行其他必要的操作 - net_connect_status_change("test", strlen("test")); + net_connect_status_change(CONNECTION_STATUS_DISCONNECTED, NETWORK_TYPE_BLUETOOTH); return JSI::CreateUndefined(); } @@ -101,7 +129,7 @@ JSIValue NetWorkModule::UnregisterConnectListener(const JSIValue thisVal, const JSIValue NetWorkModule::GetConnectState(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) { - return JSI::CreateString(callback_.netParam.status); + return JSI::CreateString(const_cast(GetNetworkStatusString(callback_.netParam.net_type, callback_.netParam.status))); } } @@ -111,9 +139,9 @@ JSIValue NetWorkModule::GetConnectState(const JSIValue thisVal, const JSIValue * extern "C" { #endif -void net_connect_status_change(char *netConnectStatus, uint32_t Len) +void net_connect_status_change(uint8_t netConnectStatus,uint8_t type) { - OHOS::ACELite::NetWorkModule::TriggerCallbackListener(netConnectStatus, Len); + OHOS::ACELite::NetWorkModule::TriggerCallbackListener(netConnectStatus, type); } #ifdef __cplusplus diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.h index 2ddad8815..e7d8f0455 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.h @@ -19,17 +19,32 @@ #ifdef __cplusplus extern "C" { #endif -void net_connect_status_change(char *netConnectStatus, uint32_t Len); +void net_connect_status_change(uint8_t netConnectStatus,uint8_t type); #ifdef __cplusplus }; #endif namespace OHOS { namespace ACELite { +#define MAX_STATUS_LENGTH 128 +// ÍøÂçÀàÐÍö¾Ù +typedef enum { + NETWORK_TYPE_WIFI = 0, + NETWORK_TYPE_BLUETOOTH, + NETWORK_TYPE_UNKNOWN +} NetworkType; + +// Á¬½Ó״̬ö¾Ù +typedef enum { + CONNECTION_STATUS_CONNECTING = 0, + CONNECTION_STATUS_CONNECTED, + CONNECTION_STATUS_DISCONNECTED, + CONNECTION_STATUS_UNKNOWN +} ConnectionStatus; struct NetParam { - char *status = nullptr; - uint32_t Len = 0; + uint8_t status; + uint8_t net_type = -1; }; struct NetCallBack { @@ -48,7 +63,7 @@ public: static JSIValue UnregisterConnectListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); static JSIValue GetConnectState(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); static void AsyncExecuteCallback(void *arg); - static void TriggerCallbackListener(char *netConnectStatus, uint32_t Len); + static void TriggerCallbackListener(uint8_t netConnectStatus, uint8_t type); }; void InitNetWorkModule(JSIValue exports) diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/cjson_parser.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/cjson_parser.cpp index f71b8fbc2..1fb1af016 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/cjson_parser.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/cjson_parser.cpp @@ -391,7 +391,7 @@ bool CJSONParser::CacheFile() return false; } cJSON *json = cJSON_Parse(content); - ace_free(content); + free(content); content = nullptr; if (json == nullptr) { return false; @@ -519,7 +519,7 @@ jerry_value_t CJSONParser::GetValueFromFile(const char *key, uint8_t keyCount = Split(key, '.', *&keys); char *content = ReadJSFile(filePath_, languageFile); cJSON *fileJson = cJSON_Parse(content); - ACE_FREE(content); + free(content); cJSON *curJsonItem = fileJson; uint8_t curKeyIndex = 0; do { diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.cpp index 5e4dbe069..63d49f20e 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.cpp @@ -121,7 +121,7 @@ jerry_value_t ImageModule::OnLoadSetter(const jerry_value_t func, } if (argsNum == 1 && jerry_value_is_function(args[0])) { jerry_release_value(imageModel->onLoadFunc_); - imageModel->onLoadFunc_ = args[0]; + imageModel->onLoadFunc_ = jerry_acquire_value(args[0]); } else { return jerry_create_error(JERRY_ERROR_EVAL, reinterpret_cast("set imageModel onload arg fail")); @@ -160,7 +160,7 @@ jerry_value_t ImageModule::OnErrorSetter(const jerry_value_t func, } if (argsNum >= 1 && jerry_value_is_function(args[0])) { jerry_release_value(imageModel->onErrorFunc_); - imageModel->onErrorFunc_ = args[0]; + imageModel->onErrorFunc_ = jerry_acquire_value(args[0]); } else { return jerry_create_error(JERRY_ERROR_EVAL, reinterpret_cast("set imageModel onload arg fail")); diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.h index 867ebc253..3c663e95c 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.h @@ -50,20 +50,16 @@ public: const char *attributeName, jerry_external_handler_t setterHandler, jerry_external_handler_t getterHandler); -#if (defined(ENABLED_DELETE_MODULE_IAMGE) && (ENABLED_DELETE_MODULE_IAMGE == 1)) static void DeleteImage(void* ptr) { ImageModule* image = reinterpret_cast(ptr); ACE_DELETE(image); } -#endif static void OnCallBack(const jerry_value_t context, const ImageModule *imageModule, bool isSucess, const char* msg); // the handle to release the native value when the js value number format object is not needed. static constexpr jerry_object_native_info_t gcCallback = { -#if ENABLED_DELETE_MODULE_IAMGE .free_cb = DeleteImage -#endif }; static const char * const attrOnload; static const char * const attrOnError; diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/vibrator_module.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/vibrator_module.cpp index 421f4c710..ff05e1c1a 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/vibrator_module.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/vibrator_module.cpp @@ -60,6 +60,7 @@ void VibratorModule::ExecuteVibrate(void* data) JSIValue args = params->args; JSIValue thisVal = params->thisVal; JSIValue result = JSI::CreateObject(); + JSI::SetStringProperty(result, "result", "success"); char* mode = JSI::GetStringProperty(args, VIBTATOR_MODE); if (strcmp(mode, "long") == 0|| strcmp(mode, "short") == 0) { SuccessCallBack(thisVal, args, result); diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-auto-ota-cli/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-auto-ota-cli/libbms.a index 5fd9ba683..5aa11e829 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-auto-ota-cli/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-auto-ota-cli/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-auto-ota-ser/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-auto-ota-ser/libbms.a index 0bdbf225a..985e5b5cb 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-auto-ota-ser/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-auto-ota-ser/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autoota/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autoota/libbms.a index 5cf8f150c..2c35a7e5d 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autoota/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autoota/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autootacli/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autootacli/libbms.a index 5cf8f150c..2c35a7e5d 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autootacli/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autootacli/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-cm/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-cm/libbms.a index 5cf8f150c..2c35a7e5d 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-cm/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-cm/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-ct/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-ct/libbms.a index 5cf8f150c..2c35a7e5d 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-ct/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-ct/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-fd230/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-fd230/libbms.a index 5cf8f150c..2c35a7e5d 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-fd230/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-fd230/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-leakcheck/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-leakcheck/libbms.a index 5cf8f150c..2c35a7e5d 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-leakcheck/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-leakcheck/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-obu/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-obu/libbms.a index 5cf8f150c..2c35a7e5d 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-obu/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-obu/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-user/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-user/libbms.a new file mode 100644 index 000000000..2c35a7e5d Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-user/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-z1/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-z1/libbms.a index 5cf8f150c..2c35a7e5d 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-z1/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-z1/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a index 5cf8f150c..2c35a7e5d 100755 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a index 209617000..6397f5607 100755 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/multimedia/player/interfaces/kits/player_lite/js/builtin/include/audio_module.h b/code/sdk/open_source/openharmony/foundation/multimedia/player/interfaces/kits/player_lite/js/builtin/include/audio_module.h index 23c96bbde..2b83b5058 100755 --- a/code/sdk/open_source/openharmony/foundation/multimedia/player/interfaces/kits/player_lite/js/builtin/include/audio_module.h +++ b/code/sdk/open_source/openharmony/foundation/multimedia/player/interfaces/kits/player_lite/js/builtin/include/audio_module.h @@ -376,6 +376,24 @@ public: */ static JSIValue OnTimeUpdateSetter(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + /** + * the getter of stream type + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSIValue StreamTypeGetter(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + /** + * the setter of stream type + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSIValue StreamTypeSetter(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + private: static JSIValue GetEventCallback(const AudioEventListener *listener); diff --git a/code/sdk/open_source/openharmony/foundation/multimedia/player/interfaces/kits/player_lite/js/builtin/include/audio_player.h b/code/sdk/open_source/openharmony/foundation/multimedia/player/interfaces/kits/player_lite/js/builtin/include/audio_player.h index 30105485e..1f061c442 100755 --- a/code/sdk/open_source/openharmony/foundation/multimedia/player/interfaces/kits/player_lite/js/builtin/include/audio_player.h +++ b/code/sdk/open_source/openharmony/foundation/multimedia/player/interfaces/kits/player_lite/js/builtin/include/audio_player.h @@ -18,6 +18,7 @@ #include "jsi.h" #include "player.h" +#include "audio_base_type.h" #include "media_thread_adapt.h" namespace OHOS { @@ -117,6 +118,8 @@ public: bool SetVolume(double volume); + bool SetStreamType(AudioStreamType streamType); + bool SetMuted(bool muted); int32_t SetAudioSessionId(uint32_t sessionId); @@ -179,6 +182,7 @@ private: bool isRunning_; bool isSysSrc_; MediaThreadIdHandle updateTimeProcess_; + AudioStreamType streamType_ = AUDIO_STREAM_MUSIC; }; } // namespace ACELite } // namespace OHOS diff --git a/code/sdk/open_source/openharmony/foundation/multimedia/utils/include/media_thread_adapt.h b/code/sdk/open_source/openharmony/foundation/multimedia/utils/include/media_thread_adapt.h index 0bebc5456..6f8c93f04 100755 --- a/code/sdk/open_source/openharmony/foundation/multimedia/utils/include/media_thread_adapt.h +++ b/code/sdk/open_source/openharmony/foundation/multimedia/utils/include/media_thread_adapt.h @@ -79,6 +79,8 @@ void MediaThreadCondTimeWait(MediaThreadCondHandle condHandle, MediaMutexHandle */ void MediaThreadCondDestroy(MediaThreadCondHandle *condHandle); +void MediaThreadSetDetach(MediaThreadIdHandle thdId, bool detach); + #ifdef __cplusplus }; #endif diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-auto-ota-cli/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-auto-ota-cli/libjerryscript.a index ee2bb8a6d..4a119b244 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-auto-ota-cli/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-auto-ota-cli/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-auto-ota-ser/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-auto-ota-ser/libjerryscript.a index 9268431f7..f236f6e06 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-auto-ota-ser/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-auto-ota-ser/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autoota/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autoota/libjerryscript.a index 75cadbf49..4c6839d58 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autoota/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autoota/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autootacli/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autootacli/libjerryscript.a index 75cadbf49..4c6839d58 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autootacli/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autootacli/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-cm/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-cm/libjerryscript.a index 75cadbf49..4c6839d58 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-cm/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-cm/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-ct/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-ct/libjerryscript.a index 75cadbf49..4c6839d58 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-ct/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-ct/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230/libjerryscript.a index 75cadbf49..4c6839d58 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-leakcheck/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-leakcheck/libjerryscript.a index 75cadbf49..4c6839d58 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-leakcheck/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-leakcheck/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-obu/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-obu/libjerryscript.a index 75cadbf49..4c6839d58 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-obu/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-obu/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-user/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-user/libjerryscript.a new file mode 100644 index 000000000..4c6839d58 Binary files /dev/null and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-user/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-z1/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-z1/libjerryscript.a index 75cadbf49..4c6839d58 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-z1/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-z1/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a index 75cadbf49..4c6839d58 100755 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a index 5bcadaa49..ac4a96e33 100755 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a differ diff --git a/code/sdk/protocol/bt/host/bt/bts/bg_common/include/ahi_common/mpc_code_def.h b/code/sdk/protocol/bt/host/bt/bts/bg_common/include/ahi_common/mpc_code_def.h index 3278af05f..e20f7e089 100644 --- a/code/sdk/protocol/bt/host/bt/bts/bg_common/include/ahi_common/mpc_code_def.h +++ b/code/sdk/protocol/bt/host/bt/bts/bg_common/include/ahi_common/mpc_code_def.h @@ -314,7 +314,8 @@ typedef enum { GAP_IF_SET_INQUIRY_SCAN_PARAM, GAP_IF_RESTORE_REMOTE_DEVICE, GAP_IF_GET_LINK_MODE, - GAP_IF_SET_BR_SECURE_PARAM + GAP_IF_SET_BR_SECURE_PARAM, + GAP_IF_SET_BTH_FLOW_LIMIT, } mpc_bt_stack_gap_opcode; /* service_id: MC_BT_SRV_A2DP */ diff --git a/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_a2dp_snk_service.c b/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_a2dp_snk_service.c index ee11723ac..200e7e180 100644 --- a/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_a2dp_snk_service.c +++ b/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_a2dp_snk_service.c @@ -20,6 +20,7 @@ osal_timer g_a2dp_stream_accept_timer = {0}; #define A2DP_STREAM_ACCEPT_TIMER_PERIOD 500 +static bool g_a2dp_snk_active_disconnect = false; static void sample_a2dp_snk_accept_timer_stop(void) { @@ -98,6 +99,11 @@ static void sample_a2dp_snk_connect_state_changed_callback(const bd_addr_t *bd_a { bts_sample_log_with_func("addr: ****%02x%02x%02x%02x conn_state: %x\n", bd_addr->addr[3], bd_addr->addr[2], bd_addr->addr[1], bd_addr->addr[0], conn_state); /* 3 2 1 0 idx */ + /* 主动断开service,断开事件上报后才能去注册server否则状态无法上报 */ + if (g_a2dp_snk_active_disconnect == true && conn_state == PROFILE_STATE_DISCONNECTED) { + a2dp_snk_service_unregister(); + g_a2dp_snk_active_disconnect = false; + } } static void sample_a2dp_snk_start_stream_request_callback(const bd_addr_t *bd_addr) @@ -199,6 +205,8 @@ int wstp_a2dp_snk_get_playing_state(const bd_addr_t *bd_addr) /* 与设备建立A2DP连接 */ int wstp_a2dp_snk_connect(const bd_addr_t *bd_addr) { + /* 连接service前要注册server否则状态无法上报 */ + a2dp_snk_service_register(); int ret = a2dp_snk_connect(bd_addr); bts_sample_log("a2dp_snk_connect ret(int): %x\n", ret); return ret; @@ -207,6 +215,11 @@ int wstp_a2dp_snk_connect(const bd_addr_t *bd_addr) /* 与设备断开A2DP连接 */ int wstp_a2dp_snk_disconnect(const bd_addr_t *bd_addr) { + if (a2dp_snk_get_device_connect_state(bd_addr) != PROFILE_STATE_CONNECTED) { + bts_sample_log("a2dp_snk_disconnect not connected\n"); + return EXT_ERR_FAILURE; + } + g_a2dp_snk_active_disconnect = true; int ret = a2dp_snk_disconnect(bd_addr); bts_sample_log("a2dp_snk_disconnect ret(int): %x\n", ret); return ret; diff --git a/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_hfp_hf_service.c b/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_hfp_hf_service.c index 4bb78f63a..9a4a5517f 100755 --- a/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_hfp_hf_service.c +++ b/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_hfp_hf_service.c @@ -520,6 +520,7 @@ static void sample_handle_sco_state_changed(const bd_addr_t *bd_addr, hfp_sco_co break; case HFP_SCO_STATE_DISCONNECTED: + case HFP_SCO_STATE_CONNECT_FAILURE: task_body = sample_audio_deinit_task_body; break; diff --git a/code/sdk/protocol/bt/host/bt/bts/bt_sample/bt_core/sample_bts_gap.c b/code/sdk/protocol/bt/host/bt/bts/bt_sample/bt_core/sample_bts_gap.c index 3689a56cc..70cbdc606 100755 --- a/code/sdk/protocol/bt/host/bt/bts/bt_sample/bt_core/sample_bts_gap.c +++ b/code/sdk/protocol/bt/host/bt/bts/bt_sample/bt_core/sample_bts_gap.c @@ -65,6 +65,7 @@ typedef enum { BTSRV_SAMPLE_GAP_SET_INQUIRY_PARAM, /* 35 设置搜到参数 */ BTSRV_SAMPLE_GAP_SET_SERVICE_TASK_PRIORITY, /* 36 设置BT_SERVICE_TASK优先级 */ + BTSRV_SAMPLE_GAP_SET_FLOW_LIMIT, /* 37 设置流控限制字节数 */ } btsrv_gap_sample_cmd_id; typedef enum { @@ -1217,6 +1218,17 @@ static void btsrv_sample_cmd_set_service_task_priority(const char **params, int3 bts_sample_log("bts set service task priority ret:0x%x priority:%d\n", ret, task_priority); } +static void btsrv_sample_cmd_set_flow_limit(const char **params, int32_t params_cnt) +{ + if (params_cnt != 1) { /* 1:参数个数 */ + bts_sample_log("params_cnt error! need one param!\n"); + return; + } + uint16_t flow_limit = (uint16_t)atoi(params[0]); + errcode_t ret = gap_bt_set_flow_limit(flow_limit); + bts_sample_log("bts set flow limit ret:0x%x limit:%d\n", ret, flow_limit); +} + btsrv_sample_cmd_hdl_info g_btsrv_gap_sample_hdls[] = { /* 0 */ { BTSRV_SAMPLE_GAP_ENABLE_BLE, btsrv_sample_cmd_enable_ble }, @@ -1270,7 +1282,8 @@ btsrv_sample_cmd_hdl_info g_btsrv_gap_sample_hdls[] = { /* 35 */ { BTSRV_SAMPLE_GAP_SET_INQUIRY_PARAM, btsrv_sample_cmd_set_filter_device_class }, - { BTSRV_SAMPLE_GAP_SET_SERVICE_TASK_PRIORITY, btsrv_sample_cmd_set_service_task_priority} + { BTSRV_SAMPLE_GAP_SET_SERVICE_TASK_PRIORITY, btsrv_sample_cmd_set_service_task_priority}, + { BTSRV_SAMPLE_GAP_SET_FLOW_LIMIT, btsrv_sample_cmd_set_flow_limit}, }; void btsrv_gap_sample_cmd(uint32_t cmd_id, const char **params, int32_t params_cnt) diff --git a/code/sdk/protocol/bt/host/bt/bts/sdk/inc/stack_api/stack_def.h b/code/sdk/protocol/bt/host/bt/bts/sdk/inc/stack_api/stack_def.h index 4430d754f..38529a45c 100755 --- a/code/sdk/protocol/bt/host/bt/bts/sdk/inc/stack_api/stack_def.h +++ b/code/sdk/protocol/bt/host/bt/bts/sdk/inc/stack_api/stack_def.h @@ -586,6 +586,7 @@ enum btsdk_hfp_app_event_code_enum { Other values to respond later with btsdk_agap_set_cur_indicator_val */ BTSDK_HFP_EV_CODEC_CHANGED_IND, /* Codec changed by the latest Codec Negotiation procedure. Parameter: uint8_t - Codec ID, e.g. BTSDK_SCO_CODEC_CVSD */ + BTSDK_HFP_EV_AUDIO_CONNECT_FAILURE_IND, /* 69 Fails to create the audio connection. UINT8* to return the reason */ BTSDK_HFP_EV_INBANDRING_IND = 74, /* 74 +BSIR=, +BRSF(inband ring feature) AG notify the HF inband ring supported or not, uint8_t * - inbandring supported (0,1) */ diff --git a/code/sdk/tools/pkg/bin/brandy/bt.bin b/code/sdk/tools/pkg/bin/brandy/bt.bin index 41c634dfb..6f450c10e 100755 --- a/code/sdk/tools/pkg/bin/brandy/bt.bin +++ b/code/sdk/tools/pkg/bin/brandy/bt.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1c2c6e827eb257e312c39c379615dc65f4d340df62244627fe0f2502f55ed513 -size 425632 +oid sha256:8e8536a8ef09062636e9523134560b0975a8b82600fdaaf7692c15ebfee2379a +size 424976 diff --git a/patch_602_0911_to_1009.txt b/patch_602_0911_to_1009.txt new file mode 100644 index 000000000..f64e28162 --- /dev/null +++ b/patch_602_0911_to_1009.txt @@ -0,0 +1,58 @@ +【补丁名称】patch_602_0911_to_1009 +【基础版本】b602 + 0521 + 0626 + 7020 + 0812 + 0911 +【修复问题】 +BT合入内容 + 1、新提供流控配置接口。 + 2、新提供动态注册a2dp snk服务的新功能。 + 3、新增sco链路创建失败的异常处理事件。 + 4、优化对外头文件中BLE连接参数结构体注释。 + 5、HCI上行流控堆包计数加上HCI qos积包,解决src和snk同时积包触发内存不足的问题。 +PLT合入内容 + 1、解决pll问题 + 2、解决systick问题 +MEDIA合入内容 + 1、解决视频线程的退出时序,针对主动退出的时候,才进行join,解决视频停播以及冻屏的问题 + 2、修改本地铃声和蓝牙通话,以及蓝牙通话+ 本地铃声是混音策略 + 3、修改本地铃声+蓝牙通话的时候不压本地铃声的低音量,以防止听不到铃声 + 4、当需要恢复播放的时候,需要判断当前可被恢复的焦点是否已经创建了流,如果已经创建则不能删除焦点,防止恢复的时候找不到焦点而报错 + 5、js播放器对外接口,新增设置流类型参数的接口,可以更改流类型,以满足不同场景的播放需求 +GUI合入内容 + 1、移除UILabel SetTextTransform接口,文字和表情包随控件变换而变换 + 2、修改Text支持的最大行数为70 + 3、解决UILabel在LINE_BREAK_OSCILLATION模式下滚动过快的问题 + 4、解决UITransformGroup显示异常的问题 + 5、优化SlipFlow相关功能 +OHOS合入内容 + 1、百度导航增加 msgData释放、主动解注册接口、onDestroy被动清理。 + 2、百度page切换使用公共内存。 + 3、串口日志默认开启。 + 4、network jsi接口整改。 + 5、JS Demo国际化整改,支持应用名切换和内部文字国际化。 + 6、DMSLiteSendP2PMsg方法返回值修改。 + 7、解决国际化文件缺失时不能安装应用 + 8、新增跑马灯文字旋转 + 9、JS支持获取旋钮,按键事件监听 + 10、新增一个AT命令,用于切换系统语言。 + 11、修复在JS应用内使用POWER键退出后POWER键失效的问题 +GPU合入内容: + 1、解决rm 异常分支打印无输出 + 2、解决vau_create_stroke_to_fill_path 死循环问题 +NATIVE-JS sample合入内容 + 1、解决sco兼容性问题 + +【修改影响】NA + +【使用方法】 + 1、合入0521补丁 + 2、合入0626补丁 + 3、合入0720补丁 + 4、合入0812补丁 + 5、合入0911补丁 + 6、合入0911补丁 + +【自测情况】 + 自验证范围: + 全功能冒烟 + 自验证target: + Native-js、target3 rc版本 +【是否合入版本】根据测试结果确定