From: SnickerSun Date: Thu, 19 Sep 2024 14:16:54 +0000 (+0800) Subject: Revert "Revert "Revert "更新sdk602 patch 0812 to 0911" X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9217935151d94f9b367b116fb35751d90cb0ad19;p=mirrors%2FFD230.git Revert "Revert "Revert "更新sdk602 patch 0812 to 0911" This reverts commit 4641ba87348533c061e6c975504dd7885ba25300. --- diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index cb8275d6c..849754813 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -148,6 +148,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/dropdown/DropDownCardPage1.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/dropdown/DropDownCardPage2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/ModelListenerSample.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PresenterTask.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/HealthModel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PullUpDownView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/ConnectedStatusView.cpp @@ -555,7 +556,6 @@ set(SOURCES ${UI_SAMPLE_ROOT}/components/ui_test_keyboard/ui_test_keyboard.cpp ${UI_SAMPLE_ROOT}/components/ui_test_hexagons_list/ui_test_hexagons_list.cpp ${UI_SAMPLE_ROOT}/components/ui_test_coverflow/ui_test_coverflow.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_slipflow/ui_test_slipflow.cpp ${UI_SAMPLE_ROOT}/components/ui_test_kaleidoscope/ui_test_kaleidoscope.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/dial/DialRotateImgView.cpp diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 15a3e0978..0d0d0699c 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -41,6 +41,7 @@ #include "BluetoothPresenter.h" #include "PlayersModel.h" #include "HealthModel.h" +#include "PresenterTask.h" #include "MainCompassPresenter.h" #include "MainCompassView.h" #include "CallerLogModel.h" @@ -478,7 +479,7 @@ namespace OHOS /*加载安全模式Slice*/ InitSafeModeSlice(); NativeAbility::GetInstance().SetDefaultSliceId(VIEW_SAFE_MODE); - // PresenterTask::GetInstance()->Init(); + PresenterTask::GetInstance()->Init(); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "safe_mode is enter!"); } else if (mode == LaunchMode::NORMAL_MODE) @@ -504,7 +505,7 @@ namespace OHOS InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化 InitAllNativeSlices(); CallerLogModel::GetInstance()->InitPhoneService(); - // PresenterTask::GetInstance()->Init(); + PresenterTask::GetInstance()->Init(); PlayersModel::GetInstance()->AudioInit(); ActivityModel::GetInstance()->Init(); ScreenModels::GetInstance()->InitKvStorage(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp index cc25e6087..00057bc20 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp @@ -226,7 +226,7 @@ static bd_addr_t *BtAvrcpSrvGetActiveAddr(void) void ConnectTgStateChangedCallback(const bd_addr_t *bdAddr, profile_connect_state_t state) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "avrcp tg update conn stat:%u", state); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "avrcp tg update conn stat:%u", state); if (bdAddr == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bdaddr nullptr"); return; @@ -325,19 +325,15 @@ static void BtAvrcpCtSupportEventCallback(const bd_addr_t *bd_addr, avrcp_ct_sup WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "null pointer\n"); return; } - + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "get event list:"); for (uint8_t i = 0; i < event->event_num; i++) { - if (event->event_id[i] == AVRCP_NOTIFY_EVENT_VOLUME_CHANGED) { - int ret = avrcp_ct_register_notification(bd_addr, event->event_id[i], 0); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "register event_id: 0x%x, ret = 0x%x", event->event_id[i], ret); - } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " 0x%x ", event->event_id[i]); } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "\n"); for (uint8_t i = 0; i < event->event_num; i++) { - if (event->event_id[i] != AVRCP_NOTIFY_EVENT_VOLUME_CHANGED) { - int ret = avrcp_ct_register_notification(bd_addr, event->event_id[i], 0); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "register event_id: 0x%x, ret = 0x%x", event->event_id[i], ret); - } + avrcp_ct_register_notification(bd_addr, event->event_id[i], 0); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "register event_id: 0x%x\n", event->event_id[i]); } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp index 79067de38..68612e5ed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -655,11 +655,6 @@ void BluetoothModel::SetAdvStartState(bool state) int BluetoothModel::ConnectRemoteDevice(const bd_addr_t *addr) { - /* 恢厂后耳机连接要开启BT广播否则会导致AVRCP无法音量控制 */ - bool ret = gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 60); - if (!ret) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConnectRemoteDevice gap_br_set_bt_scan_mode ret = 0x%x", ret); - } errcode_t retVal = gap_connect_remote_device(addr); (void)memcpy_s(&remoteConnectAddr, sizeof(bd_addr_t), addr, sizeof(bd_addr_t)); return retVal; @@ -790,7 +785,7 @@ void BtGapPairStatusChangedCallback(const bd_addr_t *bdAddr, int status) // } // uapi_a2dp_snk_connect(); // a2dp_snk_connect(bdAddr); - if(uapi_dev_runtime_get_bt_powerstat() && !get_ble_pair()&& (status == GAP_PAIR_PAIRED)) + if(cm_custom_ble_service_on_flag() && !get_ble_pair()&& (status == GAP_PAIR_PAIRED)) { send_pair_succ((bd_addr_t*)bdAddr); // if(cm_get_A2DP_switch() || cm_get_HFP_switch()) @@ -1080,15 +1075,13 @@ void GapAclStateChangedCallback(const bd_addr_t *bdAddr, gap_acl_state_t state, // ALC_connect_A2DP_flag=0; // } - static bd_addr_t gapAclConnectAddr{0}; /* 连接后保存手机地址,手表清除手机配对后查询不到class比较手机地址 */ - if ((gap_get_device_class(bdAddr) & 0x200) != 0 || memcmp(gapAclConnectAddr.addr, bdAddr->addr, BD_ADDR_LEN) == 0) { + if ((gap_get_device_class(bdAddr) & 0x200) != 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback: Mobile Phone Device"); if (state == GAP_ACL_STATE_DISCONNECTED) { /* 通知msg_center,ble状态仍用bt状态,此处不区分 */ SendMsgToMsgCenterService(BT_DISCONNECTED_TO_MSGCENTER, 0, nullptr, 0); SendMsgToUIService(BT_DISCONNECTED_TO_UI, 0, nullptr, 0); } else if (state == GAP_ACL_STATE_CONNECTED) { - (void)memcpy_s(gapAclConnectAddr.addr, BD_ADDR_LEN, bdAddr->addr, BD_ADDR_LEN); SendMsgToMsgCenterService(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0); SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0); } @@ -1141,8 +1134,7 @@ static void A2dpSrcConnectstateChanged(bd_addr_t *bdAddr, int connState) return; } if (connState == PROFILE_STATE_CONNECTED) { - uint32_t ret = avrcp_ct_connect(bdAddr); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "avrcp_ct_connect ret = 0x%x", ret); + avrcp_ct_connect(bdAddr); PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_CONNECTED); GraphicService::GetInstance()->PostGraphicEvent(std::bind(ACLConnectionSuss, *bdAddr)); SendMsgToUIService(EARPHONE_CONNECTED_TO_UI, 0, nullptr, 0); diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/ModelListenerSample.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/ModelListenerSample.h index 9e14a5179..b6d37a37d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/ModelListenerSample.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/ModelListenerSample.h @@ -19,13 +19,13 @@ #include "common/task.h" namespace OHOS { -class ModelListenerSample : public Task { +class ModelListenerSample : public HeapBase { public: ModelListenerSample(); virtual ~ModelListenerSample(); virtual void Notify(void) = 0; virtual void OnTickEvent(void) {}; - void Callback() override; + void Callback(); }; } #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/PresenterTask.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/PresenterTask.h new file mode 100644 index 000000000..e655268f6 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/PresenterTask.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: Presenter task + * Create: 2021-12-22 + */ + +#ifndef PRESENTER_TASK_H +#define PRESENTER_TASK_H +#include "common/task.h" + +namespace OHOS { +class ModelListenerSample; +class PresenterTask : public Task { +public: + void SetModelListener(ModelListenerSample* listener); + void Callback() override; + static PresenterTask* GetInstance(); + void Init() override; + ModelListenerSample* taskListener{nullptr}; +}; +} +#endif \ No newline at end of file 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 679276216..ba20d7952 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp @@ -21,6 +21,7 @@ #include #include #include "ModelDialDataFactory.h" +#include "PresenterTask.h" #include "DialModelTime.h" #include "DialModelPower.h" #include "heartrate/include/HeartModel.h" @@ -267,7 +268,7 @@ namespace OHOS { if (cardId == COMPASS) { - SetPeriod(DEFAULT_TASK_PERIOD); + PresenterTask::GetInstance()->SetPeriod(DEFAULT_TASK_PERIOD); } else if (cardId == WATCH_FACE) { @@ -281,15 +282,15 @@ namespace OHOS { time = DEFAULT_TASK_PERIOD; } - SetPeriod(time); + PresenterTask::GetInstance()->SetPeriod(time); } else if (cardId == MUSIC_PLAYER) { - SetPeriod(PLAYER_PERIOD); + PresenterTask::GetInstance()->SetPeriod(PLAYER_PERIOD); } else { - SetPeriod(MAX_PERIOD); + PresenterTask::GetInstance()->SetPeriod(MAX_PERIOD); } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp index d0d35752d..060ada9b3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp @@ -15,19 +15,21 @@ */ #include "ModelListenerSample.h" +#include "PresenterTask.h" #include "wearable_log.h" -namespace OHOS { -ModelListenerSample::ModelListenerSample() +namespace OHOS { - Init(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ModelListenerSample::ModelListenerSample"); -} -ModelListenerSample::~ModelListenerSample() -{ - Deinit(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ModelListenerSample::~ModelListenerSample"); -} + ModelListenerSample::ModelListenerSample() + { + PresenterTask::GetInstance()->SetModelListener(this); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ModelListenerSample::ModelListenerSample"); + } + ModelListenerSample::~ModelListenerSample() + { + PresenterTask::GetInstance()->SetModelListener(nullptr); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ModelListenerSample::~ModelListenerSample"); + } void ModelListenerSample::Callback() { diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp new file mode 100644 index 000000000..8707b3b26 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp @@ -0,0 +1,29 @@ + +#include "ModelListenerSample.h" +#include "PresenterTask.h" + +namespace OHOS { + +PresenterTask* PresenterTask::GetInstance() { + static PresenterTask PresenterTask; + return &PresenterTask; +} + +void PresenterTask::SetModelListener(ModelListenerSample* listener) +{ + taskListener = listener; +} + +void PresenterTask::Callback() +{ + if (taskListener != nullptr) { + taskListener->Callback(); + } +} + +void PresenterTask::Init() +{ + Task::Init(); +} + +} \ 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 eb8a0daf6..2b024baf7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -402,7 +402,10 @@ static void AudioDn(void) // 建立音频下行通路 AudioDnStart(); - + if (g_audioState == AUDIO_STREAM_START_DN) { + // 同步音量 + SyncVolume(); + } WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[AudioDn] audioState:%d", g_audioState); } @@ -710,8 +713,6 @@ static void ScoStateChanged(const bd_addr_t *bdAddr, hfp_sco_connect_state_t sta } break; case HFP_SCO_STATE_CONNECTED: - // 同步音量 - SyncVolume(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoStateChanged] SCO connected!"); break; diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp index de3a7f0cc..3d5c1cb4d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp @@ -769,15 +769,13 @@ void PlayerCallbackImpl::OnPlaybackComplete() { // 此处实现代码用于处理文件播放完成的事件 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnPlaybackCompleten"); - GraphicService::GetInstance()->PostGraphicEvent([] { - PlayersView *playersView = PlayersView::GetInstance(); - if (playersView != nullptr) { - if (playersView->GetPlaybackProgress() != nullptr) { - playersView->GetPlaybackProgress()->SetValue(100); // 100:进度100% - playersView->GetPlaybackProgress()->Invalidate(); - } + PlayersView *playersView = PlayersView::GetInstance(); + if (playersView != nullptr) { + if (playersView->GetPlaybackProgress() != nullptr) { + playersView->GetPlaybackProgress()->SetValue(100); // 100:进度100% + playersView->GetPlaybackProgress()->Invalidate(); } - }); + } usleep(20000); GraphicService::GetInstance()->PostGraphicEvent(std::bind(&PlayersModel::PlaySwitching, PlayersModel::GetInstance())); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp index d352da9c2..d4562b6d5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp @@ -79,13 +79,13 @@ public: tempView->SetViewId(view.GetViewId()); tempView->SetPosition(tempView->GetX(), tempView->GetY()); rootView->Add(tempView); + if (backBtn_ == nullptr) { + backBtn_ = new TransparentBackButton(); + backBtn_->SetPosition(0, 202, 50, 50); // 0: x position, 202: y position, 50: width and height + } + backBtn_->SetViewId(view.GetViewId()); + rootView->Add(backBtn_); } - if (backBtn_ == nullptr) { - backBtn_ = new TransparentBackButton(); - backBtn_->SetPosition(0, 202, 50, 50); // 0: x position, 202: y position, 50: width and height - } - backBtn_->SetViewId(view.GetViewId()); - rootView->Add(backBtn_); rootView->Invalidate(); return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/ui_test_group.cpp b/code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/ui_test_group.cpp index 326a0fb6b..3e4da3ccf 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/ui_test_group.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/ui_test_group.cpp @@ -31,7 +31,6 @@ #include "ui_test_hexagons_list/ui_test_hexagons_list.h" #include "ui_test_video_play/ui_test_video_play.h" #include "ui_test_coverflow/ui_test_coverflow.h" -#include "ui_test_slipflow/ui_test_slipflow.h" #include "ui_test_kaleidoscope/ui_test_kaleidoscope.h" namespace OHOS { @@ -58,7 +57,6 @@ void UITestGroup::SetUpTestCase() testCaseList_->PushBack(TestCaseInfo{"消息", new UITestMessage()}); testCaseList_->PushBack(TestCaseInfo{"呼吸效果", new UITestBreath()}); testCaseList_->PushBack(TestCaseInfo{"覆盖流", new UITestCoverflow()}); - testCaseList_->PushBack(TestCaseInfo{"滑动流", new UITestSlipflow()}); testCaseList_->PushBack(TestCaseInfo{"万花筒", new UITestKaleidoscope()}); #if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp index a1b44b500..374ce8eea 100755 --- a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp +++ b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp @@ -67,7 +67,7 @@ namespace OHOS { return; } - InputDeviceManager::GetInstance()->ClearInputDeviceState(); + InputDeviceManager::GetInstance()->ClearPressableViews(); Slice *nextSlice = node->value_.proxy->CreateSlice(); if (nextSlice == nullptr) { @@ -150,38 +150,18 @@ namespace OHOS return; } */ - - if (type == TransitionType::TRANSITION_INVALID) { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&Ability::PostChangeSlice, this, targetSliceId, - type, priority)); - } else { - if (osal_atomic_read(&transitionCount_) <= 0) { - osal_atomic_inc(&transitionCount_); - // onStop释放当前页面需要和当前页面的事件监听异步执行,否则会出现自己杀掉自己的情况 - // 使用图形服务的PostGraphicEvent方法异步执行PostChangeSlice,以避免在页面事件监听时出现当前页面自我销毁的情况。 - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&Ability::PostChangeSlice, this, targetSliceId, - type, priority)); - } else { - GRAPHIC_LOGE("ChangeSlice failed! targetSliceId = %u, transitionCount_ = %d", - targetSliceId, osal_atomic_read(&transitionCount_)); - } - } + if (osal_atomic_read(&transitionCount_) <= 0) + { + osal_atomic_inc(&transitionCount_); + // onStop释放当前页面需要和当前页面的事件监听异步执行,否则会出现自己杀掉自己的情况 + // 使用图形服务的PostGraphicEvent方法异步执行PostChangeSlice,以避免在页面事件监听时出现当前页面自我销毁的情况。 + GraphicService::GetInstance()->PostGraphicEvent(std::bind(&Ability::PostChangeSlice, this, targetSliceId, + type, priority)); + } } void Ability::PostChangeSlice(const uint16_t targetSliceId, TransitionType type, const uint16_t priority) { - -#ifdef JS_ENABLE - ElementName *elementName = OHOS::AbilityMsClient::GetInstance().GetTopAbility(); - if (elementName != nullptr && strcmp(elementName->bundleName, "com.huawei.launcher") != 0) { - OHOS::AbilityMsClient::GetInstance().ForceStop(elementName->bundleName); - targetSliceIdFromJS_ = targetSliceId; - if (type != TransitionType::TRANSITION_INVALID) { - osal_atomic_dec(&transitionCount_); - } - return; - } -#endif /* 1.首先检查当前Slice是否存在,并验证transitionId的有效性。 如果当前存在一个有效的Slice,并且transitionId合法,则调用sliceTransition_的SaveCurrentSnapshot方法保存当前Slice的快照, @@ -208,7 +188,6 @@ namespace OHOS if (!sliceTransition_.SaveCurrentSnapshot(curSlice_.slice->GetSliceContainer())) { useTransition = false; - osal_atomic_dec(&transitionCount_); } StopSlice(); } @@ -222,7 +201,16 @@ namespace OHOS printf("*******************next slice id is %d*****************\r\n", targetSliceId); #endif // slice页面跳转,先onstop,再onstart.在一个线程同步执行绘制,不会出现闪屏现象 - +#ifdef JS_ENABLE + ElementName *elementName = OHOS::AbilityMsClient::GetInstance().GetTopAbility(); + if (elementName != nullptr && strcmp(elementName->bundleName, "com.huawei.launcher") != 0) + { + OHOS::AbilityMsClient::GetInstance().ForceStop(elementName->bundleName); + targetSliceIdFromJS_ = targetSliceId; + osal_atomic_dec(&transitionCount_); + return; + } +#endif /* 调用StartSlice函数以启动新的指定的Slice。 StartSlice函数内部会先检查是否存在目标Slice的Proxy,并通过Proxy创建新的实例, @@ -240,7 +228,11 @@ namespace OHOS { sliceTransition_.Transition(prevSlice_.slice->GetSliceContainer(), curSlice_.slice->GetSliceContainer()); } - } + } + else + { + osal_atomic_dec(&transitionCount_); + } } void Ability::OnTransitionEnd() diff --git a/code/sdk/application/wearable/nativeapp/CMakeLists.txt b/code/sdk/application/wearable/nativeapp/CMakeLists.txt index 3dfc09e48..85ce56bac 100755 --- a/code/sdk/application/wearable/nativeapp/CMakeLists.txt +++ b/code/sdk/application/wearable/nativeapp/CMakeLists.txt @@ -99,6 +99,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainModel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainPresenterSample.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/ModelListenerSample.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PresenterTask.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/HealthModel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PullUpDownView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/AppItemView.cpp @@ -273,7 +274,6 @@ set(SOURCES ${UI_SAMPLE_ROOT}/components/ui_test_keyboard/ui_test_keyboard.cpp ${UI_SAMPLE_ROOT}/components/ui_test_hexagons_list/ui_test_hexagons_list.cpp ${UI_SAMPLE_ROOT}/components/ui_test_coverflow/ui_test_coverflow.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_slipflow/ui_test_slipflow.cpp ${UI_SAMPLE_ROOT}/components/ui_test_kaleidoscope/ui_test_kaleidoscope.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/dial/DialRotateImgView.cpp diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp index 476286256..034db97eb 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp @@ -40,6 +40,7 @@ #include "BluetoothPresenter.h" #include "PlayersModel.h" #include "HealthModel.h" +#include "PresenterTask.h" #include "MainCompassPresenter.h" #include "MainCompassView.h" #include "CallerLogModel.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp index c5773ba61..c3e8a5204 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp @@ -228,6 +228,8 @@ void BluetoothEarPhoneView::BtEnable() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView::BtEnable Bt is Discovering"); return; } else { + results = gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, 0); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "gap_br_set_bt_scan_mode results %d", results); results = gap_br_set_inquiry_paramters(DEVICE_MAJOR_CLASS_AUDIO_VIDEO, 0); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "gap_br_set_inquiry_paramters results %d", results); results = gap_br_start_discovery(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp index cc25e6087..00057bc20 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp @@ -226,7 +226,7 @@ static bd_addr_t *BtAvrcpSrvGetActiveAddr(void) void ConnectTgStateChangedCallback(const bd_addr_t *bdAddr, profile_connect_state_t state) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "avrcp tg update conn stat:%u", state); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "avrcp tg update conn stat:%u", state); if (bdAddr == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bdaddr nullptr"); return; @@ -325,19 +325,15 @@ static void BtAvrcpCtSupportEventCallback(const bd_addr_t *bd_addr, avrcp_ct_sup WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "null pointer\n"); return; } - + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "get event list:"); for (uint8_t i = 0; i < event->event_num; i++) { - if (event->event_id[i] == AVRCP_NOTIFY_EVENT_VOLUME_CHANGED) { - int ret = avrcp_ct_register_notification(bd_addr, event->event_id[i], 0); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "register event_id: 0x%x, ret = 0x%x", event->event_id[i], ret); - } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " 0x%x ", event->event_id[i]); } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "\n"); for (uint8_t i = 0; i < event->event_num; i++) { - if (event->event_id[i] != AVRCP_NOTIFY_EVENT_VOLUME_CHANGED) { - int ret = avrcp_ct_register_notification(bd_addr, event->event_id[i], 0); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "register event_id: 0x%x, ret = 0x%x", event->event_id[i], ret); - } + avrcp_ct_register_notification(bd_addr, event->event_id[i], 0); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "register event_id: 0x%x\n", event->event_id[i]); } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp index 57bdeff22..55620f999 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp @@ -503,11 +503,6 @@ void BluetoothModel::SetAdvStartState(bool state) int BluetoothModel::ConnectRemoteDevice(const bd_addr_t *addr) { - /* 恢厂后耳机连接要开启BT广播否则会导致AVRCP无法音量控制 */ - bool ret = gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 60); - if (!ret) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConnectRemoteDevice gap_br_set_bt_scan_mode ret = 0x%x", ret); - } errcode_t retVal = gap_connect_remote_device(addr); (void)memcpy_s(&remoteConnectAddr, sizeof(bd_addr_t), addr, sizeof(bd_addr_t)); return retVal; @@ -850,15 +845,13 @@ void GapAclStateChangedCallback(const bd_addr_t *bdAddr, gap_acl_state_t state, WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "addr: %02x%02x%02x%02x%02x%02x", bdAddr->addr[5], bdAddr->addr[4], bdAddr->addr[3], /* mac下标 0 1 2 3 4 5 */ bdAddr->addr[2], bdAddr->addr[1], bdAddr->addr[0]); /* mac下标 0 1 2 3 4 5 */ - static bd_addr_t gapAclConnectAddr{0}; /* 连接后保存手机地址,手表清除手机配对后查询不到class比较手机地址 */ - if ((gap_get_device_class(bdAddr) & 0x200) != 0 || memcmp(gapAclConnectAddr.addr, bdAddr->addr, BD_ADDR_LEN) == 0) { + if ((gap_get_device_class(bdAddr) & 0x200) != 0) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback: Mobile Phone Device"); if (state == GAP_ACL_STATE_DISCONNECTED) { /* 通知msg_center,ble状态仍用bt状态,此处不区分 */ SendMsgToMsgCenterService(BT_DISCONNECTED_TO_MSGCENTER, 0, nullptr, 0); SendMsgToUIService(BT_DISCONNECTED_TO_UI, 0, nullptr, 0); } else if (state == GAP_ACL_STATE_CONNECTED) { - (void)memcpy_s(gapAclConnectAddr.addr, BD_ADDR_LEN, bdAddr->addr, BD_ADDR_LEN); SendMsgToMsgCenterService(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0); SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0); } @@ -911,8 +904,7 @@ static void A2dpSrcConnectstateChanged(bd_addr_t *bdAddr, int connState) return; } if (connState == PROFILE_STATE_CONNECTED) { - uint32_t ret = avrcp_ct_connect(bdAddr); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "avrcp_ct_connect ret = 0x%x", ret); + avrcp_ct_connect(bdAddr); PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_CONNECTED); GraphicService::GetInstance()->PostGraphicEvent(std::bind(ACLConnectionSuss, *bdAddr)); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h index 3484cb6e8..6444c4fe6 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h @@ -19,13 +19,13 @@ #include "common/task.h" namespace OHOS { -class ModelListenerSample : public Task { +class ModelListenerSample : public HeapBase { public: ModelListenerSample(); virtual ~ModelListenerSample(); virtual void Notify(void) = 0; virtual void OnTickEvent(void) {}; - void Callback() override; + void Callback(); }; } #endif diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/PresenterTask.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/PresenterTask.h new file mode 100755 index 000000000..e655268f6 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/PresenterTask.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: Presenter task + * Create: 2021-12-22 + */ + +#ifndef PRESENTER_TASK_H +#define PRESENTER_TASK_H +#include "common/task.h" + +namespace OHOS { +class ModelListenerSample; +class PresenterTask : public Task { +public: + void SetModelListener(ModelListenerSample* listener); + void Callback() override; + static PresenterTask* GetInstance(); + void Init() override; + ModelListenerSample* taskListener{nullptr}; +}; +} +#endif \ No newline at end of file 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..adc642470 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -21,6 +21,7 @@ #include #include #include "ModelDialDataFactory.h" +#include "PresenterTask.h" #include "DialModelTime.h" #include "DialViewGroup.h" #include "ui_service.h" @@ -153,7 +154,7 @@ void MainPresenterSample::SetPage(int8_t id) void MainPresenterSample::SetTaskPeroid(CardId cardId) { if (cardId == COMPASS) { - SetPeriod(DEFAULT_TASK_PERIOD); + PresenterTask::GetInstance()->SetPeriod(DEFAULT_TASK_PERIOD); } else if (cardId == WATCH_FACE) { uint32_t time; DialSetting &setting = GetDialSetting(); @@ -162,11 +163,11 @@ void MainPresenterSample::SetTaskPeroid(CardId cardId) } else { time = DEFAULT_TASK_PERIOD; } - SetPeriod(time); + PresenterTask::GetInstance()->SetPeriod(time); } else if (cardId == MUSIC_PLAYER) { - SetPeriod(PLAYER_PERIOD); + PresenterTask::GetInstance()->SetPeriod(PLAYER_PERIOD); } else { - SetPeriod(MAX_PERIOD); + PresenterTask::GetInstance()->SetPeriod(MAX_PERIOD); } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp index 26c67fb1f..ab4844c3d 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp @@ -14,17 +14,20 @@ */ #include "ModelListenerSample.h" +#include "PresenterTask.h" #include "wearable_log.h" namespace OHOS { ModelListenerSample::ModelListenerSample() { - Init(); + PresenterTask::GetInstance()->SetModelListener(this); + PresenterTask::GetInstance()->Init(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ModelListenerSample::ModelListenerSample"); } ModelListenerSample::~ModelListenerSample() { - Deinit(); + PresenterTask::GetInstance()->Deinit(); + PresenterTask::GetInstance()->SetModelListener(nullptr); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ModelListenerSample::~ModelListenerSample"); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/PresenterTask.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/PresenterTask.cpp new file mode 100755 index 000000000..1b1c61930 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/PresenterTask.cpp @@ -0,0 +1,30 @@ + +#include "ModelListenerSample.h" +#include "PresenterTask.h" + +namespace OHOS { + +PresenterTask* PresenterTask::GetInstance() +{ + static PresenterTask PresenterTask; + return &PresenterTask; +} + +void PresenterTask::SetModelListener(ModelListenerSample* listener) +{ + taskListener = listener; +} + +void PresenterTask::Callback() +{ + if (taskListener != nullptr) { + taskListener->Callback(); + } +} + +void PresenterTask::Init() +{ + Task::Init(); +} + +} \ 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..9e1920f84 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp @@ -390,7 +390,10 @@ static void AudioDn(void) // 建立音频下行通路 AudioDnStart(); - + if (g_audioState == AUDIO_STREAM_START_DN) { + // 同步音量 + SyncVolume(); + } WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[AudioDn] audioState:%d", g_audioState); } @@ -671,8 +674,6 @@ static void ScoStateChanged(const bd_addr_t *bdAddr, hfp_sco_connect_state_t sta } break; case HFP_SCO_STATE_CONNECTED: - // 同步音量 - SyncVolume(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoStateChanged] SCO connected!"); break; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp index 6ee51a489..98510eb9e 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp @@ -660,15 +660,13 @@ void PlayerCallbackImpl::OnPlaybackComplete() { // 此处实现代码用于处理文件播放完成的事件 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnPlaybackCompleten"); - GraphicService::GetInstance()->PostGraphicEvent([] { - PlayersView *playersView = PlayersView::GetInstance(); - if (playersView != nullptr) { - if (playersView->GetPlaybackProgress() != nullptr) { - playersView->GetPlaybackProgress()->SetValue(100); // 100:进度100% - playersView->GetPlaybackProgress()->Invalidate(); - } + PlayersView *playersView = PlayersView::GetInstance(); + if (playersView != nullptr) { + if (playersView->GetPlaybackProgress() != nullptr) { + playersView->GetPlaybackProgress()->SetValue(100); // 100:进度100% + playersView->GetPlaybackProgress()->Invalidate(); } - }); + } usleep(20000); GraphicService::GetInstance()->PostGraphicEvent(std::bind(&PlayersModel::PlaySwitching, PlayersModel::GetInstance())); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp index d352da9c2..d4562b6d5 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp @@ -79,13 +79,13 @@ public: tempView->SetViewId(view.GetViewId()); tempView->SetPosition(tempView->GetX(), tempView->GetY()); rootView->Add(tempView); + if (backBtn_ == nullptr) { + backBtn_ = new TransparentBackButton(); + backBtn_->SetPosition(0, 202, 50, 50); // 0: x position, 202: y position, 50: width and height + } + backBtn_->SetViewId(view.GetViewId()); + rootView->Add(backBtn_); } - if (backBtn_ == nullptr) { - backBtn_ = new TransparentBackButton(); - backBtn_->SetPosition(0, 202, 50, 50); // 0: x position, 202: y position, 50: width and height - } - backBtn_->SetViewId(view.GetViewId()); - rootView->Add(backBtn_); rootView->Invalidate(); return true; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp b/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp index 326a0fb6b..3e4da3ccf 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp @@ -31,7 +31,6 @@ #include "ui_test_hexagons_list/ui_test_hexagons_list.h" #include "ui_test_video_play/ui_test_video_play.h" #include "ui_test_coverflow/ui_test_coverflow.h" -#include "ui_test_slipflow/ui_test_slipflow.h" #include "ui_test_kaleidoscope/ui_test_kaleidoscope.h" namespace OHOS { @@ -58,7 +57,6 @@ void UITestGroup::SetUpTestCase() testCaseList_->PushBack(TestCaseInfo{"消息", new UITestMessage()}); testCaseList_->PushBack(TestCaseInfo{"呼吸效果", new UITestBreath()}); testCaseList_->PushBack(TestCaseInfo{"覆盖流", new UITestCoverflow()}); - testCaseList_->PushBack(TestCaseInfo{"滑动流", new UITestSlipflow()}); testCaseList_->PushBack(TestCaseInfo{"万花筒", new UITestKaleidoscope()}); #if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index 126a7c8d0..4c527aded 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -2208,12 +2208,12 @@ uint8_t parse_jsonCheck_weather(uint8_t *buf,uint8_t *check)//json 格式解析 } - if( uapi_dev_runtime_get_bt_powerstat() && cm_get_HFP_switch()) + if( cm_custom_ble_service_on_flag() && cm_get_HFP_switch()) uapi_pbap_cmd_start_client(); bd_addr_t bdaddr={0}; uapi_get_br_address(&bdaddr); - if( uapi_dev_runtime_get_bt_powerstat() && (cm_get_HFP_switch()||cm_get_A2DP_switch())) + if( cm_custom_ble_service_on_flag() && (cm_get_HFP_switch()||cm_get_A2DP_switch())) { if (false==bt_is_acl_connected(&bdaddr)) { diff --git a/code/sdk/application/wearable/service/msg_center/CMakeLists.txt b/code/sdk/application/wearable/service/msg_center/CMakeLists.txt index a388cb1f5..7d580d33b 100644 --- a/code/sdk/application/wearable/service/msg_center/CMakeLists.txt +++ b/code/sdk/application/wearable/service/msg_center/CMakeLists.txt @@ -59,16 +59,17 @@ set(PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativelauncher/include ) endif() +if("JS_ENABLE" IN_LIST DEFINES) set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/notification_manager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/jsi_utils.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_protocol.cpp ) - -if("JS_ENABLE" IN_LIST DEFINES) +else() set(SOURCES - ${SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/src/jsi_utils.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/notification_manager.cpp ) endif() @@ -117,8 +118,6 @@ set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/vendor_app ${CMAKE_CURRENT_SOURCE_DIR}/include/ota - ${CMAKE_CURRENT_SOURCE_DIR}/include/hc_demo - ${CMAKE_CURRENT_SOURCE_DIR}/include/common ) if("FD230" IN_LIST DEFINES) @@ -148,6 +147,7 @@ set(PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/bluetooth/include ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativelauncher/include ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/goal/include + # ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativelauncher/include ${CMAKE_CURRENT_SOURCE_DIR}/../../ohos_deps ${CMAKE_CURRENT_SOURCE_DIR}/../../CustomUIComponentTool/uicomponents/ ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include @@ -182,7 +182,6 @@ set(PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/main/include ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/player/include ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/bluetooth/include - ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/key/include ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativelauncher/include ${CMAKE_CURRENT_SOURCE_DIR}/../../ohos_deps ${CMAKE_CURRENT_SOURCE_DIR}/../../CustomUIComponentTool/uicomponents/ @@ -224,7 +223,6 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/message_notification.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/sleep_notification.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/motion_recognition_notification.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/msg_center_common.cpp ) else() set(SOURCES 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..25f166fc0 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..1ed3a3d21 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/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a index 84ab43bdc..e31900481 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..159b848c1 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/include/common/msg_center_common.h b/code/sdk/application/wearable/service/msg_center/include/common/msg_center_common.h deleted file mode 100644 index 3d4bf1aa8..000000000 --- a/code/sdk/application/wearable/service/msg_center/include/common/msg_center_common.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. - * Description: broadcast service api - * Author: CompanyName - * Create: 2021-11-11 - */ - -#ifndef MSG_CENTER_COMMON_H -#define MSG_CENTER_COMMON_H - -#include "msg_center_protocol.h" - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif -#endif - -errcode_t msg_center_ping_rec(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); - -#ifdef __cplusplus -#if __cplusplus -} -#endif -#endif -#endif /* MSG_CENTER_COMMON_H */ diff --git a/code/sdk/application/wearable/service/msg_center/include/msg_center_customer.h b/code/sdk/application/wearable/service/msg_center/include/msg_center_customer.h deleted file mode 100644 index b150c522a..000000000 --- a/code/sdk/application/wearable/service/msg_center/include/msg_center_customer.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MSG_CENTER_CUSTOMER_H -#define MSG_CENTER_CUSTOMER_H - -#include -#include "service.h" -#include "iunknown.h" -#include "broadcast_feature.h" -#include "graphic_service.h" -#include "jsi/jsi_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef JS_ENABLE -void StartJsApp(char *bundleName); -void StopJsApp(char *bundleName); -void MsgCenterReportBtStatusToJS(uint16_t msgId); -#endif - -#ifdef __cplusplus -} -#endif -#endif // MSG_CENTER_CUSTOMER_H diff --git a/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h b/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h index 1b2812c97..de090546b 100755 --- a/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h +++ b/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h @@ -13,7 +13,6 @@ #include "soc_osal.h" #include "baidu_app.h" #include "cmsis_os2.h" -#include "bts_le_gap.h" #ifdef __cplusplus #if __cplusplus @@ -218,19 +217,12 @@ typedef enum msg_center_ota_type_id { } msg_center_ota_type_id_t; -typedef enum msg_center_ping_type_id { - MSGCENTER_TYPE_ID_PING_REC = 0x1, - MSGCENTER_TYPE_ID_PING_RSP = 0x2, -} msg_center_ping_type_id_t; - typedef enum msg_center_cmd_id { MSGCENTER_CMD_XIAODU = 0x1, MSGCENTER_CMD_NAVIGATION = 0x2, MSGCENTER_CMD_VECTOR_NAVI = 0x3, MSGCENTER_CMD_ALIPAY = 0x4, MSGCENTER_CMD_OTA = 0x5, - MSGCENTER_CMD_HC = 0x6, - MSGCENTER_CMD_PING = 0x7, MSGCENTER_CMD_MAX } msg_center_cmd_id_t; @@ -339,8 +331,6 @@ void msg_center_split_file(char *origin_file, int size, char *flist); void msg_center_combine_file(char *flist, char *target_file_name); diag_frame_fid_t msg_center_get_trans_channel(void); void msg_center_set_trans_channel(diag_frame_fid_t select); -void msg_center_set_ble_conn_state(gap_ble_conn_state_t state); -gap_ble_conn_state_t msg_center_get_ble_conn_state(void); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/application/wearable/service/msg_center/src/common/msg_center_common.cpp b/code/sdk/application/wearable/service/msg_center/src/common/msg_center_common.cpp deleted file mode 100644 index 0aa7dc3cc..000000000 --- a/code/sdk/application/wearable/service/msg_center/src/common/msg_center_common.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. - * Description: ota upgrade handle. - * This file should be changed only infrequently and with great care. - */ -#include -#include "securec.h" -#include "bts_br_gap.h" -#include "bts_spp.h" -#include "msg_center.h" -#include "msg_center_protocol.h" -#include "msg_center_cmd.h" -#include "wearable_log.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -errcode_t msg_center_ping_rec(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) -{ - uint8_t tl_len = msg_center_get_tlv_tl_len(usr_data); - uint16_t payload_len = usr_len - tl_len; - uint8_t *tlv_payload = (uint8_t *)msg_center_get_tlv_payload(usr_data); - errcode_t ret = ERRCODE_SUCC; - uint8_t ping_result = 0; - - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "rec_ping_from_phone\r\n"); - - if (msg_center_get_trans_channel() == DIAG_FRAME_FID_PHONE) { - ping_result = is_spp_connected(0) == true ? 1 : 0; - } else if (msg_center_get_trans_channel() == DIAG_FRAME_FID_BT) { - ping_result = msg_center_get_ble_conn_state(); - } else { - ping_result = 2; /* 2用来表示异常值 */ - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "ble or spp not connected!\r\n"); - } - - /* ping req ack */ - ret = msg_center_send_data(cmd_id, type + 1, &ping_result, sizeof(ping_result)); - if (ret != ERRCODE_SUCC) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "send_ping_ack fail, ret = %d\r\n", ret); - return ERRCODE_FAIL; - } - - return ERRCODE_SUCC; -} - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp index fb0958828..f5d952a6b 100755 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp @@ -12,10 +12,6 @@ #include "baidu_app.h" #include "alipay_app.h" #include "msg_center_ota.h" -#ifdef SUPPORT_HC_DEMO -#include "msg_center_hc_demo.h" -#endif -#include "msg_center_common.h" #ifdef __cplusplus extern "C" { @@ -115,10 +111,6 @@ msg_center_cmd_map_t g_msg_center_type_tbl[] = { { MSGCENTER_CMD_OTA, MSGCENTER_TYPE_ID_OTA_UPG_CHECK, msg_center_ota_rec_upg_check}, { MSGCENTER_CMD_OTA, MSGCENTER_TYPE_ID_OTA_UPG_CHECK_RESULT, msg_center_ota_rec_upg_check_result}, #endif -#ifdef JS_ENABLE - { MSGCENTER_CMD_PING, MSGCENTER_TYPE_ID_PING_REC, msg_center_ping_rec}, - { MSGCENTER_CMD_PING, MSGCENTER_TYPE_ID_PING_RSP, NULL}, -#endif }; msg_center_cmd_map_t *msg_center_get_cmd_tbl_ops(uint8_t idx) @@ -135,15 +127,17 @@ char *msg_center_get_bundle_name(uint8_t cmd_id) { switch (cmd_id) { case MSGCENTER_CMD_XIAODU: - return (char *)"com.vendor.voiceassistant"; + return "com.vendor.voiceassistant"; case MSGCENTER_CMD_NAVIGATION: - return (char *)"cn.navigate"; + return "cn.navigate"; case MSGCENTER_CMD_VECTOR_NAVI: - return (char *)"com.baidu.BaiduMap"; + return "com.baidu.BaiduMap"; default: WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER,"msg_center_get_bundle_name: wrong cmd_id[%d]", cmd_id); - return (char*)"wrong"; + break; } + + return NULL; } static errcode_t msg_center_pkt_dispatch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 2e8324e0c..0e4f5118e 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -24,9 +24,6 @@ #include "element_name.h" #include "want.h" #include "msg_center.h" -#include "msg_center_msg.h" -#include "msg_center_protocol.h" -#include "baidumap.h" #include "common_def.h" #include "PhoneService.h" #include "power_display_service.h" @@ -1563,76 +1560,6 @@ bool MsgCenterNotifyProc(const Topic topic, Request* req) return false; } -#ifdef JS_ENABLE -void StartJsApp(char *bundleName) -{ - ElementName* topAbility = OHOS::AbilityMsClient::GetInstance().GetTopAbility(); - if (topAbility == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "topAbility is null"); - return; - } - - if (strcmp(topAbility->bundleName, bundleName) == 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s is active", bundleName); - return; - } - // If the alarm notification is being processed, we need to disable the alarm notification first. - if (OHOS::NotificationManager::GetInstance()->GetNotifyPriority() == PRIORITY_TWO && - OHOS::NotificationManager::GetInstance()->HasNotifyShowing()) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Alarm notification needs to be disabled first."); - AlarmClockModel::GetInstance()->AlarmGetClockNum(); - OHOS::AlarmPopUpPresenter::GetInstance()->DelayAlarmRing(); - OHOS::NotificationManager::GetInstance()->StopNotify(); - } - Want *want = new Want(); - memset_s(want, sizeof(Want), 0, sizeof(Want)); - - ElementName startElement = {}; - startElement.abilityName = (char *)"default"; - startElement.bundleName = bundleName; - startElement.deviceId = nullptr; - SetWantElement(want, startElement); - - StartAbility(want); - - delete want; -} - -void StopJsApp(char *bundleName) -{ - ElementName* topAbility = OHOS::AbilityMsClient::GetInstance().GetTopAbility(); - if (topAbility == nullptr) { - WEARABLE_LOGE(HILOG_MODULE_AAFWK, "topAbility is null"); - return; - } - - if (strcmp(topAbility->bundleName, bundleName) != 0) { - WEARABLE_LOGE(HILOG_MODULE_AAFWK, "%s is not top active", bundleName); - return; - } - - int token = 0; - OHOS::AbilityMsClient::GetInstance().TerminateAbility(token); -} - -void MsgCenterReportBtStatusToJS(uint16_t msgId) -{ - ElementName *elementName = OHOS::AbilityMsClient::GetInstance().GetTopAbility(); - if (!(elementName != nullptr && strcmp(elementName->bundleName, "com.huawei.launcher") != 0)) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "JS is not on top, ignore report"); - return; - } - - if (msgId == BT_DISCONNECTED_TO_MSGCENTER) { - BaidumapSendMsgToJS("0", MSGCENTER_TYPE_ID_VECTOR_NAVI_BT_DISCONNECTED); - } else if (msgId == BT_CONNECTED_TO_MSGCENTER) { - BaidumapSendMsgToJS("1", MSGCENTER_TYPE_ID_VECTOR_NAVI_BT_CONNECTED); - } else { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "unexpected msgId %d", msgId); - } -} -#endif - #ifdef __cplusplus } #endif 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..bbba86e0f 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 @@ -17,7 +17,6 @@ #include "sign_mode.h" #include "NativeAbility.h" #include "ability_manager.h" -#include "js_fwk_common.h" #define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0])) #define OHOSFWK_MAX_ARGC 8 @@ -224,12 +223,6 @@ static uint32_t OhosfwkATCmdAmStartJsApp(uint8_t *para, uint32_t paraLen, char * return ERRCODE_SUCC; } -static uint32_t OhosfwkATCmdDfxJsMemoryInfo(uint8_t *para, uint32_t paraLen, char *strCommonCmd) -{ - OHOS::ACELite::DumpPrintMemoryInfo(); - 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" }, @@ -237,7 +230,6 @@ static const at_cmd_table_t g_ohosfwk_cmd[] = { { (char *)"AT^OHOSFWK_BM_UNINSTALL", OhosfwkATCmdBmUninstall, (char *)"00 00 00 03" }, { (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" }, }; at_cmd_table_t *get_ohosfwk_cmd_table(uint32_t *cmd_count) diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index ea4db77e9..895068d85 100755 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -26,7 +26,7 @@ target = { 'pm_service', 'pm_brandy', 'cmn_header', 'at_cmd', 'graphic_at_service', 'app_at_service', 'audio_at_service', 'media_at_service', 'bt_manager_at_service', "audio_proc", "audio_dump", "audio_probe", "gpu_proc", 'bts_header'], - 'ram_component_set': ['bgh', 'media_mini', 'gpu', 'graphic_lvgl_mini', 'bgh_audio', 'dfx_set'], + 'ram_component_set': ['bgh', 'media_mini', 'gpu', 'graphic_lvgl_mini', 'dfx_set'], 'image_analysis': True, 'dsp_version': 'mini', 'packet': True, @@ -146,8 +146,8 @@ target = { 'CYWEE_MAC_ACTIVE', 'SUPPORT_TCPIP', 'SUPPORT_HID_SERVICE', - 'SUPPORT_BAIDU_MAP', - 'CFG_FLASH_SIZE=16' + #'LEANTEST', + 'SUPPORT_BAIDU_MAP' ], 'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", 'dfx_nv', "osal", "arch_port", "-:testsuite", "liteos_port", 'lcd', 'qspi_display', 'dfx_file_operation', @@ -184,6 +184,7 @@ target = { "bleservice", "blemoder", "factorytest_service", + #"leantest", "hid_service" ], 'ram_component_set': ['bgh', 'media', 'gpu', 'graphic_uikit', 'bgh_audio', 'dfx_set', 'ohos_set', 'wearable_set', 'alipay_set'], diff --git a/code/sdk/build/config/target_config/brandy/param_sector/param_sector_16M.json b/code/sdk/build/config/target_config/brandy/param_sector/param_sector_16M.json deleted file mode 100644 index bd4ec2fc0..000000000 --- a/code/sdk/build/config/target_config/brandy/param_sector/param_sector_16M.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "Partition_Tbl":{ - "image_id" : "0x4B87A52D", - "stru_ver" : "0x00010000", - "version" : "0x00000000", - "param_info_description" : [ - "Address Constraints: flash type must fill with relative address, RAM regions must fill with absolute address.", - "Item ID Constraints: ssb type: 0x00 ~ 0x0F, Relative address, Size", - " root public key and signature: 0x10 ~ 0x1F, Relative address, Size", - " firmware on flash: 0x20 ~ 0x2F, Relative address, Size", - " data on flash: 0x30 ~ 0x3F, Relative address, Size", - - "Fixed item id: 0x00: ssb", - " 0x01: ssb_backup", - " 0x10: configure RootPubKey", - " 0x11: signature certificate", - " 0x12: ssb image signature", - " 0x13: signature certificate backup", - " 0x14: ssb image backup signature", - " 0x15: algorithm signature", - " 0x16: recovery signature", - " 0x17: bt_image signature", - " 0x18: dsp_main_image signature", - " 0x19: dsp_overlay_image signature", - " 0x1A: acpu_image signature", - " 0x20: recovery", - " 0x21: bt_image", - " 0x22: dsp_main_image", - " 0x23: dsp_overlay_image", - " 0x24: acpu_image", - " 0x30: nv_data", - " 0x31: fota_data" - ], - "param_info" : [ - ["0x00", "0x00000000", "0x00020000"], - ["0x01", "0x00020000", "0x00020000"], - ["0x10", "0x00040000", "0x00001000"], - ["0x11", "0x00041000", "0x00001000"], - ["0x12", "0x00042000", "0x00001000"], - ["0x13", "0x00043000", "0x00001000"], - ["0x14", "0x00044000", "0x00001000"], - ["0x15", "0x00045000", "0x00001000"], - ["0x16", "0x00046000", "0x00001000"], - ["0x17", "0x00047000", "0x00001000"], - ["0x18", "0x00048000", "0x00001000"], - ["0x19", "0x00049000", "0x00001000"], - ["0x1a", "0x0004A000", "0x00001000"], - ["0x20", "0x00B80000", "0x00100000"], - ["0x21", "0x00090000", "0x00070000"], - ["0x22", "0x00100000", "0x000C0000"], - ["0x23", "0x001C0000", "0x001C0000"], - ["0x24", "0x00380000", "0x00800000"], - ["0x30", "0x00C80000", "0x00004000"], - ["0x31", "0x00C84000", "0x00003000"] - ] - }, - "Output_file_prefix":"AIoT" -} diff --git a/code/sdk/build/config/target_config/brandy/param_sector/param_sector_fd230.json b/code/sdk/build/config/target_config/brandy/param_sector/param_sector_fd230.json deleted file mode 100644 index 3e604696e..000000000 --- a/code/sdk/build/config/target_config/brandy/param_sector/param_sector_fd230.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "Partition_Tbl":{ - "image_id" : "0x4B87A52D", - "stru_ver" : "0x00010000", - "version" : "0x00000000", - "param_info_description" : [ - "Address Constraints: flash type must fill with relative address, RAM regions must fill with absolute address.", - "Item ID Constraints: ssb type: 0x00 ~ 0x0F, Relative address, Size", - " root public key and signature: 0x10 ~ 0x1F, Relative address, Size", - " firmware on flash: 0x20 ~ 0x2F, Relative address, Size", - " data on flash: 0x30 ~ 0x3F, Relative address, Size", - - "Fixed item id: 0x00: ssb", - " 0x01: ssb_backup", - " 0x10: configure RootPubKey", - " 0x11: signature certificate", - " 0x12: ssb image signature", - " 0x13: signature certificate backup", - " 0x14: ssb image backup signature", - " 0x15: algorithm signature", - " 0x16: recovery signature", - " 0x17: bt_image signature", - " 0x18: dsp_main_image signature", - " 0x19: dsp_overlay_image signature", - " 0x1A: acpu_image signature", - " 0x20: recovery", - " 0x21: bt_image", - " 0x22: dsp_main_image", - " 0x23: dsp_overlay_image", - " 0x24: acpu_image", - " 0x30: nv_data", - " 0x31: fota_data" - ], - "param_info" : [ - ["0x00", "0x00000000", "0x00020000"], - ["0x01", "0x00020000", "0x00020000"], - ["0x10", "0x00040000", "0x00001000"], - ["0x11", "0x00041000", "0x00001000"], - ["0x12", "0x00042000", "0x00001000"], - ["0x13", "0x00043000", "0x00001000"], - ["0x14", "0x00044000", "0x00001000"], - ["0x15", "0x00045000", "0x00001000"], - ["0x16", "0x00046000", "0x00001000"], - ["0x17", "0x00047000", "0x00001000"], - ["0x18", "0x00048000", "0x00001000"], - ["0x19", "0x00049000", "0x00001000"], - ["0x1a", "0x0004A000", "0x00001000"], - ["0x20", "0x00050000", "0x00040000"], - ["0x21", "0x00090000", "0x00070000"], - ["0x22", "0x00100000", "0x00070000"], - ["0x23", "0x00170000", "0x00140000"], - ["0x24", "0x002B0000", "0x00D49000"], - ["0x30", "0x00FF9000", "0x00004000"], - ["0x31", "0x00FFD000", "0x00003000"] - ] - }, - "Output_file_prefix":"AIoT" -} diff --git a/code/sdk/build/script/cmake_builder.py b/code/sdk/build/script/cmake_builder.py index a0e5da8ff..9d0e78ae1 100755 --- a/code/sdk/build/script/cmake_builder.py +++ b/code/sdk/build/script/cmake_builder.py @@ -173,11 +173,7 @@ class CMakeBuilder(BuildEnvironment): print("copy file.bin to application dir over!\n") if env.get('packet'): - defines = env.get("defines") - if "CFG_FLASH_SIZE=16" in defines: - self.pack_fwpkg(env.get('chip'), target, "0x1000000") - else: - self.pack_fwpkg(env.get('chip'), target, "0x800000") + self.pack_fwpkg(env.get('chip'), target) if not run_custom_cmd(env, target, 'build_post'): self.print_build_result(target, 1) @@ -385,11 +381,11 @@ class CMakeBuilder(BuildEnvironment): print(f"ERROR! :{bin1} is not same with {bin2}") sys.exit(1) - def pack_fwpkg(self, chip, target_name, flash_size): + def pack_fwpkg(self, chip, target_name): # bin packet all in one packet_script_path = os.path.join(pkg_tools_path, 'packet.py') print("packet ing...") - errcode = exec_shell([self.python_path, packet_script_path, chip, target_name, flash_size], None, True) + errcode = exec_shell([self.python_path, packet_script_path, chip, target_name], None, True) if errcode != 0: print("packet error!") self.print_build_result(target_name, errcode) diff --git a/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_16M.h b/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_16M.h deleted file mode 100644 index a4506f757..000000000 --- a/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_16M.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) @CompanyNameMagicTag 2021-2022. All rights reserved. - * Description: Default memory configurations - * Author: @CompanyNameTag - * Create: 2022-03-09 - */ - -#ifndef FLASH_16M_H -#define FLASH_16M_H - -/* - * ********************* FLASH ALLOCATION ********************* - * Flash is shared between the cores, and also handles a limited number of - * non-volatile storage areas. - * - * Flash is split into 2 main areas - * IMAGE Area - * Managed by the BT core - * This contains, in order from the bottom of Flash: - * SSB - SSB image starting at the bottom of flash. Variable size depending on the SSB on the chip that - * the package is loaded on. The values in this file only apply to the SSB built with this file. - * RECOVERY_Image - starts in the page after the SSB. - * BT_Image - starts in the page after the RECOVERY_Image - * DSP_Image - starts in the page after the BT_Image - * APP_Image - starts in the page after the DSP_Image - * System On-demand region - dynamically allocated flash for FOTA etc - * NV Area - * Ends at the last page of flash, is configurable in size above a minimum allocation. - * NV Area, of 12 pages, is allocated, from the lowest address: - * 8 pages of general use (pages are not fixed and self-identifying), consisting of - * 1 Page for Asset Store defragmentation - * 3 pages for Asset Store - * 2 Pages for App and DSP Core KV defragmentation - * 1 page for DSP Core KV - * 1 page for App Core KV - * 2 pages for BT core use (last 2 pages in Flash) - * 1 page for BT Core KV - * 1 page for BT Core KV defragmentation - */ - -#define FLASH_START 0x70000000 -#define FLASH_LENGTH 0x1000000 -#define FLASH_MAX_END (FLASH_START + FLASH_LENGTH) - -#define FLASH_PAGE_SIZE 4096 -/* APP ITCM config */ -#define MCU_ITCM_END (APP_ITCM_ORIGIN + APP_ITCM_LENGTH) - -#define SSB_BOOT_RAM_ORIGIN APP_ITCM_ORIGIN -#define SSB_BOOT_RAM_LENGTH APP_ITCM_LENGTH - -/* ----------------------------------------------------------------------------------------------------------------- */ -/* IMAGE Area Defines */ -/* MCU SSB Region */ -#define SSB_FLASH_REGION_PAGES (SSB_IMAGE_PAGES + 5) -#define KV_PAGES 0 -#define SSB_FLASH_REGION_START (FLASH_START) -#define SSB_FLASH_REGION_LENGTH (SSB_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define SSB_VECTORS_LOAD_ORIGIN (SSB_FLASH_REGION_START) -#define SSB_VERSION_LOAD_ORIGIN (SSB_VECTORS_LOAD_ORIGIN + APP_VECTORS_LENGTH) -#define SSB_CHANGEID_LOAD_ORIGIN (SSB_VERSION_LOAD_ORIGIN + VERSION_LENGTH) - -#define SSB_PROGRAM_ORIGIN (SSB_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define SSB_PROGRAM_LENGTH ((SSB_FLASH_REGION_LENGTH) - (APP_VECTORS_LENGTH + VERSION_LENGTH + CHANGE_ID_LENGTH)) - -/* MCU SSB BACK-UP Region */ -#define SSB_BACKUP_FLASH_REGION_PAGES 32 -#define SSB_BACKUP_FLASH_REGION_START (SSB_FLASH_REGION_START + SSB_FLASH_REGION_LENGTH + KV_PAGES * FLASH_PAGE_SIZE) -#define SSB_BACKUP_FLASH_REGION_LENGTH (SSB_BACKUP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* SEC_BOOT Region for Signature Certificate */ -#define SEC_BOOT_FLASH_REGION_PAGES 15 -#define SEC_BOOT_FLASH_REGION_START (SSB_BACKUP_FLASH_REGION_START + SSB_BACKUP_FLASH_REGION_LENGTH) -#define SEC_BOOT_FLASH_REGION_LENGTH (SEC_BOOT_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define PARTITION_TABLE_REGSION_PAGE 1 -#define PARTITION_TABLE_REGION_START (SEC_BOOT_FLASH_REGION_START + SEC_BOOT_FLASH_REGION_LENGTH) -#define PARTITION_TABLE_REGION_LENGTH (PARTITION_TABLE_REGSION_PAGE * FLASH_PAGE_SIZE) - -/* DTB Region */ -#define DTB_FLASH_REGION_PAGES (DTB_IMAGE_PAGES) -#define DTB_FLASH_REGION_START (PARTITION_TABLE_REGION_START + PARTITION_TABLE_REGION_LENGTH) -#define DTB_FLASH_REGION_LENGTH (DTB_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* RESERVE Region */ -#define RESERVE_FLASH_REGION_PAGES (RESERVE_IMAGE_PAGES) -#define RESERVE_FLASH_REGION_START (DTB_FLASH_REGION_START + DTB_FLASH_REGION_LENGTH) -#define RESERVE_FLASH_REGION_LENGTH (RESERVE_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* BT Region */ -#define BT_FLASH_REGION_PAGES (BT_IMAGE_PAGES) -#define BT_FLASH_REGION_START (RESERVE_FLASH_REGION_START + RESERVE_FLASH_REGION_LENGTH) -#define BT_FLASH_REGION_LENGTH (BT_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define BT_BUILD_INFO_ORIGIN (BT_FLASH_REGION_START) -#define BT_VECTORS_LOAD_ORIGIN (BT_BUILD_INFO_ORIGIN + BUILD_INFO_LENGRH) -#define BT_VERSION_LOAD_ORIGIN (BT_VECTORS_LOAD_ORIGIN + BT_VECTORS_LENGTH) -#define BT_CHANGEID_LOAD_ORIGIN (BT_VERSION_LOAD_ORIGIN + VERSION_LENGTH) -#define DSP_CHANGEID_LOAD_ORIGIN (BT_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) - -/* Fill 4 byte to align flash 8 byte */ -#define BT_PROGRAM_ORIGIN (DSP_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define BT_PROGRAM_LENGTH ((BT_FLASH_REGION_LENGTH) - (BT_VECTORS_LENGTH + \ - VERSION_LENGTH + CHANGE_ID_LENGTH + CHANGE_ID_LENGTH)) - -/* DSP Region */ -#define DSP_FLASH_REGION_PAGES (HIFI0_IMAGE_PAGES) -#define DSP_FLASH_REGION_START (BT_FLASH_REGION_START + BT_FLASH_REGION_LENGTH) -#define DSP_FLASH_REGION_LENGTH (DSP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* DSP1 Region */ -#define DSP_CODEC_FLASH_REGION_PAGES (HIFI0_CODEC_PAGES) -#define DSP_CODEC_FLASH_REGION_START (DSP_FLASH_REGION_START + DSP_FLASH_REGION_LENGTH) -#define DSP_CODEC_FLASH_REGION_LENGTH (DSP_CODEC_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* APP Region */ -#define APP_FLASH_REGION_PAGES (APP_IMAGE_PAGES) -#define APP_FLASH_REGION_START (DSP_CODEC_FLASH_REGION_START + DSP_CODEC_FLASH_REGION_LENGTH) -#define APP_FLASH_REGION_LENGTH (APP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* RECOVERY Region */ -#define RECOVERY_FLASH_REGION_PAGES (RECOVERY_IMAGE_PAGES) -#define RECOVERY_FLASH_REGION_START (APP_FLASH_REGION_START + APP_FLASH_REGION_LENGTH) -#define RECOVERY_FLASH_REGION_LENGTH (RECOVERY_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define RECOVERY_VECTORS_LOAD_ORIGIN (RECOVERY_FLASH_REGION_START) -#define RECOVERY_VERSION_LOAD_ORIGIN (RECOVERY_VECTORS_LOAD_ORIGIN + BT_VECTORS_LENGTH) -#define RECOVERY_CHANGEID_LOAD_ORIGIN (RECOVERY_VERSION_LOAD_ORIGIN + VERSION_LENGTH) - -#define RECOVERY_PROGRAM_ORIGIN (RECOVERY_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define RECOVERY_PROGRAM_LENGTH ((RECOVERY_FLASH_REGION_LENGTH) - \ - (BT_VECTORS_LENGTH + VERSION_LENGTH + CHANGE_ID_LENGTH)) - -/* NV data Region */ -#define NV_FLASH_REGION_PAGES (NV_IMAGE_PAGES) -#define NV_FLASH_REGION_START (RECOVERY_FLASH_REGION_START + RECOVERY_FLASH_REGION_LENGTH) -#define NV_FLASH_REGION_LENGTH (NV_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* Fota data Region */ -#define FOTA_FLASH_REGION_PAGES (FOTA_IMAGE_PAGES) -#define FOTA_FLASH_REGION_START (NV_FLASH_REGION_START + NV_FLASH_REGION_LENGTH) -#define FOTA_FLASH_REGION_LENGTH (FOTA_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define APP_VECTORS_LOAD_ORIGIN (APP_FLASH_REGION_START) -#define APP_VERSION_LOAD_ORIGIN (APP_VECTORS_LOAD_ORIGIN + APP_VECTORS_LENGTH) - -#define APP_PROGRAM_ORIGIN (APP_VERSION_LOAD_ORIGIN + VERSION_LENGTH) -#define APP_PROGRAM_LENGTH ((APP_FLASH_REGION_LENGTH) - (APP_VECTORS_LENGTH + VERSION_LENGTH)) - -/* cores image flash region start */ -#define FLASH_CORE_IMAGES_START (FLASH_START + SSB_FLASH_REGION_LENGTH + SSB_BACKUP_FLASH_REGION_LENGTH + \ - SEC_BOOT_FLASH_REGION_LENGTH + \ - KV_PAGES * FLASH_PAGE_SIZE + PARTITION_TABLE_REGION_LENGTH) -/* ----------------------------------------------------------------------------------------------------------------- */ -/* KV Region Defines */ -/* Minimum System Configuration pages in FLASH reserved */ -#define SYSTEM_RESERVED_FLASH_PAGES 0 -/* Minimum reserved Non Volatile storage + Config Data. */ -#define FLASH_RESERVED_LENGTH (SYSTEM_RESERVED_FLASH_PAGES * FLASH_PAGE_SIZE) - -/* - * ********************* SEC BOOT REGION ********************* - */ -#define MCU_ROOT_PUBKEY_START SEC_BOOT_FLASH_REGION_START -#define MCU_SUB_PUBKEY_START (MCU_ROOT_PUBKEY_START + FLASH_PAGE_SIZE) -#define MCU_SSB_IMAGE_SIGN_START (MCU_SUB_PUBKEY_START + FLASH_PAGE_SIZE) -#define MCU_SUB_PUBKEY_BACKUP_START (MCU_SSB_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_SSB_IMAGE_SIGN_BACKUP_START (MCU_SUB_PUBKEY_BACKUP_START + FLASH_PAGE_SIZE) - -#define MCU_SEC_BOOT_SIGN_BACKUP_START MCU_SUB_PUBKEY_BACKUP_START -#define MCU_SEC_BOOT_SIGN_BACKUP_LEN (2 * FLASH_PAGE_SIZE) - -#define MCU_CFCT_START (MCU_SEC_BOOT_SIGN_BACKUP_START + MCU_SEC_BOOT_SIGN_BACKUP_LEN) -#define MCU_CFCT_LEN FLASH_PAGE_SIZE - -#define MCU_RECOVERY_IMAGE_SIGN_START (MCU_CFCT_START + MCU_CFCT_LEN) -#define MCU_BT_IMAGE_SIGN_START (MCU_RECOVERY_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_DSP_IMAGE_SIGN_START (MCU_BT_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_DSP1_IMAGE_SIGN_START (MCU_DSP_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_APP_IMAGE_SIGN_START (MCU_DSP1_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_PARTITION_TABLE_SIGN_START (MCU_APP_IMAGE_SIGN_START + FLASH_PAGE_SIZE) - -#endif \ No newline at end of file diff --git a/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_16M_FD230.h b/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_16M_FD230.h deleted file mode 100644 index 1bc76d9e9..000000000 --- a/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_16M_FD230.h +++ /dev/null @@ -1,173 +0,0 @@ - -/* - * ********************* FLASH ALLOCATION ********************* - * Flash is shared between the cores, and also handles a limited number of - * non-volatile storage areas. - * - * Flash is split into 2 main areas - * IMAGE Area - * Managed by the BT core - * This contains, in order from the bottom of Flash: - * SSB - SSB image starting at the bottom of flash. Variable size depending on the SSB on the chip that - * the package is loaded on. The values in this file only apply to the SSB built with this file. - * RECOVERY_Image - starts in the page after the SSB. - * BT_Image - starts in the page after the RECOVERY_Image - * DSP_Image - starts in the page after the BT_Image - * APP_Image - starts in the page after the DSP_Image - * System On-demand region - dynamically allocated flash for FOTA etc - * NV Area - * Ends at the last page of flash, is configurable in size above a minimum allocation. - * NV Area, of 12 pages, is allocated, from the lowest address: - * 8 pages of general use (pages are not fixed and self-identifying), consisting of - * 1 Page for Asset Store defragmentation - * 3 pages for Asset Store - * 2 Pages for App and DSP Core KV defragmentation - * 1 page for DSP Core KV - * 1 page for App Core KV - * 2 pages for BT core use (last 2 pages in Flash) - * 1 page for BT Core KV - * 1 page for BT Core KV defragmentation - */ - -#define FLASH_START 0x70000000 -#define FLASH_LENGTH 0x1000000 -#define FLASH_MAX_END (FLASH_START + FLASH_LENGTH) - -#define FLASH_PAGE_SIZE 4096 -/* APP ITCM config */ -#define MCU_ITCM_END (APP_ITCM_ORIGIN + APP_ITCM_LENGTH) - -#define SSB_BOOT_RAM_ORIGIN APP_ITCM_ORIGIN -#define SSB_BOOT_RAM_LENGTH APP_ITCM_LENGTH - -/* ----------------------------------------------------------------------------------------------------------------- */ -/* IMAGE Area Defines */ -/* MCU SSB Region */ -#define SSB_FLASH_REGION_PAGES (SSB_IMAGE_PAGES + 5) -#define KV_PAGES 0 -#define SSB_FLASH_REGION_START (FLASH_START) -#define SSB_FLASH_REGION_LENGTH (SSB_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define SSB_VECTORS_LOAD_ORIGIN (SSB_FLASH_REGION_START) -#define SSB_VERSION_LOAD_ORIGIN (SSB_VECTORS_LOAD_ORIGIN + APP_VECTORS_LENGTH) -#define SSB_CHANGEID_LOAD_ORIGIN (SSB_VERSION_LOAD_ORIGIN + VERSION_LENGTH) - -#define SSB_PROGRAM_ORIGIN (SSB_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define SSB_PROGRAM_LENGTH ((SSB_FLASH_REGION_LENGTH) - (APP_VECTORS_LENGTH + VERSION_LENGTH + CHANGE_ID_LENGTH)) - -/* MCU SSB BACK-UP Region */ -#define SSB_BACKUP_FLASH_REGION_PAGES 32 -#define SSB_BACKUP_FLASH_REGION_START (SSB_FLASH_REGION_START + SSB_FLASH_REGION_LENGTH + KV_PAGES * FLASH_PAGE_SIZE) -#define SSB_BACKUP_FLASH_REGION_LENGTH (SSB_BACKUP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* SEC_BOOT Region for Signature Certificate */ -#define SEC_BOOT_FLASH_REGION_PAGES 15 -#define SEC_BOOT_FLASH_REGION_START (SSB_BACKUP_FLASH_REGION_START + SSB_BACKUP_FLASH_REGION_LENGTH) -#define SEC_BOOT_FLASH_REGION_LENGTH (SEC_BOOT_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define PARTITION_TABLE_REGSION_PAGE 1 -#define PARTITION_TABLE_REGION_START (SEC_BOOT_FLASH_REGION_START + SEC_BOOT_FLASH_REGION_LENGTH) -#define PARTITION_TABLE_REGION_LENGTH (PARTITION_TABLE_REGSION_PAGE * FLASH_PAGE_SIZE) - -/* DTB Region */ -#define DTB_FLASH_REGION_PAGES (DTB_IMAGE_PAGES) -#define DTB_FLASH_REGION_START (PARTITION_TABLE_REGION_START + PARTITION_TABLE_REGION_LENGTH) -#define DTB_FLASH_REGION_LENGTH (DTB_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* RECOVERY Region */ -#define RECOVERY_FLASH_REGION_PAGES (RECOVERY_IMAGE_PAGES) -#define RECOVERY_FLASH_REGION_START (DTB_FLASH_REGION_START + DTB_FLASH_REGION_LENGTH) -#define RECOVERY_FLASH_REGION_LENGTH (RECOVERY_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define RECOVERY_VECTORS_LOAD_ORIGIN (RECOVERY_FLASH_REGION_START) -#define RECOVERY_VERSION_LOAD_ORIGIN (RECOVERY_VECTORS_LOAD_ORIGIN + BT_VECTORS_LENGTH) -#define RECOVERY_CHANGEID_LOAD_ORIGIN (RECOVERY_VERSION_LOAD_ORIGIN + VERSION_LENGTH) - -#define RECOVERY_PROGRAM_ORIGIN (RECOVERY_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define RECOVERY_PROGRAM_LENGTH ((RECOVERY_FLASH_REGION_LENGTH) - \ - (BT_VECTORS_LENGTH + VERSION_LENGTH + CHANGE_ID_LENGTH)) - -/* RESERVE Region */ -#define RESERVE_FLASH_REGION_PAGES (RESERVE_IMAGE_PAGES) -#define RESERVE_FLASH_REGION_START (RECOVERY_FLASH_REGION_START + RECOVERY_FLASH_REGION_LENGTH) -#define RESERVE_FLASH_REGION_LENGTH (RESERVE_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* BT Region */ -#define BT_FLASH_REGION_PAGES (BT_IMAGE_PAGES) -#define BT_FLASH_REGION_START (RESERVE_FLASH_REGION_START + RESERVE_FLASH_REGION_LENGTH) -#define BT_FLASH_REGION_LENGTH (BT_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define BT_BUILD_INFO_ORIGIN (BT_FLASH_REGION_START) -#define BT_VECTORS_LOAD_ORIGIN (BT_BUILD_INFO_ORIGIN + BUILD_INFO_LENGRH) -#define BT_VERSION_LOAD_ORIGIN (BT_VECTORS_LOAD_ORIGIN + BT_VECTORS_LENGTH) -#define BT_CHANGEID_LOAD_ORIGIN (BT_VERSION_LOAD_ORIGIN + VERSION_LENGTH) -#define DSP_CHANGEID_LOAD_ORIGIN (BT_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) - -/* Fill 4 byte to align flash 8 byte */ -#define BT_PROGRAM_ORIGIN (DSP_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define BT_PROGRAM_LENGTH ((BT_FLASH_REGION_LENGTH) - (BT_VECTORS_LENGTH + \ - VERSION_LENGTH + CHANGE_ID_LENGTH + CHANGE_ID_LENGTH)) - -/* DSP Region */ -#define DSP_FLASH_REGION_PAGES (HIFI0_IMAGE_PAGES) -#define DSP_FLASH_REGION_START (BT_FLASH_REGION_START + BT_FLASH_REGION_LENGTH) -#define DSP_FLASH_REGION_LENGTH (DSP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* DSP1 Region */ -#define DSP_CODEC_FLASH_REGION_PAGES (HIFI0_CODEC_PAGES) -#define DSP_CODEC_FLASH_REGION_START (DSP_FLASH_REGION_START + DSP_FLASH_REGION_LENGTH) -#define DSP_CODEC_FLASH_REGION_LENGTH (DSP_CODEC_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* APP Region */ -#define APP_FLASH_REGION_PAGES (APP_IMAGE_PAGES) -#define APP_FLASH_REGION_START (DSP_CODEC_FLASH_REGION_START + DSP_CODEC_FLASH_REGION_LENGTH) -#define APP_FLASH_REGION_LENGTH (APP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* NV data Region */ -#define NV_FLASH_REGION_PAGES (NV_IMAGE_PAGES) -#define NV_FLASH_REGION_START (APP_FLASH_REGION_START + APP_FLASH_REGION_LENGTH) -#define NV_FLASH_REGION_LENGTH (NV_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* Fota data Region */ -#define FOTA_FLASH_REGION_PAGES (FOTA_IMAGE_PAGES) -#define FOTA_FLASH_REGION_START (NV_FLASH_REGION_START + NV_FLASH_REGION_LENGTH) -#define FOTA_FLASH_REGION_LENGTH (FOTA_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define APP_VECTORS_LOAD_ORIGIN (APP_FLASH_REGION_START) -#define APP_VERSION_LOAD_ORIGIN (APP_VECTORS_LOAD_ORIGIN + APP_VECTORS_LENGTH) - -#define APP_PROGRAM_ORIGIN (APP_VERSION_LOAD_ORIGIN + VERSION_LENGTH) -#define APP_PROGRAM_LENGTH ((APP_FLASH_REGION_LENGTH) - (APP_VECTORS_LENGTH + VERSION_LENGTH)) - -/* cores image flash region start */ -#define FLASH_CORE_IMAGES_START (FLASH_START + SSB_FLASH_REGION_LENGTH + SSB_BACKUP_FLASH_REGION_LENGTH + \ - SEC_BOOT_FLASH_REGION_LENGTH + \ - KV_PAGES * FLASH_PAGE_SIZE + PARTITION_TABLE_REGION_LENGTH) -/* ----------------------------------------------------------------------------------------------------------------- */ -/* KV Region Defines */ -/* Minimum System Configuration pages in FLASH reserved */ -#define SYSTEM_RESERVED_FLASH_PAGES 0 -/* Minimum reserved Non Volatile storage + Config Data. */ -#define FLASH_RESERVED_LENGTH (SYSTEM_RESERVED_FLASH_PAGES * FLASH_PAGE_SIZE) - -/* - * ********************* SEC BOOT REGION ********************* - */ -#define MCU_ROOT_PUBKEY_START SEC_BOOT_FLASH_REGION_START -#define MCU_SUB_PUBKEY_START (MCU_ROOT_PUBKEY_START + FLASH_PAGE_SIZE) -#define MCU_SSB_IMAGE_SIGN_START (MCU_SUB_PUBKEY_START + FLASH_PAGE_SIZE) -#define MCU_SUB_PUBKEY_BACKUP_START (MCU_SSB_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_SSB_IMAGE_SIGN_BACKUP_START (MCU_SUB_PUBKEY_BACKUP_START + FLASH_PAGE_SIZE) - -#define MCU_SEC_BOOT_SIGN_BACKUP_START MCU_SUB_PUBKEY_BACKUP_START -#define MCU_SEC_BOOT_SIGN_BACKUP_LEN (2 * FLASH_PAGE_SIZE) - -#define MCU_CFCT_START (MCU_SEC_BOOT_SIGN_BACKUP_START + MCU_SEC_BOOT_SIGN_BACKUP_LEN) -#define MCU_CFCT_LEN FLASH_PAGE_SIZE - -#define MCU_RECOVERY_IMAGE_SIGN_START (MCU_CFCT_START + MCU_CFCT_LEN) -#define MCU_BT_IMAGE_SIGN_START (MCU_RECOVERY_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_DSP_IMAGE_SIGN_START (MCU_BT_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_DSP1_IMAGE_SIGN_START (MCU_DSP_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_APP_IMAGE_SIGN_START (MCU_DSP1_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_PARTITION_TABLE_SIGN_START (MCU_APP_IMAGE_SIGN_START + FLASH_PAGE_SIZE) diff --git a/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_8M.h b/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_8M.h deleted file mode 100644 index 9729162ff..000000000 --- a/code/sdk/drivers/boards/brandy_evb/memory_config/include/flash_8M.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) @CompanyNameMagicTag 2021-2022. All rights reserved. - * Description: Default memory configurations - * Author: @CompanyNameTag - * Create: 2022-03-09 - */ - -#ifndef FLASH_8M_H -#define FLASH_8M_H - -/* - * ********************* FLASH ALLOCATION ********************* - * Flash is shared between the cores, and also handles a limited number of - * non-volatile storage areas. - * - * Flash is split into 2 main areas - * IMAGE Area - * Managed by the BT core - * This contains, in order from the bottom of Flash: - * SSB - SSB image starting at the bottom of flash. Variable size depending on the SSB on the chip that - * the package is loaded on. The values in this file only apply to the SSB built with this file. - * RECOVERY_Image - starts in the page after the SSB. - * BT_Image - starts in the page after the RECOVERY_Image - * DSP_Image - starts in the page after the BT_Image - * APP_Image - starts in the page after the DSP_Image - * System On-demand region - dynamically allocated flash for FOTA etc - * NV Area - * Ends at the last page of flash, is configurable in size above a minimum allocation. - * NV Area, of 12 pages, is allocated, from the lowest address: - * 8 pages of general use (pages are not fixed and self-identifying), consisting of - * 1 Page for Asset Store defragmentation - * 3 pages for Asset Store - * 2 Pages for App and DSP Core KV defragmentation - * 1 page for DSP Core KV - * 1 page for App Core KV - * 2 pages for BT core use (last 2 pages in Flash) - * 1 page for BT Core KV - * 1 page for BT Core KV defragmentation - */ - -#define FLASH_START 0x70000000 -#define FLASH_LENGTH 0x800000 -#define FLASH_MAX_END (FLASH_START + FLASH_LENGTH) - -#define FLASH_PAGE_SIZE 4096 -/* APP ITCM config */ -#define MCU_ITCM_END (APP_ITCM_ORIGIN + APP_ITCM_LENGTH) - -#define SSB_BOOT_RAM_ORIGIN APP_ITCM_ORIGIN -#define SSB_BOOT_RAM_LENGTH APP_ITCM_LENGTH - -/* ----------------------------------------------------------------------------------------------------------------- */ -/* IMAGE Area Defines */ -/* MCU SSB Region */ -#define SSB_FLASH_REGION_PAGES (SSB_IMAGE_PAGES + 5) -#define KV_PAGES 0 -#define SSB_FLASH_REGION_START (FLASH_START) -#define SSB_FLASH_REGION_LENGTH (SSB_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define SSB_VECTORS_LOAD_ORIGIN (SSB_FLASH_REGION_START) -#define SSB_VERSION_LOAD_ORIGIN (SSB_VECTORS_LOAD_ORIGIN + APP_VECTORS_LENGTH) -#define SSB_CHANGEID_LOAD_ORIGIN (SSB_VERSION_LOAD_ORIGIN + VERSION_LENGTH) - -#define SSB_PROGRAM_ORIGIN (SSB_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define SSB_PROGRAM_LENGTH ((SSB_FLASH_REGION_LENGTH) - (APP_VECTORS_LENGTH + VERSION_LENGTH + CHANGE_ID_LENGTH)) - -/* MCU SSB BACK-UP Region */ -#define SSB_BACKUP_FLASH_REGION_PAGES 32 -#define SSB_BACKUP_FLASH_REGION_START (SSB_FLASH_REGION_START + SSB_FLASH_REGION_LENGTH + KV_PAGES * FLASH_PAGE_SIZE) -#define SSB_BACKUP_FLASH_REGION_LENGTH (SSB_BACKUP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* SEC_BOOT Region for Signature Certificate */ -#define SEC_BOOT_FLASH_REGION_PAGES 15 -#define SEC_BOOT_FLASH_REGION_START (SSB_BACKUP_FLASH_REGION_START + SSB_BACKUP_FLASH_REGION_LENGTH) -#define SEC_BOOT_FLASH_REGION_LENGTH (SEC_BOOT_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define PARTITION_TABLE_REGSION_PAGE 1 -#define PARTITION_TABLE_REGION_START (SEC_BOOT_FLASH_REGION_START + SEC_BOOT_FLASH_REGION_LENGTH) -#define PARTITION_TABLE_REGION_LENGTH (PARTITION_TABLE_REGSION_PAGE * FLASH_PAGE_SIZE) - -/* DTB Region */ -#define DTB_FLASH_REGION_PAGES (DTB_IMAGE_PAGES) -#define DTB_FLASH_REGION_START (PARTITION_TABLE_REGION_START + PARTITION_TABLE_REGION_LENGTH) -#define DTB_FLASH_REGION_LENGTH (DTB_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* RECOVERY Region */ -#define RECOVERY_FLASH_REGION_PAGES (RECOVERY_IMAGE_PAGES) -#define RECOVERY_FLASH_REGION_START (DTB_FLASH_REGION_START + DTB_FLASH_REGION_LENGTH) -#define RECOVERY_FLASH_REGION_LENGTH (RECOVERY_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define RECOVERY_VECTORS_LOAD_ORIGIN (RECOVERY_FLASH_REGION_START) -#define RECOVERY_VERSION_LOAD_ORIGIN (RECOVERY_VECTORS_LOAD_ORIGIN + BT_VECTORS_LENGTH) -#define RECOVERY_CHANGEID_LOAD_ORIGIN (RECOVERY_VERSION_LOAD_ORIGIN + VERSION_LENGTH) - -#define RECOVERY_PROGRAM_ORIGIN (RECOVERY_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define RECOVERY_PROGRAM_LENGTH ((RECOVERY_FLASH_REGION_LENGTH) - \ - (BT_VECTORS_LENGTH + VERSION_LENGTH + CHANGE_ID_LENGTH)) - -/* RESERVE Region */ -#define RESERVE_FLASH_REGION_PAGES (RESERVE_IMAGE_PAGES) -#define RESERVE_FLASH_REGION_START (RECOVERY_FLASH_REGION_START + RECOVERY_FLASH_REGION_LENGTH) -#define RESERVE_FLASH_REGION_LENGTH (RESERVE_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* BT Region */ -#define BT_FLASH_REGION_PAGES (BT_IMAGE_PAGES) -#define BT_FLASH_REGION_START (RESERVE_FLASH_REGION_START + RESERVE_FLASH_REGION_LENGTH) -#define BT_FLASH_REGION_LENGTH (BT_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define BT_BUILD_INFO_ORIGIN (BT_FLASH_REGION_START) -#define BT_VECTORS_LOAD_ORIGIN (BT_BUILD_INFO_ORIGIN + BUILD_INFO_LENGRH) -#define BT_VERSION_LOAD_ORIGIN (BT_VECTORS_LOAD_ORIGIN + BT_VECTORS_LENGTH) -#define BT_CHANGEID_LOAD_ORIGIN (BT_VERSION_LOAD_ORIGIN + VERSION_LENGTH) -#define DSP_CHANGEID_LOAD_ORIGIN (BT_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) - -/* Fill 4 byte to align flash 8 byte */ -#define BT_PROGRAM_ORIGIN (DSP_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) -#define BT_PROGRAM_LENGTH ((BT_FLASH_REGION_LENGTH) - (BT_VECTORS_LENGTH + \ - VERSION_LENGTH + CHANGE_ID_LENGTH + CHANGE_ID_LENGTH)) - -/* DSP Region */ -#define DSP_FLASH_REGION_PAGES (HIFI0_IMAGE_PAGES) -#define DSP_FLASH_REGION_START (BT_FLASH_REGION_START + BT_FLASH_REGION_LENGTH) -#define DSP_FLASH_REGION_LENGTH (DSP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* DSP1 Region */ -#define DSP_CODEC_FLASH_REGION_PAGES (HIFI0_CODEC_PAGES) -#define DSP_CODEC_FLASH_REGION_START (DSP_FLASH_REGION_START + DSP_FLASH_REGION_LENGTH) -#define DSP_CODEC_FLASH_REGION_LENGTH (DSP_CODEC_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* APP Region */ -#define APP_FLASH_REGION_PAGES (APP_IMAGE_PAGES) -#define APP_FLASH_REGION_START (DSP_CODEC_FLASH_REGION_START + DSP_CODEC_FLASH_REGION_LENGTH) -#define APP_FLASH_REGION_LENGTH (APP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* NV data Region */ -#define NV_FLASH_REGION_PAGES (NV_IMAGE_PAGES) -#define NV_FLASH_REGION_START (APP_FLASH_REGION_START + APP_FLASH_REGION_LENGTH) -#define NV_FLASH_REGION_LENGTH (NV_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -/* Fota data Region */ -#define FOTA_FLASH_REGION_PAGES (FOTA_IMAGE_PAGES) -#define FOTA_FLASH_REGION_START (NV_FLASH_REGION_START + NV_FLASH_REGION_LENGTH) -#define FOTA_FLASH_REGION_LENGTH (FOTA_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) - -#define APP_VECTORS_LOAD_ORIGIN (APP_FLASH_REGION_START) -#define APP_VERSION_LOAD_ORIGIN (APP_VECTORS_LOAD_ORIGIN + APP_VECTORS_LENGTH) - -#define APP_PROGRAM_ORIGIN (APP_VERSION_LOAD_ORIGIN + VERSION_LENGTH) -#define APP_PROGRAM_LENGTH ((APP_FLASH_REGION_LENGTH) - (APP_VECTORS_LENGTH + VERSION_LENGTH)) - -/* cores image flash region start */ -#define FLASH_CORE_IMAGES_START (FLASH_START + SSB_FLASH_REGION_LENGTH + SSB_BACKUP_FLASH_REGION_LENGTH + \ - SEC_BOOT_FLASH_REGION_LENGTH + \ - KV_PAGES * FLASH_PAGE_SIZE + PARTITION_TABLE_REGION_LENGTH) -/* ----------------------------------------------------------------------------------------------------------------- */ -/* KV Region Defines */ -/* Minimum System Configuration pages in FLASH reserved */ -#define SYSTEM_RESERVED_FLASH_PAGES 0 -/* Minimum reserved Non Volatile storage + Config Data. */ -#define FLASH_RESERVED_LENGTH (SYSTEM_RESERVED_FLASH_PAGES * FLASH_PAGE_SIZE) - -/* - * ********************* SEC BOOT REGION ********************* - */ -#define MCU_ROOT_PUBKEY_START SEC_BOOT_FLASH_REGION_START -#define MCU_SUB_PUBKEY_START (MCU_ROOT_PUBKEY_START + FLASH_PAGE_SIZE) -#define MCU_SSB_IMAGE_SIGN_START (MCU_SUB_PUBKEY_START + FLASH_PAGE_SIZE) -#define MCU_SUB_PUBKEY_BACKUP_START (MCU_SSB_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_SSB_IMAGE_SIGN_BACKUP_START (MCU_SUB_PUBKEY_BACKUP_START + FLASH_PAGE_SIZE) - -#define MCU_SEC_BOOT_SIGN_BACKUP_START MCU_SUB_PUBKEY_BACKUP_START -#define MCU_SEC_BOOT_SIGN_BACKUP_LEN (2 * FLASH_PAGE_SIZE) - -#define MCU_CFCT_START (MCU_SEC_BOOT_SIGN_BACKUP_START + MCU_SEC_BOOT_SIGN_BACKUP_LEN) -#define MCU_CFCT_LEN FLASH_PAGE_SIZE - -#define MCU_RECOVERY_IMAGE_SIGN_START (MCU_CFCT_START + MCU_CFCT_LEN) -#define MCU_BT_IMAGE_SIGN_START (MCU_RECOVERY_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_DSP_IMAGE_SIGN_START (MCU_BT_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_DSP1_IMAGE_SIGN_START (MCU_DSP_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_APP_IMAGE_SIGN_START (MCU_DSP1_IMAGE_SIGN_START + FLASH_PAGE_SIZE) -#define MCU_PARTITION_TABLE_SIGN_START (MCU_APP_IMAGE_SIGN_START + FLASH_PAGE_SIZE) - -#endif \ No newline at end of file diff --git a/code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config_common.h b/code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config_common.h index 64bd965cb..3edc736bf 100755 --- a/code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config_common.h +++ b/code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config_common.h @@ -127,23 +127,177 @@ #endif /* - * norflash 分区修改会导致已商用版本OTA失败,此处修改需谨慎 - * norflash修改请同时修改以下文件: - * 分区表配置: - * 16M:build\config\target_config\brandy\param_sector\param_sector_16M.json - * 8M:build\config\target_config\brandy\param_sector\param_sector.json - * 打包脚本: - * tools\pkg\chip_packet\brandy\packet.py -*/ -#if defined(CFG_FLASH_SIZE) && (CFG_FLASH_SIZE == 16) -#ifdef FD230 -#include "flash_16M_FD230.h" -#else -#include "flash_16M.h" -#endif -#else -#include "flash_8M.h" -#endif + * ********************* FLASH ALLOCATION ********************* + * Flash is shared between the cores, and also handles a limited number of + * non-volatile storage areas. + * + * Flash is split into 2 main areas + * IMAGE Area + * Managed by the BT core + * This contains, in order from the bottom of Flash: + * SSB - SSB image starting at the bottom of flash. Variable size depending on the SSB on the chip that + * the package is loaded on. The values in this file only apply to the SSB built with this file. + * RECOVERY_Image - starts in the page after the SSB. + * BT_Image - starts in the page after the RECOVERY_Image + * DSP_Image - starts in the page after the BT_Image + * APP_Image - starts in the page after the DSP_Image + * System On-demand region - dynamically allocated flash for FOTA etc + * NV Area + * Ends at the last page of flash, is configurable in size above a minimum allocation. + * NV Area, of 12 pages, is allocated, from the lowest address: + * 8 pages of general use (pages are not fixed and self-identifying), consisting of + * 1 Page for Asset Store defragmentation + * 3 pages for Asset Store + * 2 Pages for App and DSP Core KV defragmentation + * 1 page for DSP Core KV + * 1 page for App Core KV + * 2 pages for BT core use (last 2 pages in Flash) + * 1 page for BT Core KV + * 1 page for BT Core KV defragmentation + */ + +#define FLASH_START 0x70000000 +#define FLASH_LENGTH 0x1000000 +#define FLASH_MAX_END (FLASH_START + FLASH_LENGTH) + +#define FLASH_PAGE_SIZE 4096 +/* APP ITCM config */ +#define MCU_ITCM_END (APP_ITCM_ORIGIN + APP_ITCM_LENGTH) + +#define SSB_BOOT_RAM_ORIGIN APP_ITCM_ORIGIN +#define SSB_BOOT_RAM_LENGTH APP_ITCM_LENGTH + +/* ----------------------------------------------------------------------------------------------------------------- */ +/* IMAGE Area Defines */ +/* MCU SSB Region */ +#define SSB_FLASH_REGION_PAGES (SSB_IMAGE_PAGES + 5) +#define KV_PAGES 0 +#define SSB_FLASH_REGION_START (FLASH_START) +#define SSB_FLASH_REGION_LENGTH (SSB_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +#define SSB_VECTORS_LOAD_ORIGIN (SSB_FLASH_REGION_START) +#define SSB_VERSION_LOAD_ORIGIN (SSB_VECTORS_LOAD_ORIGIN + APP_VECTORS_LENGTH) +#define SSB_CHANGEID_LOAD_ORIGIN (SSB_VERSION_LOAD_ORIGIN + VERSION_LENGTH) + +#define SSB_PROGRAM_ORIGIN (SSB_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) +#define SSB_PROGRAM_LENGTH ((SSB_FLASH_REGION_LENGTH) - (APP_VECTORS_LENGTH + VERSION_LENGTH + CHANGE_ID_LENGTH)) + +/* MCU SSB BACK-UP Region */ +#define SSB_BACKUP_FLASH_REGION_PAGES 32 +#define SSB_BACKUP_FLASH_REGION_START (SSB_FLASH_REGION_START + SSB_FLASH_REGION_LENGTH + KV_PAGES * FLASH_PAGE_SIZE) +#define SSB_BACKUP_FLASH_REGION_LENGTH (SSB_BACKUP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +/* SEC_BOOT Region for Signature Certificate */ +#define SEC_BOOT_FLASH_REGION_PAGES 15 +#define SEC_BOOT_FLASH_REGION_START (SSB_BACKUP_FLASH_REGION_START + SSB_BACKUP_FLASH_REGION_LENGTH) +#define SEC_BOOT_FLASH_REGION_LENGTH (SEC_BOOT_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +#define PARTITION_TABLE_REGSION_PAGE 1 +#define PARTITION_TABLE_REGION_START (SEC_BOOT_FLASH_REGION_START + SEC_BOOT_FLASH_REGION_LENGTH) +#define PARTITION_TABLE_REGION_LENGTH (PARTITION_TABLE_REGSION_PAGE * FLASH_PAGE_SIZE) + +/* DTB Region */ +#define DTB_FLASH_REGION_PAGES (DTB_IMAGE_PAGES) +#define DTB_FLASH_REGION_START (PARTITION_TABLE_REGION_START + PARTITION_TABLE_REGION_LENGTH) +#define DTB_FLASH_REGION_LENGTH (DTB_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +/* RECOVERY Region */ +#define RECOVERY_FLASH_REGION_PAGES (RECOVERY_IMAGE_PAGES) +#define RECOVERY_FLASH_REGION_START (DTB_FLASH_REGION_START + DTB_FLASH_REGION_LENGTH) +#define RECOVERY_FLASH_REGION_LENGTH (RECOVERY_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +#define RECOVERY_VECTORS_LOAD_ORIGIN (RECOVERY_FLASH_REGION_START) +#define RECOVERY_VERSION_LOAD_ORIGIN (RECOVERY_VECTORS_LOAD_ORIGIN + BT_VECTORS_LENGTH) +#define RECOVERY_CHANGEID_LOAD_ORIGIN (RECOVERY_VERSION_LOAD_ORIGIN + VERSION_LENGTH) + +#define RECOVERY_PROGRAM_ORIGIN (RECOVERY_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) +#define RECOVERY_PROGRAM_LENGTH ((RECOVERY_FLASH_REGION_LENGTH) - \ + (BT_VECTORS_LENGTH + VERSION_LENGTH + CHANGE_ID_LENGTH)) + +/* RESERVE Region */ +#define RESERVE_FLASH_REGION_PAGES (RESERVE_IMAGE_PAGES) +#define RESERVE_FLASH_REGION_START (RECOVERY_FLASH_REGION_START + RECOVERY_FLASH_REGION_LENGTH) +#define RESERVE_FLASH_REGION_LENGTH (RESERVE_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +/* BT Region */ +#define BT_FLASH_REGION_PAGES (BT_IMAGE_PAGES) +#define BT_FLASH_REGION_START (RESERVE_FLASH_REGION_START + RESERVE_FLASH_REGION_LENGTH) +#define BT_FLASH_REGION_LENGTH (BT_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +#define BT_BUILD_INFO_ORIGIN (BT_FLASH_REGION_START) +#define BT_VECTORS_LOAD_ORIGIN (BT_BUILD_INFO_ORIGIN + BUILD_INFO_LENGRH) +#define BT_VERSION_LOAD_ORIGIN (BT_VECTORS_LOAD_ORIGIN + BT_VECTORS_LENGTH) +#define BT_CHANGEID_LOAD_ORIGIN (BT_VERSION_LOAD_ORIGIN + VERSION_LENGTH) +#define DSP_CHANGEID_LOAD_ORIGIN (BT_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) + +/* Fill 4 byte to align flash 8 byte */ +#define BT_PROGRAM_ORIGIN (DSP_CHANGEID_LOAD_ORIGIN + CHANGE_ID_LENGTH) +#define BT_PROGRAM_LENGTH ((BT_FLASH_REGION_LENGTH) - (BT_VECTORS_LENGTH + \ + VERSION_LENGTH + CHANGE_ID_LENGTH + CHANGE_ID_LENGTH)) + +/* DSP Region */ +#define DSP_FLASH_REGION_PAGES (HIFI0_IMAGE_PAGES) +#define DSP_FLASH_REGION_START (BT_FLASH_REGION_START + BT_FLASH_REGION_LENGTH) +#define DSP_FLASH_REGION_LENGTH (DSP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +/* DSP1 Region */ +#define DSP_CODEC_FLASH_REGION_PAGES (HIFI0_CODEC_PAGES) +#define DSP_CODEC_FLASH_REGION_START (DSP_FLASH_REGION_START + DSP_FLASH_REGION_LENGTH) +#define DSP_CODEC_FLASH_REGION_LENGTH (DSP_CODEC_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +/* APP Region */ +#define APP_FLASH_REGION_PAGES (APP_IMAGE_PAGES) +#define APP_FLASH_REGION_START (DSP_CODEC_FLASH_REGION_START + DSP_CODEC_FLASH_REGION_LENGTH) +#define APP_FLASH_REGION_LENGTH (APP_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +/* NV data Region */ +#define NV_FLASH_REGION_PAGES (NV_IMAGE_PAGES) +#define NV_FLASH_REGION_START (APP_FLASH_REGION_START + APP_FLASH_REGION_LENGTH) +#define NV_FLASH_REGION_LENGTH (NV_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +/* Fota data Region */ +#define FOTA_FLASH_REGION_PAGES (FOTA_IMAGE_PAGES) +#define FOTA_FLASH_REGION_START (NV_FLASH_REGION_START + NV_FLASH_REGION_LENGTH) +#define FOTA_FLASH_REGION_LENGTH (FOTA_FLASH_REGION_PAGES * FLASH_PAGE_SIZE) + +#define APP_VECTORS_LOAD_ORIGIN (APP_FLASH_REGION_START) +#define APP_VERSION_LOAD_ORIGIN (APP_VECTORS_LOAD_ORIGIN + APP_VECTORS_LENGTH) + +#define APP_PROGRAM_ORIGIN (APP_VERSION_LOAD_ORIGIN + VERSION_LENGTH) +#define APP_PROGRAM_LENGTH ((APP_FLASH_REGION_LENGTH) - (APP_VECTORS_LENGTH + VERSION_LENGTH)) + +/* cores image flash region start */ +#define FLASH_CORE_IMAGES_START (FLASH_START + SSB_FLASH_REGION_LENGTH + SSB_BACKUP_FLASH_REGION_LENGTH + \ + SEC_BOOT_FLASH_REGION_LENGTH + \ + KV_PAGES * FLASH_PAGE_SIZE + PARTITION_TABLE_REGION_LENGTH) +/* ----------------------------------------------------------------------------------------------------------------- */ +/* KV Region Defines */ +/* Minimum System Configuration pages in FLASH reserved */ +#define SYSTEM_RESERVED_FLASH_PAGES 0 +/* Minimum reserved Non Volatile storage + Config Data. */ +#define FLASH_RESERVED_LENGTH (SYSTEM_RESERVED_FLASH_PAGES * FLASH_PAGE_SIZE) + +/* + * ********************* SEC BOOT REGION ********************* + */ +#define MCU_ROOT_PUBKEY_START SEC_BOOT_FLASH_REGION_START +#define MCU_SUB_PUBKEY_START (MCU_ROOT_PUBKEY_START + FLASH_PAGE_SIZE) +#define MCU_SSB_IMAGE_SIGN_START (MCU_SUB_PUBKEY_START + FLASH_PAGE_SIZE) +#define MCU_SUB_PUBKEY_BACKUP_START (MCU_SSB_IMAGE_SIGN_START + FLASH_PAGE_SIZE) +#define MCU_SSB_IMAGE_SIGN_BACKUP_START (MCU_SUB_PUBKEY_BACKUP_START + FLASH_PAGE_SIZE) + +#define MCU_SEC_BOOT_SIGN_BACKUP_START MCU_SUB_PUBKEY_BACKUP_START +#define MCU_SEC_BOOT_SIGN_BACKUP_LEN (2 * FLASH_PAGE_SIZE) + +#define MCU_CFCT_START (MCU_SEC_BOOT_SIGN_BACKUP_START + MCU_SEC_BOOT_SIGN_BACKUP_LEN) +#define MCU_CFCT_LEN FLASH_PAGE_SIZE + +#define MCU_RECOVERY_IMAGE_SIGN_START (MCU_CFCT_START + MCU_CFCT_LEN) +#define MCU_BT_IMAGE_SIGN_START (MCU_RECOVERY_IMAGE_SIGN_START + FLASH_PAGE_SIZE) +#define MCU_DSP_IMAGE_SIGN_START (MCU_BT_IMAGE_SIGN_START + FLASH_PAGE_SIZE) +#define MCU_DSP1_IMAGE_SIGN_START (MCU_DSP_IMAGE_SIGN_START + FLASH_PAGE_SIZE) +#define MCU_APP_IMAGE_SIGN_START (MCU_DSP1_IMAGE_SIGN_START + FLASH_PAGE_SIZE) +#define MCU_PARTITION_TABLE_SIGN_START (MCU_APP_IMAGE_SIGN_START + FLASH_PAGE_SIZE) /* * ********************* RAM ALLOCATION ********************* diff --git a/code/sdk/drivers/boards/brandy_evb/product/product_evb4_standard.h b/code/sdk/drivers/boards/brandy_evb/product/product_evb4_standard.h index c03c298f0..346c47a03 100755 --- a/code/sdk/drivers/boards/brandy_evb/product/product_evb4_standard.h +++ b/code/sdk/drivers/boards/brandy_evb/product/product_evb4_standard.h @@ -25,8 +25,6 @@ #else #define ENABLE_LOW_POWER NO #endif -#if defined(CFG_FLASH_SIZE) && (CFG_FLASH_SIZE == 16) -#ifdef FD230 #define DTB_IMAGE_PAGES 0 #define RECOVERY_IMAGE_PAGES 64 #define RESERVE_IMAGE_PAGES 0 @@ -34,24 +32,6 @@ #define HIFI0_IMAGE_PAGES 112 #define HIFI0_CODEC_PAGES 320 #define APP_IMAGE_PAGES 3401 -#else -#define DTB_IMAGE_PAGES 0 -#define RECOVERY_IMAGE_PAGES 256 -#define RESERVE_IMAGE_PAGES 64 -#define BT_IMAGE_PAGES 112 -#define HIFI0_IMAGE_PAGES 192 -#define HIFI0_CODEC_PAGES 448 -#define APP_IMAGE_PAGES 2048 -#endif -#else -#define DTB_IMAGE_PAGES 0 -#define RECOVERY_IMAGE_PAGES 64 -#define RESERVE_IMAGE_PAGES 0 -#define BT_IMAGE_PAGES 112 -#define HIFI0_IMAGE_PAGES 112 -#define HIFI0_CODEC_PAGES 320 -#define APP_IMAGE_PAGES 1353 -#endif #define NV_IMAGE_PAGES 4 #define FOTA_IMAGE_PAGES 3 #define FOTA_IMAGE_START 0x770000 //其他产品,未用到 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..27ce6ab39 100755 --- a/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c +++ b/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c @@ -42,14 +42,13 @@ 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; 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; + g_pre_systick_count = uapi_systick_get_count(); + g_pre_systick_msec = (g_pre_systick_count * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ; } 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 - g_pre_systick_count) * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ; g_pre_systick_count = now_count; g_pre_systick_msec = g_pre_systick_msec + cost_msec; diff --git a/code/sdk/drivers/drivers/driver/button/button.c b/code/sdk/drivers/drivers/driver/button/button.c deleted file mode 100644 index 6e0fb2a0c..000000000 --- a/code/sdk/drivers/drivers/driver/button/button.c +++ /dev/null @@ -1,359 +0,0 @@ -/** - * Copyright (c) @CompanyNameMagicTag 2023-2023. All rights reserved. \n - * - * Description: Button driver source file \n - * Author: @CompanyNameTag \n - * History: \n - * 2023-02-24, Create file. \n - */ - -#include "pinctrl.h" -#include "button_porting.h" -#include "platform_core.h" -#include "gpio.h" -#include "gpio_porting.h" -#include "debug_print.h" -#include "rtc.h" -#include "timer.h" -#include "systick.h" -#include "chip_core_irq.h" - -#define BUTTON_PWREN_ID 1 -/** - * @if Eng - * @brief Button debounce struct - * @else - * @brief 按键去抖动结构体定义 - * @endif - */ -typedef struct { - uint8_t debounced; /*!< @if Eng Recording debounced group. - @else 记录产生抖动的按键组 @endif */ - uint32_t debounced_time; /*!< @if Eng Debounced time. - @else 抖动计时 @endif */ -} button_debounced_t; - -/** - * @if Eng - * @brief Button information struct - * @else - * @brief 按键信息结构体定义 - * @endif - */ -typedef struct { - uint8_t pressed_group; /*!< @if Eng Recording button pressed group. - @else 记录被按下的按键组 @endif */ - uint8_t which_pressed; /*!< @if Eng Pressed button bit turns to 1 - @else 被按下的按键置1 @endif */ - uint8_t which_released; /*!< @if Eng Releaesd button bit turns to 1 - @else 被松开的按键置1 @endif */ -} button_info_t; - -button_debounced_t g_button_debounced = {0}; -button_map_t g_button_pin_map[BUTTON_PIN_MAP_MAX] = {0}; -timer_handle_t g_button_timer = {0}; -timer_handle_t g_gpio_button_timer = {0}; -button_info_t g_button_info = {0}; -bool g_timer_is_running = false; -bool g_gpio_timer_is_running = false; -msg_send_callback_t g_msg_send_cb = NULL; - -static const char* g_state_str[PRESSED_MAX] = { - "BUTTON_PRESSED", - "BUTTON_RESLASED", -}; - -static void button_debounced_timer_callback(uint32_t data); -static void button_check_released_timer_callback(uint32_t data); - -void button_group_set_bit(uint8_t* group, uint8_t bit) -{ - (*group) |= (1 << bit); -} - -static void button_group_clear_bit(uint8_t* group, uint8_t bit) -{ - (*group) &= ~(1 << bit); -} - -static button_press_state_t button_get_press_state(pin_t pin) -{ - button_peripheral_api *button_api = button_port_get_api(); - return button_api->button_get_state(pin); -} - -static bool button_group_find_bit(uint8_t group, uint8_t* bit) -{ - if (bit == NULL) { - return false; - } - for (uint8_t i = 0; i < BUTTON_PIN_MAP_MAX; i++) { - if ((group & (1 << i)) != 0) { - *bit = i; - return true; - } - } - return false; -} - -static void button_send_msg(uint8_t pin_group, button_press_state_t state) -{ - if (g_msg_send_cb == NULL) { - PRINT("button %d is %s\r\n", pin_group, g_state_str[state]); - } else { - g_msg_send_cb(pin_group, state); - } -} - -static void button_timer_start(void) -{ - bool start = false; - if (!g_gpio_timer_is_running) { - g_gpio_timer_is_running = true; - start = true; - } - - if (start) { - uapi_rtc_stop(g_gpio_button_timer); - uapi_rtc_start(g_gpio_button_timer, BUTTON_TIMER_INTERVAL, button_debounced_timer_callback, 0); - } -} - -static void button_timer_start_check_released(void) -{ - bool start = false; - if (!g_timer_is_running) { - g_timer_is_running = true; - start = true; - } - - if (start) { - uapi_rtc_stop(g_button_timer); - uapi_rtc_start(g_button_timer, BUTTON_CHECK_RELEADSED, button_check_released_timer_callback, 0); - } -} - -static void button_irq_callback(pin_t pin) -{ - pin = PIN_NONE; - uapi_ulp_wkup_type_record(); - button_peripheral_api *button_api = button_port_get_api(); - // if not vbus or pwren interrupt return - if (button_api->button_check_interrupt(pin) == false) { - button_api->button_clear_interrupt(pin); - return; - } - // deal with vbus interrupt - if (button_api->button_check_vbus_interrupt()) { - button_api->button_deal_vbus_event(); - button_api->button_clear_interrupt(pin); - return; - } - - // deal with pwren interrupt - button_api->button_clear_interrupt(pin); - button_press_state_t press_state = button_get_press_state(pin); - button_send_msg(BUTTON_PWREN_ID, press_state); - button_api->button_add_veto(); - button_timer_start_check_released(); -} - -static void button_gpio_callback(pin_t pin, uintptr_t param) -{ - unused(param); - uint8_t bit = 0; - for (uint8_t index = 0; index < BUTTON_PIN_MAP_MAX; index++) { - if (pin == g_button_pin_map[index].pin) { - bit = index; - break; - } - } - - uapi_gpio_clear_interrupt(pin); - button_press_state_t press_state = button_get_press_state(pin); - unsigned int irq_sts = osal_irq_lock(); - if (press_state == PRESSED) { - button_group_set_bit(&g_button_debounced.debounced, bit); - g_button_debounced.debounced_time = (uint32_t)uapi_systick_get_ms(); - } - osal_irq_restore(irq_sts); - - button_peripheral_api *button_api = button_port_get_api(); - button_api->button_add_veto(); - button_timer_start(); -} - -static void button_debounced_handler(void) -{ - pin_t pin = 0; - uint32_t time = (uint32_t)uapi_systick_get_ms(); - uint8_t pressed_group = 0; - uint8_t bit = 0; - uint8_t debounced = g_button_debounced.debounced; - - while (debounced > 0) { - if (button_group_find_bit(debounced, &bit)) { - button_group_clear_bit(&debounced, bit); - pin = g_button_pin_map[bit].pin; - if ((button_get_press_state(pin) == PRESSED) && - (time - g_button_debounced.debounced_time >= DEBOUNCED_INTERVAL)) { - /* Debounce */ - button_group_set_bit(&pressed_group, bit); - button_group_clear_bit(&g_button_debounced.debounced, bit); - } - } - } - - /* Comparing with the old pressed state to figure out which buttons are pressed or released */ - g_button_info.which_pressed = pressed_group & ~g_button_info.pressed_group; - g_button_info.which_released = ~pressed_group & g_button_info.pressed_group; - - /* Recording pressed_group */ - g_button_info.pressed_group = pressed_group; -} - -static void button_debounced_timer_callback(uint32_t data) -{ - unused(data); - g_gpio_timer_is_running = false; - - button_debounced_handler(); - - if (g_button_info.which_pressed != 0) { - button_send_msg(g_button_info.which_pressed, PRESSED); - } else if (g_button_info.which_released != 0) { - button_send_msg(g_button_info.which_released, RELEASED); - } - if (g_button_debounced.debounced != 0) { - button_timer_start(); - } else { - button_peripheral_api *button_api = button_port_get_api(); - button_api->button_remove_veto(); - } -} - -static void button_check_released_timer_callback(uint32_t data) -{ - unused(data); - - g_timer_is_running = false; - - button_peripheral_api *button_api = button_port_get_api(); - button_press_state_t press_state; - press_state = button_get_press_state(PIN_NONE); - if (press_state == 1) { - button_send_msg(1, RELEASED); - button_api->button_remove_veto(); - } else { - button_timer_start_check_released(); - } -} - -errcode_t uapi_button_gpio_register(pin_t pin) -{ - errcode_t ret; - ret = uapi_gpio_unregister_isr_func(pin); - if (ret != ERRCODE_SUCC) { - return ret; - } - /* GPIO set input and pull up */ - if ((uapi_pin_set_mode(pin, (pin_mode_t)HAL_PIO_FUNC_GPIO) != ERRCODE_SUCC) || - (uapi_pin_set_pull(pin, (pin_pull_t)HAL_PIO_PULL_UP) != ERRCODE_SUCC) || - (uapi_gpio_set_dir(pin, GPIO_DIRECTION_INPUT) != ERRCODE_SUCC)) { - PRINT("gpio config failed\r\n"); - return ERRCODE_FAIL; - } - ret = uapi_gpio_register_isr_func(pin, GPIO_INTERRUPT_DEDGE, button_gpio_callback); - if (ret != ERRCODE_SUCC) { - PRINT("button gpio register failed\r\n"); - return ret; - } - return ERRCODE_SUCC; -} - -errcode_t uapi_button_deregister(pin_t pin) -{ - errcode_t ret; - button_peripheral_api *button_api = button_port_get_api(); - ret = button_api->button_unregister_callback(pin); - if (ret != ERRCODE_SUCC) { - PRINT("button deregister failed\r\n"); - return ret; - } - - return ERRCODE_SUCC; -} - -errcode_t uapi_button_register(button_map_t* button_map) -{ - errcode_t ret = 0; - if (button_map == NULL) { - return ERRCODE_FAIL; - } - - button_peripheral_api *button_api = button_port_get_api(); - for (uint8_t i = 0; i < BUTTON_PIN_MAP_MAX; i++) { - g_button_pin_map[i].pin = button_map[i].pin; - g_button_pin_map[i].button = button_map[i].button; - if (button_map[i].pin != PIN_NONE && button_map[i].button != BUTTON_MAX) { - if (button_map[i].button == BUTTON_PWR) { - button_api->button_pmu_pwr_cfg(true); - } - ret |= uapi_button_gpio_register(g_button_pin_map[i].pin); - } else if (button_map[i].pin == PIN_NONE && button_map[i].button == BUTTON_PWR) { - ret = button_api->button_register_callback(g_button_pin_map[i].pin, (osal_irq_handler)button_irq_callback); - if (ret != ERRCODE_SUCC) { - PRINT("button register failed\r\n"); - return ret; - } - continue; - } - } - - return ret; -} - -void uapi_button_deinit(void) -{ - /* Stop the time and clear the pin map */ - uapi_rtc_stop(g_button_timer); - uapi_rtc_delete(g_button_timer); - g_button_timer = NULL; - uapi_rtc_stop(g_gpio_button_timer); - uapi_rtc_delete(g_gpio_button_timer); - g_gpio_button_timer = NULL; - for (uint8_t i = 0; i < BUTTON_PIN_MAP_MAX; i++) { - g_button_pin_map[i].pin = PIN_NONE; - g_button_pin_map[i].button = BUTTON_MAX; - } -} - -errcode_t uapi_button_init(void) -{ - errcode_t ret = 0; - ret = uapi_rtc_init(); - - ret |= uapi_rtc_adapter(0, RTC_0_IRQN, irq_prio(RTC_0_IRQN)); /* 1: using timer1 */ - if (ret != ERRCODE_SUCC) { - PRINT("uapi_rtc_init FAILED 0x%x", ret); - return ret; - } - ret = uapi_rtc_create(0, &g_button_timer); /* 1: using timer1 */ - if (ret != ERRCODE_SUCC) { - PRINT("uapi_rtc_create FAILED 0x%x", ret); - return ret; - } - ret = uapi_rtc_create(0, &g_gpio_button_timer); /* 1: using timer1 */ - if (ret != ERRCODE_SUCC) { - PRINT("uapi_rtc_create FAILED 0x%x", ret); - return ret; - } - return ERRCODE_SUCC; -} - -void uapi_button_send_msg_register(msg_send_callback_t cb) -{ - if (cb != NULL) { - g_msg_send_cb = cb; - } -} \ No newline at end of file diff --git a/code/sdk/drivers/drivers/driver/mmc/host/sdhci/brandy/mmc_sdhci.c b/code/sdk/drivers/drivers/driver/mmc/host/sdhci/brandy/mmc_sdhci.c index 5eec00b93..9f6645767 100755 --- a/code/sdk/drivers/drivers/driver/mmc/host/sdhci/brandy/mmc_sdhci.c +++ b/code/sdk/drivers/drivers/driver/mmc/host/sdhci/brandy/mmc_sdhci.c @@ -77,7 +77,6 @@ typedef struct { static mmc_save_info_t g_mmc_cur_info = { 0 }; bool g_mmc_sleep_inited = false; bool g_mmc_inited = false; -static enum mmc_bus_timing g_max_timing = bus_timing_normal; void mmc_set_first_init_flag(bool flag) { @@ -695,50 +694,24 @@ static void sdhci_use_pll_clk(void) DPAL_WRITE_UINT16(GLB_CLKEN_ENABLE, GLB_CLKEN_REG); } -static uint32_t sdhci_get_config_clock(struct hci_softc *sc, uint32_t clock) -{ - uint32_t actual_clock = clock; - if (clock > sc->caps.max_clk) { -#if EMMC_BOARD_DEBUG_ON - dprintf("%s, clock:[%u] is greater than the max_clk:[%u]!\n", __FUNCTION__, clock, sc->caps.max_clk); -#endif - actual_clock = sc->caps.max_clk; - } - switch (g_max_timing) { - case bus_timing_mmc_hs: - case bus_timing_uhs_sdr50: - case bus_timing_uhs_ddr50: - case bus_timing_mmc_ddr52: - case bus_timing_sd_hs: - if (actual_clock >= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) { - actual_clock = SDIOM_SRC_CLK_FREQ_LVL_49M_VAL; - } - break; - default: - break; - } - return actual_clock; -} - uint32_t sdhci_set_clock(struct hci_softc *sc, uint32_t clock) { unsigned int ret; static uint8_t inited = false; - uint32_t actual_clk = 0; + if (clock == 0) { device_printf(sc->dev, "set clock invalid param!\n"); return clock; } - actual_clk = sdhci_get_config_clock(sc, clock); #if EMMC_BOARD_DEBUG_ON - dprintf("%s, clk:%u,a_clk:%u,resource:[0x%x]!\n", __FUNCTION__, clock, actual_clk, DPAL_GET_UINT16(SDIOM_CR_REG)); + dprintf("%s, clock: [%u], resource:[0x%x]!\n", __FUNCTION__, clock, DPAL_GET_UINT16(SDIOM_CR_REG)); #endif - if (actual_clk <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) { + if (clock <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) { brandy_reg16_clrbit(BRANDY_EXTERNAL_EMMC_CCLK_DIV, EMMC_TUNING_COARSE_MODE_BIT); } else { brandy_reg16_setbit(BRANDY_EXTERNAL_EMMC_CCLK_DIV, EMMC_TUNING_COARSE_MODE_BIT); } - ret = hal_mmc_set_soc_clock(sc, actual_clk); + ret = hal_mmc_set_soc_clock(sc, clock); if (ret != 0) { device_printf(sc->dev, "set clock fail!\n"); return 0; @@ -754,24 +727,17 @@ uint32_t sdhci_set_clock(struct hci_softc *sc, uint32_t clock) #ifdef CFG_SDIO_EMMC_COEXIST if (sc->num == 0) { #endif - // After the tuning phase value is configured, the tuning clk function is automatically enabled. - if (actual_clk > SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) { - brandy_reg16_clrbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT); - brandy_reg16_clrbit(AT_CTRL, 0x4); // 0x4 means SW_TUNE_EN - dpal_writel(sc->tuning_phase, AT_STAT); - brandy_reg16_setbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT); + // After the tuning phase value is configured, the tuning clk function is automatically enabled. + uint32_t phase = dpal_readl(AT_STAT); + dpal_writel(phase, AT_STAT); // The fixed clock is less than or equal to 52 MHz, and the tuning clock is not used. - } else { - brandy_reg16_clrbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT); - } + if (clock <= SDIOM_SRC_CLK_FREQ_LVL_50M_VAL) { + brandy_reg16_clrbit(HOST_CTRL2, SAMPLE_CLK_SEL_BIT); + } #ifdef CFG_SDIO_EMMC_COEXIST } #endif -#if EMMC_BOARD_DEBUG_ON - dprintf("%s,clk_src=0x%X, at_ctrl=0x%X, at_stat=0x%X, host2_ctrl=0x%X, tuning_phase=0x%X\r\n", __FUNCTION__, - readw(SDIOM_CR_REG), readw(AT_CTRL), readw(AT_STAT), readw(HOST_CTRL2), sc->tuning_phase); -#endif - return actual_clk; + return clock; } void mmc_set_internal_clk(uint16_t clk_level) @@ -1152,7 +1118,6 @@ static void sdhci_set_mmc_io_driver(const struct hci_softc *sc, uint32_t host_id static bool sdhci_judge_dll_sample(uint32_t timing) { - if (g_max_timing < timing) { g_max_timing = timing; } if (timing == bus_timing_mmc_hs || timing == bus_timing_sd_hs || timing == bus_timing_normal || timing == bus_timing_uhs_sdr25) { return false; @@ -1197,7 +1162,8 @@ static void sdhci_set_phase(struct hci_softc *sc, uint32_t timing) } } else { /* SDIO device */ - if ((timing == bus_timing_sd_hs) || (timing == bus_timing_uhs_sdr25)) { + if ((timing == bus_timing_sd_hs) || + (timing == bus_timing_uhs_sdr25)) { drv_phase = DRV_PHASE_180_DEGREE; phase = SAMPLE_PHASE; } else { @@ -1208,8 +1174,7 @@ static void sdhci_set_phase(struct hci_softc *sc, uint32_t timing) } en_flag = sdhci_judge_dll_sample(timing); #if EMMC_BOARD_DEBUG_ON - device_printf(sc->dev, "timing:%u, g_max_timing =%u, phase:0x%x, drv_phase:0x%x, en_flag:%d \n", timing, - g_max_timing, phase, drv_phase, en_flag); + device_printf(sc->dev, "timing:%u, phase:0x%x, drv_phase:0x%x, en_flag:%d \n", timing, phase, drv_phase, en_flag); #endif sdhci_set_drv_phase(sc->num, drv_phase); sdhci_en_drv_dll_sample(sc, en_flag); diff --git a/code/sdk/drivers/drivers/driver/mmc/include/soc_mmc.h b/code/sdk/drivers/drivers/driver/mmc/include/soc_mmc.h index da82d3080..3cc5cc232 100755 --- a/code/sdk/drivers/drivers/driver/mmc/include/soc_mmc.h +++ b/code/sdk/drivers/drivers/driver/mmc/include/soc_mmc.h @@ -177,8 +177,8 @@ extern "C" { #define SD_BUS_DIV_NUM_MASK 0xF8 // bit3---bit7 #define SD_BUS_DIV_NUM_POST_SHIFT 3 -#define EMMC_TUNING_BM0_VAL (0x4244) -#define EMMC_TUNING_BM1_VAL (0x777) +#define EMMC_TUNING_BM0_VAL (0x4210) +#define EMMC_TUNING_BM1_VAL (0x707) #define EMMC_TUNING_COARSE_MODE BIT(13) #define DWC_MSHC_PTR_VENDOR1 0x500 diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index 44ef95dd3..6c24c0f63 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -3031,7 +3031,7 @@ void hx3695_hrs_ppg_Int_handle(void) encoded_hrm[15] = ppg_s_data.green_cur;//绿灯电流 encoded_hrm[16] = ppg_s_data.ir_cur;//红外电流 - if(uapi_dev_runtime_get_bt_powerstat()) + if(cm_custom_ble_service_on_flag()) ble_ppgtest_server_send_input_report(encoded_hrm,PPG_DATA_LEN_MAX); // ble_op_att_send_data(ATT_CHARACTERISTIC_2a37_01_VALUE_HANDLE,encoded_hrm, \ @@ -3477,7 +3477,7 @@ void hx3695_spo2_ppg_Int_handle(void) encoded_hrm[15] = cal.R_LED; encoded_hrm[16] = cal.IR_LED1; - if(uapi_dev_runtime_get_bt_powerstat()) + if(cm_custom_ble_service_on_flag()) ble_ppgtest_server_send_input_report(encoded_hrm,PPG_DATA_LEN_MAX); } } diff --git a/code/sdk/include/middleware/services/bts/common/bts_def.h b/code/sdk/include/middleware/services/bts/common/bts_def.h index fc6b0a7b6..cd14ba170 100755 --- a/code/sdk/include/middleware/services/bts/common/bts_def.h +++ b/code/sdk/include/middleware/services/bts/common/bts_def.h @@ -158,31 +158,6 @@ typedef struct { @else UUID字段。 @endif */ } bt_uuid_t; -/** - * @if Eng - * @brief Set BT_SERVICE_TASK priority. - * @par Set BT_SERVICE_TASK priority. - * @attention NULL - * @param [in] task_priority task priority, range is 0 to 31, 0 is highest priority, 31 is lowest priority. - * @retval #ERRCODE_BT_SUCCESS Excute successfully. - * @retval #Other Error code, @ref errcode_bt_t - * @par Dependency: - * @li bts_def.h - * @see - * @else - * @brief 设置BT_SERVICE_TASK任务优先级。 - * @par 设置BT_SERVICE_TASK任务优先级。 - * @attention 无 - * @param [in] 任务优先级, 0为最大优先级,31为最小优先级. - * @retval #ERRCODE_BT_SUCCESS 执行成功。 - * @retval #Other 错误码, @ref errcode_bt_t - * @par 依赖: - * @li bts_def.h - * @see - * @endif - */ -errcode_bt_t bts_set_service_task_priority(uint16_t task_priority); - /** * @} */ diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style.cpp.xml index 4747edad5..814768b37 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style.cpp.xml @@ -1,10 +1,10 @@ - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style_item.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style_item.cpp.xml index b094ecb2d..616ce6daf 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style_item.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style_item.cpp.xml @@ -1,9 +1,9 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style_manager.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style_manager.cpp.xml index 037fdcae2..f56cf39f9 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style_manager.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/app_style_manager.cpp.xml @@ -1,5 +1,5 @@ - - - - + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/btsrv_task.c.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/btsrv_task.c.xml index 8528e7ad3..7f8007ae6 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/btsrv_task.c.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/btsrv_task.c.xml @@ -1,9 +1,9 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/image_cache_manager.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/image_cache_manager.cpp.xml index a62c26346..076b14e7e 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/image_cache_manager.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/image_cache_manager.cpp.xml @@ -8,8 +8,8 @@ - - + + diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_page_state.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_page_state.cpp.xml index 39339dba5..83155ae4e 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_page_state.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_page_state.cpp.xml @@ -1,11 +1,11 @@ - - - - - - - - - - + + + + + + + + + + \ 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_page_state_machine.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_page_state_machine.cpp.xml index 2b6d5b643..879879367 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_page_state_machine.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_page_state_machine.cpp.xml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + \ 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_router.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_router.cpp.xml index d6361bbe2..b28742c84 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_router.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/js_router.cpp.xml @@ -1,9 +1,9 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/lite_m_gfx_engine.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/lite_m_gfx_engine.cpp.xml index 1bdf5bd87..58d336d49 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/lite_m_gfx_engine.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/lite_m_gfx_engine.cpp.xml @@ -1,33 +1,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/map_svg_parser.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/map_svg_parser.cpp.xml index 4a02f3641..fdff0566e 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/map_svg_parser.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/map_svg_parser.cpp.xml @@ -1,72 +1,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/platform_adapter.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/platform_adapter.cpp.xml index 5df549e10..b988bc94b 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/platform_adapter.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/platform_adapter.cpp.xml @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/spp_service.c.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/spp_service.c.xml index 8666eca75..b0ce8cad1 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/spp_service.c.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/spp_service.c.xml @@ -1,58 +1,52 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_coverflow_view2.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_coverflow_view2.cpp.xml index a5a003547..cf81c8609 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_coverflow_view2.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_coverflow_view2.cpp.xml @@ -3,6 +3,5 @@ - - + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_icosahedron_view.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_icosahedron_view.cpp.xml index 7b69562ed..c474fb166 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_icosahedron_view.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_icosahedron_view.cpp.xml @@ -1,2 +1,2 @@ - + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_map_view.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_map_view.cpp.xml index 0a05ed538..ee2cc76b0 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_map_view.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_map_view.cpp.xml @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_roller_view.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_roller_view.cpp.xml index dfbff856e..2645a8d50 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_roller_view.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_roller_view.cpp.xml @@ -1,12 +1,12 @@ - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_slipflow_view.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_slipflow_view.cpp.xml deleted file mode 100644 index 9bd50c7f8..000000000 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_slipflow_view.cpp.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_transform_group.cpp.xml b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_transform_group.cpp.xml index 31f789946..a9391cb37 100644 --- a/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_transform_group.cpp.xml +++ b/code/sdk/interim_binary/brandy/acore/build_hso_cfg/hso_database/xml/base/closed_comp/ui_transform_group.cpp.xml @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/code/sdk/interim_binary/brandy/audio/build_hso_cfg/hso_database/xml/base/dsp_core/core_sea.c.xml b/code/sdk/interim_binary/brandy/audio/build_hso_cfg/hso_database/xml/base/dsp_core/core_sea.c.xml index b826476ed..2541a892c 100755 --- a/code/sdk/interim_binary/brandy/audio/build_hso_cfg/hso_database/xml/base/dsp_core/core_sea.c.xml +++ b/code/sdk/interim_binary/brandy/audio/build_hso_cfg/hso_database/xml/base/dsp_core/core_sea.c.xml @@ -1,88 +1,88 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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..b1d8c6a12 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 @@ -1923,20 +1923,17 @@ - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/hci_core_ram.c.xml b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/hci_core_ram.c.xml index 1f5869e67..0bdff1a17 100755 --- a/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/hci_core_ram.c.xml +++ b/code/sdk/interim_binary/brandy/bt/build_hso_cfg/hso_database/xml/base/bt_core/hci_core_ram.c.xml @@ -1,15 +1,12 @@ - - - - - - - - - - - - - - + + + + + + + + + + + \ 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..c5a5e72a1 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..dc7c4de02 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..54c959693 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..1ddd57eb5 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..e396688fd 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..b58bd0eca 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 deleted file mode 100644 index 08d29c576..000000000 Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/mini/br/libbt_host_audio_manager_wrapper.a and /dev/null 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..d2214bc57 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..ca04ee897 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/chips/brandy/dfx/include/log_def_app.h b/code/sdk/middleware/chips/brandy/dfx/include/log_def_app.h index d171afad1..4f8fda3b9 100755 --- a/code/sdk/middleware/chips/brandy/dfx/include/log_def_app.h +++ b/code/sdk/middleware/chips/brandy/dfx/include/log_def_app.h @@ -188,7 +188,6 @@ typedef enum { MSG_CENTER_OTA_CPP, MSG_CENTER_CUSTOMER_CPP, MSG_CENTER_PROTOCOL_CPP, - MSG_CENTER_COMMON_CPP, ALARM_NOTIFICATION_CPP, MAKEPHONE_NOTIFICATION_CPP, NOTIFICATION_MANAGER_CPP, diff --git a/code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h b/code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h index 5375914e1..eadd45120 100755 --- a/code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h +++ b/code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h @@ -426,7 +426,6 @@ typedef enum { KALEIDOSCOPE_UTILS_CPP, UI_COVERFLOW_VIEW_CPP, UI_COVERFLOW_VIEW2_CPP, - UI_SLIPFLOW_VIEW_CPP, UI_ROLLER_VIEW_CPP, UI_ICOSAHEDRON_VIEW_CPP, UI_MAP_VIEW_CPP, diff --git a/code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h b/code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h index fa8b79033..2d1e3bd07 100644 --- a/code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h +++ b/code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h @@ -120,7 +120,6 @@ typedef enum { JSI_CPP, APP_MODULE_CPP, DEVICE_MODULE_CPP, - NETWORK_MODULE_CPP, NFC_MODULE_CPP, GEOLOCATION_MODULE_CPP, VIBRATOR_MODULE_CPP, @@ -135,7 +134,6 @@ typedef enum { CONSOLE_MODULE_CPP, DATE_TIME_FORMAT_MODULE_CPP, FEATURE_ABILITY_MODULE_CPP, - IMAGE_MODULE_CPP, INTL_MODULE_CPP, JSTEST_MODULE_CPP, LOCALIZATION_MODULE_CPP, diff --git a/code/sdk/middleware/chips/brandy/nv/include/nv_config.h b/code/sdk/middleware/chips/brandy/nv/include/nv_config.h index f053e883c..6a01d6450 100755 --- a/code/sdk/middleware/chips/brandy/nv/include/nv_config.h +++ b/code/sdk/middleware/chips/brandy/nv/include/nv_config.h @@ -6,22 +6,20 @@ #ifndef NV_CONFIG_H #define NV_CONFIG_H -#include "memory_config.h" - #define NV_TASKS_MAX_NUM 64 /* 可支持的NV保存任务的最大数(多核系统使用) */ #define NV_NORMAL_KVALUE_MAX_LEN 4060 /* 普通NV的最大数据长度 */ #define NV_ENCRYPTED_KVALUE_MAX_LEN 4048 /* 加密NV的最大数据长度 */ /* Flash 物理地址起始和结束 */ -#define FLASH_PHYSICAL_ADDR_START (FLASH_START) -#define FLASH_PHYSICAL_ADDR_END (FLASH_START + FLASH_LENGTH) +#define FLASH_PHYSICAL_ADDR_START 0x70000000 +#define FLASH_PHYSICAL_ADDR_END 0x80000000 #define KV_PAGE_SIZE FLASH_PAGE_SIZE /* NV运行区默认起始地址(物理地址) */ -#define KV_STORE_START_ADDR (NV_FLASH_REGION_START) +#define KV_STORE_START_ADDR (FLASH_PHYSICAL_ADDR_START + 0xFF9000) /* NV运行区page数 */ -#define KV_STORE_DATA_PAGE_NUM (NV_FLASH_REGION_PAGES) +#define KV_STORE_DATA_PAGE_NUM 4 /* NV运行区默认长度(不包含备份区) */ #define KV_STORE_DATA_SIZE (KV_STORE_DATA_PAGE_NUM * KV_PAGE_SIZE) 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..74bab2e70 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..0c18f1d00 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-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-r/libgfx_rm.a index ccac945e2..901f59cf3 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/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js/libgfx_rm.a index 4347741a3..1f2f82e27 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..0406d16e5 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..c72f49356 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..ed20488fd 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..4188f3425 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..0056cd070 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..3b992823a 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..a0f017f9f 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..4500b5129 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..7ca96c185 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..db044ac0d 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..c43a607e5 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..f556eafb9 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/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a index 9727828a5..44063273b 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..49605afa7 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..6c3cb9c2b 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..746d09290 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..6346e30ab 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/hal/display/src/display_gralloc.c b/code/sdk/middleware/services/gui/hal/display/src/display_gralloc.c index bc3041070..0efd01d31 100755 --- a/code/sdk/middleware/services/gui/hal/display/src/display_gralloc.c +++ b/code/sdk/middleware/services/gui/hal/display/src/display_gralloc.c @@ -229,14 +229,13 @@ static int32_t AllocMem(const AllocInfo *info, BufferHandle **handle) } uint8_t *addr = LosAllocMem(pool, (uint32_t)(buffer->size)); - if (((info->usage & HBM_USE_MEM_YUV) != HBM_USE_MEM_YUV) && - (pool == g_poolId) && (g_tryToFreeImgCallback != NULL)) { + if ((pool == g_poolId) && (g_tryToFreeImgCallback != NULL)) { while (addr == NULL) { if (g_tryToFreeImgCallback()) { - DISP_LOGW("Success to free image during AllocMem size: %u\n", buffer->size); + DISP_LOGW("Success to free image during AllocMem size:%d\n", buffer->size); addr = LosAllocMem(pool, (uint32_t)(buffer->size)); } else { - DISP_LOGE("Failed to AllocMem size: %u and no image can be free\n", buffer->size); + DISP_LOGE("Failed to AllocMem size:%d and no image can be free\n", buffer->size); break; } } 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..4e1c4b4ac 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..729723d8a 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/lvgl/proprietary/src/misc/lv_turn_page_effect.c b/code/sdk/middleware/services/gui/lvgl/proprietary/src/misc/lv_turn_page_effect.c index df828b27e..0e71b48cf 100644 --- a/code/sdk/middleware/services/gui/lvgl/proprietary/src/misc/lv_turn_page_effect.c +++ b/code/sdk/middleware/services/gui/lvgl/proprietary/src/misc/lv_turn_page_effect.c @@ -29,7 +29,7 @@ static bool LvInitImgDsc(lv_img_dsc_t* imgDsc, lv_coord_t width, lv_coord_t heig } uint32_t buffSize = LV_ALIGN_BYTE((uint32_t)width, LV_BYTE_ALIGNMENT) * height * (lv_img_cf_get_px_size((lv_img_cf_t)cf) >> 3); // 3: shift by 3 bits - uint8_t* buf = (uint8_t*)LvAllocBufferForImg(buffSize); + uint8_t* buf = LvAllocBufferForImg(buffSize); if (buf == NULL) { LV_LOGE("[%s: %d] AllocBuffer failed, size = %u.\n", __FUNCTION__, __LINE__, buffSize); return false; diff --git a/code/sdk/middleware/services/gui/uikit/CMakeLists.txt b/code/sdk/middleware/services/gui/uikit/CMakeLists.txt index 826b856a0..0e621de13 100755 --- a/code/sdk/middleware/services/gui/uikit/CMakeLists.txt +++ b/code/sdk/middleware/services/gui/uikit/CMakeLists.txt @@ -217,7 +217,6 @@ set(COMPONENT_SRC ${PROP_UI_SRC}/components_ext/ui_roller_view.cpp ${PROP_UI_SRC}/components_ext/ui_map_view.cpp ${PROP_UI_SRC}/components_ext/map_svg_parser.cpp - ${PROP_UI_SRC}/components_ext/ui_slipflow_view.cpp ${PROP_UI_SRC}/components_ext/ui_coverflow_view.cpp ${PROP_UI_SRC}/components_ext/ui_coverflow_view2.cpp ${PROP_UI_SRC}/components_ext/ui_icosahedron_view.cpp 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..ce7f417b2 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..af9e8fe96 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/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a index 807b8f29e..8ee2fe15e 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..f23626d6b 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..8abc14ef4 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/ui_cross_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h index 77d459ecd..128e27107 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 @@ -27,7 +27,6 @@ #ifndef UI_CROSS_VIEW_H #define UI_CROSS_VIEW_H -#include #include "components/ui_swipe_view.h" #include "components/card_swipe.h" #include "components_ext/hor_swipe_view.h" @@ -235,7 +234,6 @@ private: UIView* tailView_ = nullptr; UISwipeView::OnSwipeListener *swipeListener_ = nullptr; bool isNeedClip_ = false; - std::shared_ptr exists_; void RemoveAllInner(UISwipeView& view); void ProcessRes(void); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_hexagons_list.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_hexagons_list.h index d214d955c..7d287c554 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_hexagons_list.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_hexagons_list.h @@ -145,7 +145,7 @@ public: * @brief Get the Index Of View object in this view group * * @param view, Indicates the view to search - * @return Returns the view, nullptr if not exsit + * @return Returns the index, -1 if not exsit */ UIView* GetViewByIndex(uint8_t index); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_slipflow_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_slipflow_view.h deleted file mode 100644 index 975e5a31a..000000000 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_slipflow_view.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2024. All rights reserved. - * Description: UISlipFlow - * Author: - * Create: 2024-08 - */ - -#ifndef UI_SLIPFLOW_VIEW_H -#define UI_SLIPFLOW_VIEW_H -#include -#include -#include "gfx_utils/vector.h" -#include "components/ui_image_view.h" -#include "components/ui_label.h" -#include "components/ui_abstract_scroll.h" - -namespace OHOS { -struct TempXoffsetInfo { - int16_t tempMasterXoffset; - int16_t tempSlaveXoffset; - int16_t tempMasterYoffset; - int16_t tempSlaveYoffset; -}; - -class UISlipflowView : public UIAbstractScroll { -public: - explicit UISlipflowView(); - ~UISlipflowView() override; - - /** - * @brief Adds a child view. - * - * @param view Indicates the pointer to the child view to add. - * @since 1.0 - * @version 1.0 - */ - void Add(UIView* view) override; - - /** - * @brief remove a child view from slipflow. - * - * @param id Indicates the pointer to the child view to remove. - */ - void Remove(UIView* view) override; - - /** - * @brief Set page size. - * - * @param width setting page width. - * @param height setting page height. - */ - void SetPageSize(uint16_t width, uint16_t height); - - /** - * @brief Get page width. - */ - uint16_t GetPageWidth() const - { - return pageWidth_; - } - - /** - * @brief Get page height. - */ - uint16_t GetPageHeight() const - { - return pageHeight_; - } - - /** - * @brief Sets the index for the current tab. - * - * @param index Indicates the index of a view. - * @param needAnimator Specifies whether a flip animation is needed. false (default value) indicates a flip - * animation is not needed, and true indicates the opposite case. - * @since 1.0 - * @version 1.0 - */ - void SetCurrentPage(uint16_t index, bool needAnimator = false); - - /** - * @brief Obtains the current tab index. - * - * @return Returns the current tab index. - * @since 1.0 - * @version 1.0 - */ - uint16_t GetCurrentPage() const - { - return curIndex_; - } - - /** - * @brief Obtains the current view. - * - * @return Returns the current view. - * @since 1.0 - * @version 1.0 - */ - UIView* GetCurrentView() const - { - return curView_; - } - - /** - * @brief Obtains the component type. - * - * @return Returns the component type, as defined in {@link UIViewType}. - * @since 1.0 - * @version 1.0 - */ - UIViewType GetViewType() const override - { - return UI_SLIP_FLOW; - } - - /** - * @brief Obtains a view based on its index. - * - * @param Indicates the index of a view. - * @return Returns the view. - * @since 1.0 - * @version 1.0 - */ - UIView* GetViewByIndex(uint16_t index) const; - - /** - * @brief Indicates that the animation duration is 12 ticks. - * - * @since 1.0 - * @version 1.0 - */ - constexpr static uint16_t ANIMATOR_TIME = 12; - - /** - * @brief Sets the time for the page being animated. The page will go beyond the blank during this time. - * - * @param time Indicates the time of the page being animated. - * @since 1.0 - * @version 1.0 - */ - void SetAnimatorTime(uint16_t time); - - /** - * @brief Set the movement coefficient of the current page and the page on the right compared to other pages. - * - * @param coefficient The moving speed of the current page and the page on the right is coefficient times - * that of other pages. - * @since 1.0 - * @version 1.0 - */ - void SetMoveCoefficient(uint16_t coefficient); - - /** - * @fn void OnDragEvent(const DragEvent& event) override - * - * @brief realize drag event, Switch to specified view when drag - * - * @param event The drag event - */ - bool OnDragEvent(const DragEvent& event) override; - - /** - * @fn void OnDragStartEvent(const DragEvent& event) override - * - * @brief realize drag start event, Switch to specified view when drag start - * - * @param event The drag event start - */ - - bool OnDragStartEvent(const DragEvent& event) override; - - /** - * @fn void OnDragEndEvent(const DragEvent& event) override - * - * @brief realize drag end event, Switch to specified view when drag end - * - * @param event The drag event end - */ - bool OnDragEndEvent(const DragEvent& event) override; - - /** - * @brief Represents a listener for swipe of the slipflow view. - */ - class OnSlipflowScrollListener : public HeapBase { - public: - virtual bool OnScroll(int16_t distance) { return true; } - virtual void OnScrollUpStart() {}; - virtual void OnScrollUpEnd() {}; - virtual bool OnRemove(UIView* view) { return true; } - virtual void OnRefreshPageOpaScale(UIView* view, int16_t xOffset, int16_t yOffset) {} - virtual ~OnSlipflowScrollListener() {} - }; - - /** - * @brief Sets the listener that contains a callback to be invoked upon a swipe event. - * - * @param onSlipflowListener Indicates the listener to set. - * @since 1.0 - * @version 1.0 - */ - void SetOnSlipflowListener(OnSlipflowScrollListener* onSlipflowListener) - { - slipflowListener_ = onSlipflowListener; - } - - void SetDirection(uint8_t direction) = delete; - uint8_t GetDirection() const = delete; -protected: - void SortChild(); - bool DragXInner(int16_t distance) override; - bool DragYInner(int16_t distance) override; - void StopAnimator() override; - void RefreshCurrentView(int16_t distance, uint8_t dragDirection); - void SwitchToPage(int16_t dst, bool needAnimator = true); - void MoveChildByXOffset(int16_t xOffset); - void DeleteMoveChild(int16_t distance); - void SwipUpReleaseOperation(); - void SwipUpDeleteOperation(); - void SwipUpRebound(); - void CalculateInvalidate(); - -private: - void DeleteGroup(UIViewGroup* group); - void AddTempXoffsetInfo(); - void ResetTempOffsetInfo(); - bool CalCurViewInfo(); - void RefreshChildIndex(); - void RefreshScreen(); - void RefreshPageOpaScale(UIView* view); - int16_t GetPreViewOffsetToCenter(); - - OnSlipflowScrollListener* slipflowListener_; - Graphic::Vector pageTempOffsetInfo_; - int16_t totalTempXoffset_{0}; - int16_t totalTempYoffset_{0}; - int16_t xMoveCoefficient_; - int16_t yMoveCoefficient_; - bool isSwipUpDelete_{false}; - - uint16_t tickTime_; - uint16_t curIndex_; - uint16_t blankSize_; - UIView* curView_; - UIView* deleteView_; - uint16_t lastIndex_; - uint16_t pageWidth_; - uint16_t pageHeight_; - UIView* lastView_; - uint16_t swipeMid_; - int8_t dragDirection_; - bool isMoveTotal_; - bool isSetPage_; -}; -} // namespace OHOS -#endif // UI_SLIPFLOW_VIEW_H 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..ade79f632 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 @@ -60,14 +60,6 @@ public: * @version 1.0 */ void SetStyle(uint8_t key, int64_t value) override; - - /** - * @brief Called when a view is drawn. - * @param invalidatedArea Indicates the area to draw. - * @since 1.0 - * @version 1.0 - */ - void OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override; private: void ReMeasure() override; void DeleteMirrorView(); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/dfx/dfx_frame_trace.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/dfx/dfx_frame_trace.h index c2519d10f..a7cf2ea79 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/dfx/dfx_frame_trace.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/dfx/dfx_frame_trace.h @@ -64,7 +64,6 @@ enum class FrameTraceType { HW_DRAW_SUBMIT, HW_DRAW_FLUSH, HW_DRAW_WAIT, - HW_DRAW_ARC_RECT, DRAW_MAX }; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/gfx_utils/mem_check.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/gfx_utils/mem_check.h index 241793d37..e1a266d62 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/gfx_utils/mem_check.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/gfx_utils/mem_check.h @@ -36,14 +36,37 @@ #define GRAPHIC_LITE_MEM_CHECK_H #include +#include +#include +#include #include #include "gfx_utils/mem_api.h" #include "graphic_thread.h" -#include "graphic_mutex.h" -#include "soc_osal.h" #if ENABLE_MEMORY_CHECK namespace OHOS { +/** + * @brief Mem opt, add or delete + * + */ +enum class Opt { + ADD, + DEL +}; + +/** + * @brief Memory record info. + * + */ +struct MemRecord { + int32_t size; + uintptr_t address; + Opt opt; + time_t time; + int32_t total; + struct MemRecord* next; +}; + /** * @brief Memory alloc info. * @@ -80,7 +103,7 @@ public: * @since 1.0 * @version 1.0 */ - bool MemAdd(int size, uintptr_t address); + int MemAdd(int size, uintptr_t address); /** * @brief Reduce dynamic memory. You can call it when reduce dynamic memory. @@ -89,7 +112,7 @@ public: * @since 1.0 * @version 1.0 */ - bool MemDelete(uintptr_t address); + int MemDelete(uintptr_t address); /** * @brief print current memory info @@ -115,19 +138,32 @@ public: leakSize_ = sz; } +#ifndef VERSION_IOT + void CollectMemory(uint32_t delayTime); + void SaveRecordInfo(); +#endif + private: MemCheck() {} ~MemCheck(); MemCheck(const MemCheck &) = delete; MemCheck &operator=(const MemCheck &) = delete; +#ifndef VERSION_IOT + bool InsertRecord(uintptr_t address, Opt opt, int32_t size, int32_t total); + bool CreateRecordFile(); + bool isBeyondTime(); +#endif + bool initSuc = false; + FILE* fp = nullptr; + MemRecord* recordHead = nullptr; + MemAllocInfo* allocHead = nullptr; + MemRecord* recordTail = nullptr; + MemAllocInfo* allocTail = nullptr; - bool InitMemInfoList(); - void ClearMemInfoList(); - - MemAllocInfo* allocHead_ = nullptr; - MemAllocInfo* allocTail_ = nullptr; - GraphicMutex lock_; - osal_atomic totalCnt_; + time_t setTime_ = 0; + int32_t delayTime_ = 0; + ThreadId recordThreadId = nullptr; + int32_t totalSize = 0; bool enableLeakCheck_ = false; MemAllocInfo *leakHead_ = nullptr; int16_t crashCnt_ = -1; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp index f0d3f0521..82c36b1e0 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp @@ -95,7 +95,7 @@ void LiteSurface::AddBuffer() bool LiteSurface::CanRequest(uint8_t wait) { - bool res = false; + bool res = true; if (!freeList_.IsEmpty()) { res = true; goto END; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp index b69f92435..33b1e697b 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp @@ -120,7 +120,7 @@ bool UICustomHexagonsList::OnRotateStartEvent(const RotateEvent& event) bool UICustomHexagonsList::OnRotateEvent(const RotateEvent& event) { - float deltaScale = event.GetRotate() * ROTATE_SCALE_FACTOR * GetRotateFactor(); + float deltaScale = event.GetRotate() * ROTATE_SCALE_FACTOR; float targetScale = globalScale_ + deltaScale; /* -------------------------------------------------------------------------- */ int8_t focusIndex = GetFocusedImgIndex(); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp index 1c93fb728..4cfd78f7b 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp @@ -59,11 +59,9 @@ UILiteSurfaceView::~UILiteSurfaceView() currentBuffer_ = nullptr; } surface_->UnregisterConsumerListener(); - LiteMGfxEngine::GetInstance()->ClearHardwareLayer(this); + LiteMGfxEngine::GetInstance()->ClearHardwareLayer(); GraphicService::GetInstance()->PostGraphicEvent([] { - if (LiteMGfxEngine::GetInstance()->GetHardwareLayer() == nullptr) { - GraphicService::GetInstance()->EnableAsyncMode(true); - } + GraphicService::GetInstance()->EnableAsyncMode(true); }); if (preView_ != nullptr) { @@ -335,10 +333,8 @@ void UILiteSurfaceView::OnBufferAvailable() [&, ws] { if (!ws.expired()) { DisplayDev::GetInstance()->SetLayerColorKey(LAYER_0, false, 0); - LiteMGfxEngine::GetInstance()->ClearHardwareLayer(this); - if (LiteMGfxEngine::GetInstance()->GetHardwareLayer() == nullptr) { - GraphicService::GetInstance()->EnableAsyncMode(true); - } + LiteMGfxEngine::GetInstance()->ClearHardwareLayer(); + LiteMGfxEngine::GetInstance()->EnableAsyncMode(true); surface_->ClearBuffers(); currentBuffer_ = nullptr; lastFlushedBuffer_ = nullptr; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h index 44efc7071..e7c296d93 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h @@ -39,7 +39,6 @@ struct EllipseInfo { struct AsyncSubmitInfo { Rect rect; bool hasPendingFrame; - bool needSwapToPendingFrame; }; class LiteMGfxEngine : public BaseGfxEngine { @@ -133,17 +132,13 @@ public: { hardwareView_ = view; } - IHardwareView* GetHardwareLayer() { return hardwareView_; } - - void ClearHardwareLayer(IHardwareView* view) + void ClearHardwareLayer() { - if (hardwareView_ == view) { - hardwareView_ = nullptr; - } + hardwareView_ = nullptr; } bool HasPendingFrame() @@ -169,7 +164,7 @@ private: BufferInfo* bufferInfo_ = nullptr; BufferInfo* nextBufferInfo_ = nullptr; - AsyncSubmitInfo lastAsyncInfo_ = {{0, 0, 1, 1}, false, false}; + AsyncSubmitInfo lastAsyncInfo_ = {{0, 0, 1, 1}, false}; bool enableAsyncSubmit_ = true; #if ENABLE_VGU_ENGINE @@ -188,6 +183,7 @@ private: void AddHwDraw(uint16_t cnt); void AsyncFlush(); #endif + void FlushInner(const Rect &rect); }; } #endif // GRAPHIC_LITE_LITE_M_GFX_ENGINE_H diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp index 5b29de28b..6dbca60ee 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp @@ -23,19 +23,8 @@ #include "hals/gralloc_engines.h" #include "dfx/dfx_frame_trace.h" -#ifndef _WIN32 -#include "tcxo.h" -#ifdef __cplusplus -extern "C" { -#endif -#include "soc_mipi_tx.h" -#ifdef __cplusplus -}; -#endif -#endif - namespace OHOS { -DisplayDev::DisplayDev() : isDisplayDevInited_(false), devId_(0), layerFuncs_(nullptr), exitUlps_(false) +DisplayDev::DisplayDev() : isDisplayDevInited_{false}, devId_(0), layerFuncs_{nullptr} { for (uint8_t i = LAYER_0; i < LAYER_MAX; i++) { currentBufferId_[i] = 0; @@ -55,11 +44,9 @@ void DisplayDev::LcdFlush(uint8_t layerId) } if (layerFuncs_->Flush != nullptr) { if (layerId == LAYER_MAX) { - TryExitUlps(true); if (layerFuncs_->Flush(0, 0, nullptr) != DISPLAY_SUCCESS) { GRAPHIC_LOGE("flush failed."); } - exitUlps_ = false; return; } uint8_t currentBufferIndex = currentBufferId_[layerId]; @@ -200,7 +187,7 @@ bool DisplayDev::OpenLayer(uint8_t layerId, const LayerInfo& info, uint8_t buffe layer_[layerId].pos.x = 0; layer_[layerId].pos.y = 0; if (layerFuncs_->CreateLayer(devId_, &layer_[layerId].layerInfo, &layer_[layerId].layerHdl) != DISPLAY_SUCCESS) { - UIFree(layer_[layerId].buffer); + free(layer_[layerId].buffer); layer_[layerId].buffer = nullptr; layer_[layerId].layerHdl = 0; layer_[layerId].bufferCount = 0; @@ -234,7 +221,7 @@ void DisplayDev::CloseLayer(uint8_t layerId) return; } - UIFree(layer_[layerId].buffer); + free(layer_[layerId].buffer); layer_[layerId].buffer = nullptr; layer_[layerId].layerHdl = 0; @@ -265,21 +252,6 @@ bool DisplayDev::IsUlpsEnabled(void) #endif } -bool DisplayDev::TryExitUlps(bool isFlushing) -{ - if (IsUlpsEnabled() && !exitUlps_) { -#ifndef _WIN32 - uapi_mipi_tx_exit_ulps(); - if (isFlushing) { - uapi_tcxo_delay_ms(1); - } -#endif - exitUlps_ = true; - return true; - } - return false; -} - bool DisplayDev::IsDoubleBuffer(void) { #if DOUBLE_BUFFER diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/lite_input_distributer.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/lite_input_distributer.cpp index f8a9bfc3c..02aaf218b 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/lite_input_distributer.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/lite_input_distributer.cpp @@ -156,21 +156,6 @@ bool LiteInputDistributer::IsEventEmpty(InputDevType type) return true; } -void LiteInputDistributer::ClearEvent(InputDevType type) -{ - eventLock_.Lock(); - if (type == InputDevType::INDEV_TYPE_TOUCH) { - tpList_.clear(); - deviceData_.state = 0; - } else if (type == InputDevType::INDEV_TYPE_KEY) { - keyList_.clear(); - } else if (type == InputDevType::INDEV_TYPE_ENCODER) - { - encoderDataList_.clear(); - } - eventLock_.Unlock(); -} - #ifdef CONFIG_SUPPORTED_POWERMGR void LiteInputDistributer::SendEventToPM(const RawEvent& event) { diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_check.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_check.cpp index 9725426b4..d16d72726 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_check.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_check.cpp @@ -15,162 +15,170 @@ #include "gfx_utils/mem_check.h" #if ENABLE_MEMORY_CHECK +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "gfx_utils/graphic_log.h" +#include "hal_tick.h" +#include "securec.h" #include "hals/gralloc_engines.h" #ifdef __LITEOS__ #include "los_exc.h" #endif +#define SUPPRESS_DUMP 0 namespace OHOS { -MemCheck::~MemCheck() -{ - ClearMemInfoList(); -} - -void MemCheck::MemCheckInit() -{ - GRAPHIC_LOGI("MemCheck::MemCheckInit"); -} +using std::string; +const uint8_t OFFSET_TIME = 3; -bool MemCheck::InitMemInfoList() +MemCheck::~MemCheck() { - if ((allocHead_ != nullptr) || (allocTail_ != nullptr)) { - GRAPHIC_LOGE("allocHead_ or allocTail_ is already inited."); - return false; + MemAllocInfo* allocPtr = allocHead; + while (allocPtr != nullptr && allocPtr->next != nullptr) { + MemAllocInfo* allocNote = allocPtr->next; + allocPtr->next = allocPtr->next->next; + free(allocNote); + allocNote = nullptr; } - MemAllocInfo* allocNode = (MemAllocInfo*)malloc(sizeof(MemAllocInfo)); - if (allocNode == nullptr) { - GRAPHIC_LOGE("malloc for allocNode failed!"); - return false; + MemRecord* recordPtr = recordHead; + while (recordPtr != nullptr && recordPtr->next != nullptr) { + MemRecord* recordNode = recordPtr->next; + recordPtr->next = recordPtr->next->next; + free(recordNode); + recordNode = nullptr; } - allocNode->address = 0; - allocNode->next = nullptr; - allocNode->size = 0; + allocHead = nullptr; + recordHead = nullptr; - allocHead_ = allocNode; - allocTail_ = allocNode; - return true; + if (fp != nullptr) { + fclose(fp); + fp = nullptr; + } } -void MemCheck::ClearMemInfoList() +void MemCheck::MemCheckInit() { - if (allocHead_ == nullptr) { + GRAPHIC_LOGI("MemCheck::MemCheckInit\n"); + MemRecord* recordNote = (MemRecord*)malloc(sizeof(MemRecord)); + if (recordNote == nullptr) { + initSuc = false; return; } - MemAllocInfo* allocPtr = allocHead_; - while (allocPtr != nullptr && allocPtr->next != nullptr) { - MemAllocInfo* allocNode = allocPtr->next; - allocPtr->next = allocPtr->next->next; - free(allocNode); - allocNode = nullptr; + recordNote->address = 0; + recordNote->size = 0; + recordNote->total = 0; + recordNote->time = 0; + recordNote->next = nullptr; + recordHead = recordNote; + recordTail = recordNote; + MemAllocInfo* allocNote = (MemAllocInfo*)malloc(sizeof(MemAllocInfo)); + if (allocNote == nullptr) { + free(recordNote); + recordNote = nullptr; + initSuc = false; + return; } - free(allocHead_); - allocHead_ = nullptr; - allocTail_ = nullptr; + allocNote->address = 0; + allocNote->next = nullptr; + allocNote->size = 0; + allocHead = allocNote; + allocTail = allocNote; + initSuc = true; + return; } void MemCheck::EnableLeakCheck(bool enable) { - lock_.Lock(); - if (enableLeakCheck_ == enable) { - GRAPHIC_LOGE("Already set leak check: %d", enableLeakCheck_); - lock_.Unlock(); - return; - } - if (enable) { - if (!InitMemInfoList()) { - GRAPHIC_LOGE("EnableLeakCheck failed!"); - lock_.Unlock(); - return; - } + enableLeakCheck_ = enable; + if (enableLeakCheck_) { leakCount_ = 0; leakHead_ = nullptr; - GRAPHIC_LOGP("-----Begin Memory Leak Check----"); } else { - GRAPHIC_LOGP("total count: %d", osal_atomic_read(&totalCnt_)); MemAllocInfo *info = leakHead_; for (; info != nullptr; info = info->next) { GRAPHIC_LOGE("leakcheck: [%d] addr %p size %d", info->count, info->address, info->size); } crashCnt_ = -1; leakSize_ = 0; - ClearMemInfoList(); - GRAPHIC_LOGP("-----End Memory Leak Check----"); } - enableLeakCheck_ = enable; - lock_.Unlock(); } -bool MemCheck::MemAdd(int size, uintptr_t address) +int MemCheck::MemAdd(int size, uintptr_t address) { - osal_atomic_inc(&totalCnt_); - - lock_.Lock(); - if (!enableLeakCheck_) { - lock_.Unlock(); - return false; - } - - MemAllocInfo* allocNode = (MemAllocInfo*)malloc(sizeof(MemAllocInfo)); - if (allocNode == nullptr) { - GRAPHIC_LOGE("MemAdd malloc failed"); - lock_.Unlock(); - return false; + if (!initSuc) { + return -1; } - allocNode->address = address; - allocNode->size = size; - allocNode->next = nullptr; - allocNode->count = -1; - - allocTail_->next = allocNode; - allocTail_ = allocNode; - - leakCount_++; - allocNode->count = leakCount_; - if (leakHead_ == nullptr) { - leakHead_ = allocNode; + MemAllocInfo* allocNote = (MemAllocInfo*)malloc(sizeof(MemAllocInfo)); + if (allocNote == nullptr) { + GRAPHIC_LOGE("MemAdd malloc failed\n"); + return -1; } - if (leakCount_ == crashCnt_) { - if (leakSize_ != allocNode->size) { - GRAPHIC_LOGE("size not right!"); + allocNote->address = address; + allocNote->size = size; + allocNote->next = nullptr; + allocNote->count = -1; + allocTail->next = allocNote; + allocTail = allocNote; + totalSize += allocNote->size; + if (enableLeakCheck_) { + leakCount_++; + allocNote->count = leakCount_; + if (leakHead_ == nullptr) { + leakHead_ = allocNote; } - lock_.Unlock(); + if (leakCount_ == crashCnt_) { + if (leakSize_ != allocNote->size) { + GRAPHIC_LOGE("size not right! %d",allocNote->size); + } #ifdef __LITEOS__ - LOS_Panic("mem leak here!\n"); + LOS_Panic("mem leak here!\n"); #endif + } } - lock_.Unlock(); - return true; +#ifndef VERSION_IOT + if (!isBeyondTime()) { + if (!InsertRecord(address, Opt::ADD, size, totalSize)) { + return -1; + } + } +#endif + return 0; } -bool MemCheck::MemDelete(uintptr_t address) +int MemCheck::MemDelete(uintptr_t address) { - osal_atomic_dec(&totalCnt_); - - lock_.Lock(); - if (!enableLeakCheck_) { - lock_.Unlock(); - return false; - } - if (address == 0) { GRAPHIC_LOGE("MemDelete address is nullptr\n"); - lock_.Unlock(); - return false; + return -1; + } + if (!initSuc) { + return -1; } - MemAllocInfo* allocPtr = allocHead_; + int32_t currNodeSize = 0; + MemAllocInfo* allocPtr = allocHead; while (allocPtr->next != nullptr) { if (allocPtr->next->address == address) { MemAllocInfo *cur = allocPtr->next; - leakHead_ = (leakHead_ == cur) ? cur->next : leakHead_; + leakHead_ = (enableLeakCheck_ && (leakHead_ == cur)) ? cur->next : leakHead_; + currNodeSize = allocPtr->next->size; + totalSize -= currNodeSize; MemAllocInfo* tmpInfo = allocPtr->next; allocPtr->next = allocPtr->next->next; if (allocPtr->next == nullptr) { - allocTail_ = allocPtr; + allocTail = allocPtr; } free(tmpInfo); tmpInfo = nullptr; @@ -178,17 +186,150 @@ bool MemCheck::MemDelete(uintptr_t address) } allocPtr = allocPtr->next; } - lock_.Unlock(); - return true; +#ifndef VERSION_IOT + if (!isBeyondTime()) { + if (!InsertRecord(address, Opt::DEL, currNodeSize, totalSize)) { + return -1; + } + } +#endif + return 0; } void MemCheck::DumpMemInfo() { + int32_t total = 0; + int32_t count = 0; + int32_t max = 0; +#if SUPPRESS_DUMP printf("current malloc/new memory:\n"); - printf("total count: %d\n", osal_atomic_read(&totalCnt_)); +#endif + if(allocHead == nullptr) + return; + MemAllocInfo* allocPtr = allocHead; + while (allocPtr->next != nullptr) { + total += allocPtr->next->size; + if (max < allocPtr->next->size) { + max = allocPtr->next->size; + } + count++; + allocPtr = allocPtr->next; + } + printf("total size=%d, max=%d, count=%d\n", total, max, count); +#if SUPPRESS_DUMP printf("--------\n"); GrallocEngines::GetInstance()->DumpMem(); +#endif +} + +#ifndef VERSION_IOT +bool MemCheck::isBeyondTime() +{ + time_t currTime = time((time_t *)nullptr); + if (currTime - setTime_ > delayTime_) { + return true; + } + return false; +} + +bool MemCheck::InsertRecord(uintptr_t address, Opt opt, int32_t size, int32_t total) +{ + MemRecord* recordNote = (MemRecord*)malloc(sizeof(MemRecord)); + if (recordNote == nullptr) { + GRAPHIC_LOGE("MemAdd malloc failed\n"); + return false; + } + recordNote->address = address; + recordNote->opt = opt; + recordNote->size = size; + recordNote->time = time(0); + recordNote->total = total; + recordNote->next = nullptr; + recordTail->next = recordNote; + recordTail = recordNote; + return true; +} + +static void* SaveMemInfo(void* arg) +{ + MemCheck::GetInstance()->SaveRecordInfo(); + return nullptr; +} + +void MemCheck::SaveRecordInfo() +{ + // sleep 1s, wait main thread set delaytime + sleep(1); + time_t currTime = time((time_t *)nullptr); + while ((currTime - setTime_) < (delayTime_ + OFFSET_TIME)) { + MemRecord* recordPtr = recordHead; + while (recordPtr->next != nullptr) { + MemRecord* recordNote = recordPtr->next; + recordPtr->next = recordPtr->next->next; + struct tm *sttm = localtime(&(recordNote->time)); + // 1900: year + fprintf(fp, "%04u-%02u-%02u %02u:%02u:%02u addr=0x%x %s size:%d total:%d\n", sttm->tm_year + 1900, + sttm->tm_mon+1, sttm->tm_mday, sttm->tm_hour, sttm->tm_min, sttm->tm_sec, recordNote->address, + recordNote->opt == Opt::ADD ? "add" : "del", recordNote->size, recordNote->total); + free(recordNote); + recordNote = nullptr; + } + recordTail = recordHead; + fflush(fp); + + sleep(2); // 2: sleep time + currTime = time((time_t *)nullptr); + } + fclose(fp); + fp = nullptr; + recordThreadId = nullptr; +} + +bool MemCheck::CreateRecordFile() +{ + char currPath[16] = "/user/mem/"; + if (access(currPath, F_OK) == -1) { + GRAPHIC_LOGD("dir %s not exist, create dir\n", currPath); + if (mkdir(currPath, 0777) != 0) { // 0777: permission mode + GRAPHIC_LOGE("create dir %s failed , errno = %d : %s\n", currPath, errno, strerror(errno)); + return false; + } + } + char path[20] = ""; + if (sprintf_s(path, sizeof(path), "%s%d", currPath, getpid()) == -1) { + GRAPHIC_LOGE("MemCheckInit sprintf_s failed\n"); + return false; + } + fp = fopen(path, "w+"); + if (fp == nullptr) { + GRAPHIC_LOGE("open mem file %s failed ,errno = %d : %s\n", path, errno, strerror(errno)); + return false; + } + return true; } + +void MemCheck::CollectMemory(uint32_t delayTime) +{ + if (!initSuc) { + GRAPHIC_LOGE("Init failed!\n"); + return; + } + if (fp == nullptr && !CreateRecordFile()) { + return; + } + + if (recordThreadId == nullptr) { + recordThreadId = ThreadCreate(SaveMemInfo, nullptr, nullptr); + if (recordThreadId == nullptr) { + GRAPHIC_LOGE("create thread failed!!\n"); + return; + } + } + setTime_ = time(0); + delayTime_ = delayTime; + DumpMemInfo(); +} +#endif } // namespace OHOS #endif diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_custom.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_custom.cpp index 664c3c9fd..7b1656278 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_custom.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_custom.cpp @@ -46,6 +46,9 @@ void ImageCacheFree(ImageInfo& info) return; } + if (LiteMGfxEngine::GetInstance()->IsAsyncModeEnabled()) { + LiteMGfxEngine::GetInstance()->Flush(Rect(0, 0, 0, 0)); + } LiteMGfxEngine::GetInstance()->SyncHwDraw(); GrallocEngines::GetInstance()->FreeBuffer(const_cast(info.data)); info.phyAddr = nullptr; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h index fcae1dd8c..7d4094d31 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h @@ -143,7 +143,6 @@ public: uint32_t CalcStride(uint32_t width, PixelFormat fmt); bool IsUlpsEnabled(void); - bool TryExitUlps(bool isFlushing); bool IsDoubleBuffer(void); /** @@ -170,7 +169,6 @@ private: uint32_t devId_; LayerFuncs* layerFuncs_; uint8_t currentBufferId_[LAYER_MAX]; - bool exitUlps_; #ifdef LAYER_PF_ARGB1555 const uint8_t layerBpp_ = 16; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/lite_input_distributer.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/lite_input_distributer.h index 039b4e97b..7244a4417 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/lite_input_distributer.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/lite_input_distributer.h @@ -39,7 +39,6 @@ public: void GetEventData(DeviceData& data, InputDevType type); void SetEventData(const RawEvent& event); bool IsEventEmpty(InputDevType type); - void ClearEvent(InputDevType type); #ifdef CONFIG_SUPPORTED_POWERMGR void SendEventToPM(const RawEvent& event); #endif diff --git a/code/sdk/middleware/services/gui/uikit/res/image_background_circle.bin b/code/sdk/middleware/services/gui/uikit/res/image_background_circle.bin deleted file mode 100644 index 3998f5c66..000000000 --- a/code/sdk/middleware/services/gui/uikit/res/image_background_circle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:129286d49d6097dd71c38311f24ea9cad9da01ea7ea3a1160b45731fbe9eb600 -size 237624 diff --git a/code/sdk/middleware/services/gui/uikit/res/kaleidoscope_circle.bin b/code/sdk/middleware/services/gui/uikit/res/kaleidoscope_circle.bin deleted file mode 100644 index 15be273ea..000000000 --- a/code/sdk/middleware/services/gui/uikit/res/kaleidoscope_circle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bda994196a6f1887261fad0b0af108eb64dc2be14abc6581ef3ec2c7e1afbbb3 -size 99864 diff --git a/code/sdk/middleware/services/gui/uikit/res/planet_circle.bin b/code/sdk/middleware/services/gui/uikit/res/planet_circle.bin deleted file mode 100644 index 770fd45ab..000000000 --- a/code/sdk/middleware/services/gui/uikit/res/planet_circle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:81d23195839a6cf705c083957b110a235227d40784f3b644b94b795555de2654 -size 95784 diff --git a/code/sdk/middleware/services/gui/uikit/res/rainbow_circle.bin b/code/sdk/middleware/services/gui/uikit/res/rainbow_circle.bin deleted file mode 100644 index da8559e35..000000000 --- a/code/sdk/middleware/services/gui/uikit/res/rainbow_circle.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:25263b886947c791d585e3a26f575bc40dcefe85bb733b759f56424d9af2e51a -size 72184 diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_icosahedron/ui_test_icosahedron.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_icosahedron/ui_test_icosahedron.cpp index e07b3f806..2d2352809 100644 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_icosahedron/ui_test_icosahedron.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_icosahedron/ui_test_icosahedron.cpp @@ -100,9 +100,7 @@ void UITestIcosahedron::TearDown() const UIView* UITestIcosahedron::GetTestView() { - if (enterAnimator_ != nullptr) { - enterAnimator_->Start(); - } + enterAnimator_->Start(); return container_; } } \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_slipflow/ui_test_slipflow.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_slipflow/ui_test_slipflow.cpp deleted file mode 100644 index eb7936847..000000000 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_slipflow/ui_test_slipflow.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2024. All rights reserved. - * Description: UITestSlip - * Author: - * Create: 2024-08 - */ - -#include "ui_test_slipflow.h" -#include "common/screen.h" -#include "font/ui_font.h" -#include "gfx_utils/graphic_math.h" -#include "gfx_utils/rect.h" -#include "common/image_cache_manager.h" - -namespace OHOS { -namespace { -struct FaceInfo { - const char* name; - const char* path; -} ; - -static constexpr uint8_t SLIPFLOW_MAX_PAGE_NUM = 6; -static FaceInfo g_faceInfo[SLIPFLOW_MAX_PAGE_NUM] = { - {"1 rainbow", RES_PATH"/rainbow_circle.bin"}, - {"2 kaleidoscope", RES_PATH"/kaleidoscope_circle.bin"}, - {"3 planet", RES_PATH"/planet_circle.bin"}, - {"4 rainbow", RES_PATH"/rainbow_circle.bin"}, - {"5 kaleidoscope", RES_PATH"/kaleidoscope_circle.bin"}, - {"6 planet", RES_PATH"/planet_circle.bin"} -}; -static constexpr const char* BACK_IMAGE_PATH = RES_PATH"/image_background_circle.bin"; - -static constexpr uint8_t SLIPFLOW_PRELOAD_PAGE_NUM = 3; -static constexpr int16_t LABEL_FONT_SIZE = 30; -static constexpr uint8_t DEFAULT_STEP = 10; -static constexpr uint16_t BUTTON_WIDTH = 60; -static constexpr uint16_t BUTTON_HEIGHT = 40; -static constexpr uint16_t BUTTON_GROUP_WIDTH = 300; -static constexpr uint16_t BUTTON_GROUP_HEIGHT = 80; -static constexpr uint8_t DIVISOR_TWO = 2; -static constexpr uint16_t PAGE_WIDTH = 200; -static constexpr uint16_t PAGE_HEIGHT = 200; -} // namespace - -void UITestSlipflow::SetUp() -{ - if (container_ == nullptr) { - container_ = new UIScrollView(); - container_->SetThrowDrag(true); - container_->SetHorizontalScrollState(false); - container_->Resize(Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - } -} - -void UITestSlipflow::TearDown() -{ - container_->Remove(slipflow_); - DeleteChildren(container_); - if (container_ != nullptr) { - container_ = nullptr; - } - delete slipflow_; - slipflow_ = nullptr; - - label_ = nullptr; - slipUpNoticelabel_ = nullptr; - lastIndex_ = 0; - showBtn_ = nullptr; - isShowBtnGrp_ = false; - btnGrp_ = nullptr; - loadNum_ = 0; - - imgWidthAddBtn_ = nullptr; - imgWidthSubBtn_ = nullptr; - - imgWidth_ = 200; // 200: default value - imgPadding_ = 50; // 50: default value - mirrorOpa_ = 30; // 30: default value - rotateAngle_ = 70.0f; // 70: default value -} - -const UIView* UITestSlipflow::GetTestView() -{ - UITestSlipflowView(); - return container_; -} - -void UITestSlipflow::CreateLabelButton(UILabelButton** btn, const char* tile, int16_t x, int16_t y) -{ - UILabelButton* tempBtn = nullptr; - if (tempBtn == nullptr) { - tempBtn = new UILabelButton(); - } - tempBtn->SetPosition(x, y, BUTTON_WIDTH, BUTTON_HEIGHT); - tempBtn->SetText(tile); - tempBtn->SetOnClickListener(this); - btnGrp_->Add(tempBtn); - *btn = tempBtn; -} - -void UITestSlipflow::InitButtonGroup() -{ - if (showBtn_ == nullptr) { - showBtn_ = new UIButton(); - showBtn_->SetPosition(202, 10, BUTTON_WIDTH, BUTTON_HEIGHT); // 202: x position 10: y position - showBtn_->SetStyleForState(STYLE_BACKGROUND_OPA, 0, UIButton::ButtonState::RELEASED); - showBtn_->SetStyleForState(STYLE_BACKGROUND_OPA, 0, UIButton::ButtonState::PRESSED); - showBtn_->SetOnClickListener(this); - container_->Add(showBtn_); - } - if (btnGrp_ == nullptr) { - btnGrp_ = new UIViewGroup(); - btnGrp_->SetPosition(77, 40, BUTTON_GROUP_WIDTH, BUTTON_GROUP_HEIGHT); // 77: x position 40: y position - btnGrp_->SetStyle(STYLE_BACKGROUND_OPA, 0); - btnGrp_->SetVisible(false); - container_->Add(btnGrp_); - } - CreateLabelButton(&imgWidthAddBtn_, "wid+", 0, 0); - CreateLabelButton(&imgWidthSubBtn_, "wid-", 60, 0); // 60: x position -} - -void UITestSlipflow::UITestSlipflowView() -{ - if (container_ != nullptr) { - if (slipflow_ == nullptr) { - slipflow_ = new UISlipflowView(); - } - slipflow_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - slipflow_->SetIntercept(true); - slipflow_->SetThrowDrag(true); - slipflow_->SetPageSize(PAGE_WIDTH, PAGE_HEIGHT); - slipflow_->SetOnSlipflowListener(this); - UITestSlipflowViewInitFlow(); - - if (label_ == nullptr) { - label_ = new UILabel(); - } - label_->SetPosition(127, 50, 200, 50); // 127 50 200 50: label position - label_->SetTextColor(Color::White()); - label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - lastIndex_ = slipflow_->GetCurrentPage(); - label_->SetText(g_faceInfo[lastIndex_].name); - label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_FONT_SIZE); - if (slipUpNoticelabel_ == nullptr) { - slipUpNoticelabel_ = new UILabel(); - } - slipUpNoticelabel_->SetPosition(127, 400, 200, 50); // 127 400 200 50: label position - slipUpNoticelabel_->SetTextColor(Color::White()); - slipUpNoticelabel_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - slipUpNoticelabel_->SetText("继续上滑删除"); - slipUpNoticelabel_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); // 30 : font size - slipUpNoticelabel_->SetVisible(false); - container_->Add(slipflow_); - container_->Add(label_); - container_->Add(slipUpNoticelabel_); - InitButtonGroup(); - } -} - -void UITestSlipflow::UITestSlipflowViewInitFlow() -{ - for (uint8_t i = 0; i < SLIPFLOW_MAX_PAGE_NUM; i++) { - UIImageView* image = new UIImageView(); - ImageInfo* src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(g_faceInfo[i].path)); - image->SetViewId(g_faceInfo[i].name); - image->SetSrc(src); - image->Resize(PAGE_WIDTH, PAGE_HEIGHT); - image->SetResizeMode(UIImageView::ImageResizeMode::FILL); - image->SetAutoEnable(false); - UIViewGroup* group = new UIViewGroup(); - group->SetViewId(g_faceInfo[i].name); - group->SetPosition(0, 0, PAGE_WIDTH, Screen::GetInstance().GetHeight()); - group->SetStyle(STYLE_BACKGROUND_OPA, 0); - group->SetDragParentInstead(true); - UIImageView* backImage = new UIImageView(); - backImage->SetSrc(ImageCacheManager::GetInstance().LoadSingleRes(std::string(BACK_IMAGE_PATH))); - backImage->Resize(PAGE_WIDTH, PAGE_HEIGHT); - backImage->SetResizeMode(UIImageView::ImageResizeMode::FILL); - backImage->SetAutoEnable(false); - group->Add(backImage); - group->Add(image); - slipflow_->Add(group); - backImage->LayoutCenterOfParent(); - image->LayoutCenterOfParent(); - loadNum_++; - } -} - -bool UITestSlipflow::OnScroll(int16_t distance) -{ - if (slipflow_->GetChildrenNumber() == 0) { - label_->SetText(""); - return true; - } - int16_t contMidX = static_cast(Screen::GetInstance().GetWidth() / DIVISOR_TWO); - int16_t minOffset = contMidX; - uint8_t newCenterIndex = lastIndex_; - for (uint8_t i = 0; i < slipflow_->GetChildrenNumber(); i++) { - Rect rect = slipflow_->GetViewByIndex(i)->GetOrigRect(); - int16_t x = rect.GetLeft(); - int16_t x1 = rect.GetRight(); - int16_t xMid = static_cast(x + (x1 - x + 1) / DIVISOR_TWO); - int16_t distance = MATH_ABS(xMid - contMidX); - if (distance < minOffset) { - newCenterIndex = i; - minOffset = distance; - } - } - if (newCenterIndex != lastIndex_) { - lastIndex_ = newCenterIndex; - label_->SetText(slipflow_->GetViewByIndex(lastIndex_)->GetViewId()); - } - - Rect curViewRect = slipflow_->GetViewByIndex(lastIndex_)->GetOrigRect(); - int16_t centerMid = curViewRect.GetLeft() + curViewRect.GetWidth() / DIVISOR_TWO; - int16_t offset = MATH_ABS(contMidX - centerMid); - if (offset > curViewRect.GetWidth() / DIVISOR_TWO) { - label_->SetStyle(STYLE_TEXT_OPA, 0); - } else { - uint8_t alpha = (uint8_t)((1.0f - ((float)offset / (curViewRect.GetWidth() / DIVISOR_TWO))) * OPA_OPAQUE); - label_->SetStyle(STYLE_TEXT_OPA, alpha); - } - return true; -} - -void UITestSlipflow::OnScrollUpStart() -{ - label_->SetVisible(false); - slipUpNoticelabel_->SetVisible(true); -} - -void UITestSlipflow::OnScrollUpEnd() -{ - OnScroll(0); - label_->SetVisible(true); - slipUpNoticelabel_->SetVisible(false); -} - -void UITestSlipflow::OnRefreshPageOpaScale(UIView* view, int16_t xOffset, int16_t yOffset) -{ - UIView* image = static_cast(view)->GetChildrenHead()->GetNextSibling(); - if (xOffset < 0) { - image->SetOpaScale(OPA_OPAQUE); - } else if (xOffset > slipflow_->GetPageWidth()) { - image->SetOpaScale(0); - } else { - uint8_t alpha = (uint8_t)(OPA_OPAQUE * (1.0f - ((float)xOffset / slipflow_->GetPageWidth()))); - image->SetOpaScale(alpha); - } - if (yOffset > 0) { - if (yOffset > (slipflow_->GetPageHeight() / DIVISOR_TWO)) { - image->SetOpaScale(OPA_OPAQUE * 0.4f); - } else { - uint8_t alpha = (uint8_t)(OPA_OPAQUE * - (1.0f - 0.6f * ((float)yOffset / (slipflow_->GetPageHeight() / DIVISOR_TWO)))); - image->SetOpaScale(alpha); - } - } -} - -bool UITestSlipflow::OnRemove(UIView* view) -{ - if (view == nullptr) { - return false; - } - UIViewGroup* group = static_cast(view); - UIView* curView = group->GetChildrenHead(); - UIView* deleteView = nullptr; - while (curView != nullptr) { - deleteView = curView; - curView = curView->GetNextSibling(); - group->Remove(deleteView); - delete deleteView; - deleteView = nullptr; - } - delete group; - group = nullptr; - return true; -} - -bool UITestSlipflow::OnClick(UIView& view, const ClickEvent& event) -{ - if (&view == showBtn_) { - btnGrp_->SetVisible(!btnGrp_->IsVisible()); - } else if (&view == imgWidthAddBtn_) { - imgWidth_ += DEFAULT_STEP; - slipflow_->SetPageSize(imgWidth_, imgWidth_); - } else if (&view == imgWidthSubBtn_) { - imgWidth_ -= DEFAULT_STEP; - slipflow_->SetPageSize(imgWidth_, imgWidth_); - } - slipflow_->Invalidate(); - return true; -} -} // namespace OHOS diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_slipflow/ui_test_slipflow.h b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_slipflow/ui_test_slipflow.h deleted file mode 100644 index 17ee5adae..000000000 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_slipflow/ui_test_slipflow.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2024. All rights reserved. - * Description: UITestSlip - * Author: - * Create: 2024-08 - */ - -#ifndef UI_TEST_SLIPFLOW_VIEW_H -#define UI_TEST_SLIPFLOW_VIEW_H - -#include "components/ui_slipflow_view.h" -#include "components/ui_scroll_view.h" -#include "components/ui_label_button.h" -#include "animator/animator.h" -#include "ui_test.h" - -namespace OHOS { -class UITestSlipflow : public UITest, - public UISlipflowView::OnSlipflowScrollListener, public UIView::OnClickListener { -public: - UITestSlipflow() {} - ~UITestSlipflow() override {} - void SetUp() override; - void TearDown() override; - const UIView* GetTestView() override; - /** - * @brief Test display UISlipflow - */ - void UITestSlipflowView(); - void UITestSlipflowViewInitFlow(); - - bool OnScroll(int16_t distance) override; - void OnScrollUpStart() override; - void OnScrollUpEnd() override; - void OnRefreshPageOpaScale(UIView* view, int16_t xOffset, int16_t yOffset) override; - - bool OnRemove(UIView* view) override; - - bool OnClick(UIView& view, const ClickEvent& event) override; -private: - void InitButtonGroup(); - void CreateLabelButton(UILabelButton** btn, const char* tile, int16_t x, int16_t y); - - UIScrollView* container_ = nullptr; - UISlipflowView* slipflow_ = nullptr; - UILabel* label_ = nullptr; - UILabel* slipUpNoticelabel_ = nullptr; - uint16_t lastIndex_ = 0; - UIButton* showBtn_ = nullptr; - bool isShowBtnGrp_ = false; - UIViewGroup* btnGrp_ = nullptr; - uint8_t loadNum_ = 0; - UILabelButton* addBtn_ = nullptr; - UILabelButton* removeBtn_ = nullptr; - UILabelButton* imgWidthAddBtn_ = nullptr; - UILabelButton* imgWidthSubBtn_ = nullptr; - UILabelButton* imgPaddingAddBtn_ = nullptr; - UILabelButton* imgPaddingSubBtn_ = nullptr; - UILabelButton* maxAngleAddBtn_ = nullptr; - UILabelButton* maxAngleSubBtn_ = nullptr; - UILabelButton* loopBtn_ = nullptr; - uint16_t imgWidth_ = 200; // 200: default value - uint16_t imgPadding_ = 50; // 50: default value - uint8_t mirrorOpa_ = 30; // 30: default value - float rotateAngle_ = 70.0f; // 70: default value -}; -} // namespace OHOS -#endif // UI_TEST_SLIPFLOW_VIEW_H diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp index 156f248d3..ce6b1e7cd 100755 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp @@ -81,14 +81,14 @@ public: tempView->SetViewId(view.GetViewId()); tempView->SetPosition(tempView->GetX(), tempView->GetY()); rootView->Add(tempView); + if (backBtn_ == nullptr) { + backBtn_ = new TransparentBackButton(); + backBtn_->SetPosition(0, (Screen::GetInstance().GetHeight() - BACK_BUTTON_SIZE) / 2, // 2, half size + BACK_BUTTON_SIZE, BACK_BUTTON_SIZE); + } + backBtn_->SetViewId(view.GetViewId()); + rootView->Add(backBtn_); } - if (backBtn_ == nullptr) { - backBtn_ = new TransparentBackButton(); - backBtn_->SetPosition(0, (Screen::GetInstance().GetHeight() - BACK_BUTTON_SIZE) / 2, // 2, half size - BACK_BUTTON_SIZE, BACK_BUTTON_SIZE); - } - backBtn_->SetViewId(view.GetViewId()); - rootView->Add(backBtn_); rootView->Invalidate(); return true; } diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp index a1d44f4cc..3e1c2cb38 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp @@ -17,9 +17,6 @@ #include "common/task_manager.h" #include "gfx_utils/graphic_log.h" #include "dock/pointer_input_device.h" -#include "dock/rotate_input_device.h" -#include "hals/lite_input_distributer.h" -#include "gfx_utils/input_event_info.h" namespace OHOS { InputDeviceManager* InputDeviceManager::GetInstance() @@ -97,40 +94,4 @@ void InputDeviceManager::ClearPressableViews() node = node->next_; } } - -void InputDeviceManager::ClearRotateState() -{ - ListNode* node = deviceList_.Begin(); - while (node != deviceList_.End()) { - RotateInputDevice* device = dynamic_cast(node->data_); - if (device != nullptr) { - device->ResetRotateState(); - } - node = node->next_; - } -} - -void InputDeviceManager::ClearInputDeviceState(InputDeviceManager::InputDeviceType type) -{ - switch (type) { - case InputDeviceManager::InputDeviceType::ALL: - InputDeviceManager::GetInstance()->ClearPressableViews(); - InputDeviceManager::GetInstance()->ClearRotateState(); - LiteInputDistributer::GetInstance()->ClearEvent(InputDevType::INDEV_TYPE_TOUCH); - LiteInputDistributer::GetInstance()->ClearEvent(InputDevType::INDEV_TYPE_KEY); - break; - case InputDeviceManager::InputDeviceType::POINT: - LiteInputDistributer::GetInstance()->ClearEvent(InputDevType::INDEV_TYPE_TOUCH); - InputDeviceManager::GetInstance()->ClearPressableViews(); - break; - case InputDeviceManager::InputDeviceType::ROTATE: - InputDeviceManager::GetInstance()->ClearRotateState(); - break; - case InputDeviceManager::InputDeviceType::KEY: - LiteInputDistributer::GetInstance()->ClearEvent(InputDevType::INDEV_TYPE_KEY); - default: - GRAPHIC_LOGE("Cannot clear state of the input device: %d!", type); - break; - } -} } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/screen.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/screen.cpp index 9ad0ce4aa..02e33f92a 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/screen.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/screen.cpp @@ -106,6 +106,9 @@ bool Screen::GetScreenBitmapByRect(ImageInfo& info, const Rect* rect) BlendOption opt; opt.opacity = OPA_OPAQUE; opt.mode = BLEND_SRC; + if (LiteMGfxEngine::GetInstance()->IsAsyncModeEnabled()) { + LiteMGfxEngine::GetInstance()->Flush(Rect(0, 0, 0, 0)); + } BaseGfxEngine::GetInstance()->Blit(dstInfo, {0, 0}, srcInfo, dstRect, opt); #if ENABLE_VGU_ENGINE LiteMGfxEngine::GetInstance()->SyncHwDraw(); diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_abstract_scroll.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_abstract_scroll.cpp index 00be014d4..7f0dc554c 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_abstract_scroll.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_abstract_scroll.cpp @@ -362,7 +362,7 @@ bool UIAbstractScroll::OnRotateEvent(const RotateEvent& event) bool UIAbstractScroll::OnRotateEndEvent(const RotateEvent& event) { - if (memset_s(lastDelta_, sizeof(lastDelta_), 0, sizeof(lastDelta_)) != EOK) { + if (memset_s(lastDelta_, MAX_DELTA_SIZE, 0, MAX_DELTA_SIZE) != EOK) { return UIView::OnRotateEndEvent(event); } diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_canvas.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_canvas.cpp index 29ec415d7..ef35024a7 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_canvas.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_canvas.cpp @@ -21,61 +21,6 @@ #include "gfx_utils/graphic_log.h" namespace OHOS { -void Paint::Scale(float scaleX, float scaleY) -{ - this->scaleRadioX_ *= scaleX; - this->scaleRadioY_ *= scaleX; - if (rotateAngle_ > 0.0f || rotateAngle_ < 0) { - transfrom_.Rotate(-rotateAngle_ * UI_PI / BOXER); - transfrom_.Scale(scaleX, scaleY); - transfrom_.Rotate(rotateAngle_ * UI_PI / BOXER); - } else { - transfrom_.Scale(scaleX, scaleY); - } -} - -void Paint::Rotate(float angle) -{ - transfrom_.Rotate(angle * UI_PI / BOXER); - rotateAngle_ += angle; -} - -void Paint::Rotate(float angle, int16_t x, int16_t y) -{ - transfrom_.Translate(-x, -y); - transfrom_.Rotate(angle * UI_PI / BOXER); - rotateAngle_ += angle; - transfrom_.Translate(x, y); -} - -void Paint::Translate(int16_t x, int16_t y) -{ - transfrom_.Translate(x, y); - this->translationX_ += x; - this->translationY_ += y; -} - -void Paint::SetTransform(float scaleX, float shearX, float shearY, - float scaleY, int16_t transLateX, int16_t transLateY) -{ - transfrom_.Reset(); - rotateAngle_ = 0; - Transform(scaleX, shearX, shearY, scaleY, transLateX, transLateY); -} - -void Paint::Transform(float scaleX, float shearX, float shearY, float scaleY, int16_t transLateX, int16_t transLateY) -{ - this->translationX_ += transLateX; - this->translationY_ += transLateY; - transLateX += transfrom_.GetData()[2]; // 2: index - transLateY += transfrom_.GetData()[5]; // 5: index - transfrom_.Translate(-transfrom_.GetData()[2], -transfrom_.GetData()[5]); // 2 5: index - Scale(scaleX, scaleY); - transfrom_.Translate(transLateX, transLateY); - transfrom_.SetData(1, transfrom_.GetData()[1] + shearX); - transfrom_.SetData(3, transfrom_.GetData()[3] + shearY); // 3: index -} - UICanvas::UICanvasPath::~UICanvasPath() { points_.Clear(); @@ -450,63 +395,33 @@ void UICanvas::DrawImage(const Point& startPoint, const char* image, const Paint return; } - if (static_cast(paint.GetStyle()) & Paint::PaintStyle::FILL_STYLE) { - UIImageView* imageView = new UIImageView(); - if (imageView == nullptr) { - GRAPHIC_LOGE("new UIImageView fail"); - return; - } - imageView->SetPosition(startPoint.x, startPoint.y); - imageView->SetSrc(image); - - DrawCmd cmd; - cmd.paint = paint; - cmd.param = imageView; - cmd.DeleteParam = DeleteImageView; - cmd.DrawGraphics = DoDrawImage; - drawCmdList_.PushBack(cmd); - - Invalidate(); - SetStartPosition(startPoint); + ImageParam* imageParam = new ImageParam; + if (imageParam == nullptr) { + GRAPHIC_LOGE("new ImageParam fail"); + return; } -} - -void UICanvas::DrawImage(const Point& startPoint, const char* image, - const Paint& paint, int16_t width, int16_t height) -{ - if (image == nullptr) { + imageParam->image = new Image(); + if (imageParam->image == nullptr) { + delete imageParam; + imageParam = nullptr; return; } - if (static_cast(paint.GetStyle()) & Paint::PaintStyle::FILL_STYLE) { - UIImageView* imageView = new UIImageView(); - if (imageView == nullptr) { - GRAPHIC_LOGE("new UIImageView fail"); - return; - } - imageView->SetPosition(startPoint.x, startPoint.y); - imageView->SetSrc(image); - float scaleX = 1.0; - float scaleY = 1.0; - if (width > 0 && imageView->GetWidth() > 0) { - scaleX = (float)width / (float)imageView->GetWidth(); - } - if (height > 0 && imageView->GetHeight() > 0) { - scaleY = (float)height / (float)imageView->GetHeight(); - } - DrawCmd cmd; - cmd.paint = paint; - cmd.paint.Scale(scaleX, scaleY); - cmd.param = imageView; - cmd.DeleteParam = DeleteImageView; - cmd.DrawGraphics = DoDrawImage; - drawCmdList_.PushBack(cmd); - Invalidate(); - SetStartPosition(startPoint); - } + imageParam->image->SetSrc(image); + ImageHeader header = {0}; + imageParam->image->GetHeader(header); + imageParam->start = startPoint; + imageParam->height = header.height; + imageParam->width = header.width; + + DrawCmd cmd; + cmd.paint = paint; + cmd.param = imageParam; + cmd.DeleteParam = DeleteImageParam; + cmd.DrawGraphics = DoDrawImage; + drawCmdList_.PushBack(cmd); Invalidate(); - SetStartPosition(startPoint); } void UICanvas::DrawPath(const Paint& paint) @@ -759,23 +674,21 @@ void UICanvas::DoDrawImage(BufferInfo& gfxDstBuffer, if (param == nullptr) { return; } - UIImageView* imageView = static_cast(param); - Point startPos = {imageView->GetX(), imageView->GetY()}; + ImageParam* imageParam = static_cast(param); + + if (imageParam->image == nullptr) { + return; + } + Point start; - GetAbsolutePosition({startPos.x, startPos.y}, rect, style, start); - imageView->SetPosition(start.x, start.y); - if (!paint.GetTransAffine().IsIdentity()) { - float angle = paint.GetRotateAngle(); - imageView->Rotate(MATH_ROUND(angle), Vector2(0, 0)); - imageView->Translate(Vector3(paint.GetTranslateX(), paint.GetTranslateY(), 1)); - Vector2 scale(static_cast(paint.GetScaleX()), static_cast(paint.GetScaleY())); - imageView->Scale(scale, Vector2(0, 0)); - TransAffine affine = paint.GetTransAffine(); - imageView->Shear(Vector2(affine.GetData()[1], 0), Vector2(affine.GetData()[3], 0), - Vector2(0, 0)); - } - imageView->OnDraw(gfxDstBuffer, invalidatedArea); - imageView->SetPosition(startPos.x, startPos.y); + GetAbsolutePosition(imageParam->start, rect, style, start); + + Rect cordsTmp; + cordsTmp.SetPosition(start.x, start.y); + cordsTmp.SetHeight(imageParam->height); + cordsTmp.SetWidth(imageParam->width); + DrawImage::DrawCommon(gfxDstBuffer, cordsTmp, invalidatedArea, + imageParam->image->GetPath(), style, paint.GetOpacity()); } void UICanvas::DoDrawLabel(BufferInfo& gfxDstBuffer, 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 c3db5d484..0fa53ac70 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 @@ -338,6 +338,7 @@ void UILabel::SetTextTransformMap(TransformMap& transMap) { InitLabelText(); labelText_->SetTransformMap(transMap); + SetTransformMap(transMap); } void UILabel::RefreshLabel() diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp index 86db75298..242f67e9a 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp @@ -380,13 +380,10 @@ bool UIList::DragYInner(int16_t distance) } distance = CalculateElasticDragLen(reboundSize, offset, distance); } - if (childrenTail_->GetRelativeRect().GetBottom() < + if ((childrenTail_->GetRelativeRect().GetBottom() + distance) < (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { - distance = 0; - } else if ((childrenTail_->GetRelativeRect().GetBottom() + distance) < - (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { - distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) - - childrenTail_->GetRelativeRect().GetBottom(); + distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) + - childrenTail_->GetRelativeRect().GetBottom(); } } } diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp index 5cc83f374..e3b110b8a 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp @@ -154,6 +154,10 @@ void UIQrcode::SetQrcodeVal(const uint8_t* val, uint32_t length) void UIQrcode::FillImgBackground(ImageInfo& info) { + if (LiteMGfxEngine::GetInstance()->IsAsyncModeEnabled()) { + LiteMGfxEngine::GetInstance()->Flush(Rect(0, 0, 0, 0)); + } + BufferInfo gfxDstBuffer; gfxDstBuffer.virAddr = static_cast(const_cast(info.data)); gfxDstBuffer.phyAddr = gfxDstBuffer.virAddr; diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_swipe_view.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_swipe_view.cpp index 47c85fc66..35b3350ca 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_swipe_view.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_swipe_view.cpp @@ -254,10 +254,6 @@ bool UISwipeView::OnRotateStartEvent(const RotateEvent& event) bool UISwipeView::OnRotateEndEvent(const RotateEvent& event) { - if (memset_s(lastDelta_, sizeof(lastDelta_), 0, sizeof(lastDelta_)) != EOK) { - return UIView::OnRotateEndEvent(event); - } - uint8_t dir; if (direction_ == HORIZONTAL) { dir = (lastRotateLen_ >= 0) ? DragEvent::DIRECTION_LEFT_TO_RIGHT : DragEvent::DIRECTION_RIGHT_TO_LEFT; diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp index ec59ffcc8..6576e95f1 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp @@ -1116,6 +1116,10 @@ bool UIView::GetBitmap(ImageInfo& bitmap) uint16_t bufferWidth = static_cast(mask.GetWidth()); uint16_t bufferHeight = static_cast(mask.GetHeight()); + if (LiteMGfxEngine::GetInstance()->IsAsyncModeEnabled()) { + LiteMGfxEngine::GetInstance()->Flush(Rect(0, 0, 0, 0)); + } + #ifdef _WIN32 bitmap.header.colorMode = ARGB8888; #else diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/focus_manager.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/focus_manager.cpp index ea660502d..72b7944b8 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/focus_manager.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/focus_manager.cpp @@ -18,7 +18,6 @@ #include "components/root_view.h" #include "gfx_utils/graphic_math.h" #include "common/input_method_manager.h" -#include "common/input_device_manager.h" namespace OHOS { FocusManager* FocusManager::GetInstance() @@ -51,7 +50,6 @@ bool FocusManager::ClearFocus() lastFocusView_ = focusView_; focusView_->Blur(); focusView_ = nullptr; - InputDeviceManager::GetInstance()->ClearInputDeviceState(InputDeviceManager::InputDeviceType::ROTATE); return true; } diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h index 43d2672dd..bd89a1919 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h @@ -26,17 +26,6 @@ namespace OHOS { */ class InputDeviceManager : public Task { public: -enum class InputDeviceType { - /** All registered input device*/ - ALL = 0, - /** Point input device */ - POINT = 1, - /** Key input device */ - KEY = 2, - /** Rotate input device */ - ROTATE = 3, -}; - /** * @brief Get instance of InputDeviceManager. * @returns Instance of InputDeviceManager @@ -64,11 +53,6 @@ enum class InputDeviceType { */ void Clear(); - /** - * Clear state of input devices. - */ - void ClearInputDeviceState(InputDeviceManager::InputDeviceType type = InputDeviceManager::InputDeviceType::ALL); - /** * Clear pressable views recorded in the pointer input device */ @@ -90,11 +74,6 @@ private: InputDeviceManager(InputDeviceManager&&) = delete; InputDeviceManager& operator=(InputDeviceManager&&) = delete; - /** - * Clear rotate state. - */ - void ClearRotateState(); - List deviceList_; }; } // namespace OHOS diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/dock/rotate_input_device.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/dock/rotate_input_device.h index 07cc87c0a..b9dddd16a 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/dock/rotate_input_device.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/dock/rotate_input_device.h @@ -34,11 +34,6 @@ public: threshold_ = threshold; } - void ResetRotateState() - { - rotateStart_ = false; - } - protected: void DispatchEvent(const DeviceData& data) override; bool rotateStart_; diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h index 57e7a5c1d..6c95fb16d 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h @@ -336,16 +336,6 @@ public: void OnPostDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override; - /** - * @brief Get state of scroll animator. - * @since 1.0 - * @version 1.0 - */ - uint8_t GetScrollState() - { - return scrollAnimator_.GetState(); - } - static constexpr uint8_t HORIZONTAL = 0; static constexpr uint8_t VERTICAL = 1; diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_canvas.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_canvas.h index 6f35a8dd2..a2dece289 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_canvas.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_canvas.h @@ -38,9 +38,7 @@ #include "common/image.h" #include "components/ui_label.h" -#include "components/ui_image_view.h" #include "gfx_utils/list.h" -#include "gfx_utils/trans_affine.h" namespace OHOS { /** @@ -59,9 +57,7 @@ public: */ Paint() : style_(PaintStyle::STROKE_FILL_STYLE), fillColor_(Color::Black()), - strokeColor_(Color::White()), opacity_(OPA_OPAQUE), strokeWidth_(2), - rotateAngle_(0), scaleRadioX_(1.0f), scaleRadioY_(1.0f), translationX_(0), - translationY_(0) {} + strokeColor_(Color::White()), opacity_(OPA_OPAQUE), strokeWidth_(2) {} /** * @brief A destructor used to delete the Paint instance. @@ -218,133 +214,12 @@ public: return opacity_; } - /* Zooms the current drawing to a larger or smaller size */ - void Scale(float scaleX, float scaleY); - - /** - * @brief get the x coordinate scale value - * @since 1.0 - * @version 1.0 - */ - float GetScaleX() const - { - return this->scaleRadioX_; - } - - /** - * @brief get the y coordinate scale value - * @since 1.0 - * @version 1.0 - */ - float GetScaleY() const - { - return this->scaleRadioY_; - } - - /** - * @brief Rotate current drawing - * @param angle rotate angle value. - * @since 1.0 - * @version 1.0 - */ - void Rotate(float angle); - - /** - * @brief Rotate current drawing - * @param angle rotate angle value. - * @param x translate x coordinate. - * @param y translate y coordinate. - * @since 1.0 - * @version 1.0 - */ - void Rotate(float angle, int16_t x, int16_t y); - - /** - * @brief Remap the (x, y) position on the canvas - * @param x translate x coordinate. - * @param y translate y coordinate. - * @since 1.0 - * @version 1.0 - */ - void Translate(int16_t x, int16_t y); - - /** - * @brief Gets the x position on the remapping canvas - * @since 1.0 - * @version 1.0 - */ - int16_t GetTranslateX() const - { - return this->translationX_; - } - - /** - * @brief Gets the Y position on the remapping canvas - * @since 1.0 - * @version 1.0 - */ - int16_t GetTranslateY() const - { - return this->translationY_; - } - - /** - * @brief Resets the current conversion to the identity matrix. Then run transform () - * @param scaleX scale x value. - * @param shearX shear x value. - * @param shearY shear y value. - * @param scaleY scale y value - * @param transLateX translate x coordinate. - * @param transLateY translate y coordinate. - * @since 1.0 - * @version 1.0 - */ - void SetTransform(float scaleX, float shearX, float shearY, float scaleY, int16_t transLateX, int16_t transLateY); - - /** - * @brief Resets the current conversion to the identity matrix. Then run transform () - * @param scaleX scale x value. - * @param shearX shear x value. - * @param shearY shear y value. - * @param scaleY scale y value - * @param transLateX translate x coordinate. - * @param transLateY translate y coordinate. - * @since 1.0 - * @version 1.0 - */ - void Transform(float scaleX, float shearX, float shearY, float scaleY, int16_t transLateX, int16_t transLateY); - - /** - * @brief Gets the Trans Affine - * @since 1.0 - * @version 1.0 - */ - TransAffine GetTransAffine() const - { - return transfrom_; - } - - /** - * @brief Gets the Rotate Angle - * @since 1.0 - * @version 1.0 - */ - float GetRotateAngle() const - { - return rotateAngle_; - } private: PaintStyle style_; ColorType fillColor_; ColorType strokeColor_; uint8_t opacity_; uint16_t strokeWidth_; - float rotateAngle_; // Rotation angle in degrees - float scaleRadioX_; - float scaleRadioY_; - int32_t translationX_; - int32_t translationY_; - TransAffine transfrom_; // matrix. }; /** @@ -545,7 +420,6 @@ public: */ void DrawImage(const Point& startPoint, const char* image, const Paint& paint); - void DrawImage(const Point& startPoint, const char* image, const Paint& paint, int16_t width, int16_t height); /** * @brief Defines the font style. */ @@ -757,10 +631,13 @@ protected: delete arcParam; } - static void DeleteImageView(void* param) + static void DeleteImageParam(void* param) { - UIImageView* imageView = static_cast(param); - delete imageView; + ImageParam* imageParam = static_cast(param); + if (imageParam->image != nullptr) { + delete imageParam->image; + } + delete imageParam; } static void DeleteLabel(void* param) 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..71d3d1318 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 @@ -78,14 +78,14 @@ public: LINE_BREAK_MARQUEE, /** * The width and height of this label remain unchanged. - * If this text is too long, it will be cropped to display. + * If this text is too long, it will be scrolled back and forth to display. */ - LINE_BREAK_CLIP, + LINE_BREAK_OSCILLATION, /** * The width and height of this label remain unchanged. - * If this text is too long, it will be scrolled back and forth to display. + * If this text is too long, it will be cropped to display. */ - LINE_BREAK_OSCILLATION, + LINE_BREAK_CLIP, /** * Maximum value of the line break mode, which is used for validity check. */ diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h index e2b977876..47df1bd4f 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h @@ -114,7 +114,6 @@ enum UIViewType : uint8_t { UI_MENU_ITEM, UI_CARD_PAGE, UI_COVER_FLOW, - UI_SLIP_FLOW, UI_CROSS_VIEW, UI_BARCODE, UI_MAP_VIEW, @@ -1623,7 +1622,7 @@ public: * @since 5.0 * @version 3.0 */ - virtual void Scale(const Vector2& scale, const Vector2& pivot); + void Scale(const Vector2& scale, const Vector2& pivot); /** * @brief Scales the view in 3d. @@ -1633,7 +1632,7 @@ public: * @since 5.0 * @version 3.0 */ - virtual void Scale(const Vector3& scale, const Vector3& pivot); + void Scale(const Vector3& scale, const Vector3& pivot); /** * @brief Shears the view in 3d. diff --git a/code/sdk/middleware/services/gui/uikit/utils/frameworks/trans_affine.cpp b/code/sdk/middleware/services/gui/uikit/utils/frameworks/trans_affine.cpp deleted file mode 100644 index 808349747..000000000 --- a/code/sdk/middleware/services/gui/uikit/utils/frameworks/trans_affine.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "gfx_utils/trans_affine.h" -#if ENABLE_CMATH -#include -#endif - -namespace OHOS { -const TransAffine& TransAffine::RectToParl(float x1, float y1, - float x2, float y2, - const float* parl) -{ - data_[0] = x2 - x1; - data_[3] = 0; // 3 : index - data_[1] = x2 - x1; - data_[4] = y2 - y1; // 4 : index - data_[2] = x1; // 2 : index - data_[5] = y1; // 5 : index - Invert(); - Multiply(TransAffine(parl[2] - parl[0], parl[3] - parl[1], // 2 3 : index - parl[4] - parl[0], parl[5] - parl[1], // 4 5 : index - parl[0], parl[1])); - return *this; -} - -const TransAffine& TransAffine::Multiply(const TransAffine& metrix) -{ - float t0 = data_[0] * metrix.data_[0] + data_[3] * metrix.data_[1]; // 3 : index - float t2 = data_[1] * metrix.data_[0] + data_[4] * metrix.data_[1]; // 4 : index - float t4 = data_[2] * metrix.data_[0] + data_[5] * metrix.data_[1] + metrix.data_[2]; // 2 5 : index - data_[3] = data_[0] * metrix.data_[3] + data_[3] * metrix.data_[4]; // 3 4 : index - data_[4] = data_[1] * metrix.data_[3] + data_[4] * metrix.data_[4]; // 3 4 5: index - data_[5] = data_[2] * metrix.data_[3] + data_[5] * metrix.data_[4] + metrix.data_[5]; // 2 3 4 5 : index - data_[0] = t0; - data_[1] = t2; - data_[2] = t4; // 2 : index - return *this; -} - -const TransAffine& TransAffine::Invert() -{ - float d = DeterminantReciprocal(); - - float t0 = data_[4] * d; // 4 : index - data_[4] = data_[0] * d; // 4 : index - data_[3] = -data_[3] * d; // 3 : index - data_[1] = -data_[1] * d; - - float t4 = -data_[2] * t0 - data_[5] * data_[1]; // 2 5 : index - data_[5] = -data_[2] * data_[3] - data_[5] * data_[4]; // 2 3 4 5 : index - - data_[0] = t0; - data_[2] = t4; // 2 : index - return *this; -} - -const TransAffine& TransAffine::Reset() -{ - data_[1] = 0; - data_[2] = 0; // 2 : index - data_[3] = 0; // 3 : index - data_[5] = 0; // 5 : index - data_[6] = 0; // 6 : index - data_[7] = 0; // 7 : index - data_[0] = 1; - data_[4] = 1; // 4 : index - data_[8] = 1; // 8 : index - return *this; -} - -bool TransAffine::IsIdentity() const -{ - return MATH_FLT_EQUAL(data_[0], 1.0f) && - MATH_FLT_EQUAL(data_[3], 0.0f) && // 3 : index - MATH_FLT_EQUAL(data_[1], 0.0f) && - MATH_FLT_EQUAL(data_[4], 1.0f) && // 4 : index - MATH_FLT_EQUAL(data_[2], 0.0f) && // 2 : index - MATH_FLT_EQUAL(data_[5], 0.0f); // 5 : index -} - -bool TransAffine::IsValid(float epsilon) const -{ - return (MATH_ABS(data_[0]) > epsilon) && (MATH_ABS(data_[4]) > epsilon); // 4 : index -} - -TransAffine TransAffine::TransAffineRotation(float angle) -{ -#if ENABLE_CMATH - return TransAffine(std::cos(angle), std::sin(angle), -std::sin(angle), std::cos(angle), 0.0f, 0.0f); -#else - return TransAffine(Sin(QUARTER_IN_DEGREE - angle), Sin(angle), -Sin(angle), Sin(QUARTER_IN_DEGREE - angle), - 0.0f, 0.0f); -#endif -} - -const TransAffine& TransAffine::Rotate(float angle) -{ -#if ENABLE_CMATH - float scaleXTemp = data_[0] * std::cos(angle) - data_[3] * std::sin(angle); // 3 : index - float shearXTemp = data_[1] * std::cos(angle) - data_[4] * std::sin(angle); // 4 : index - float translateXTemp = data_[2] * std::cos(angle) - data_[5] * std::sin(angle); // 5 : index - data_[3] = data_[0] * std::sin(angle) + data_[3] * std::cos(angle); // 3 : index - data_[4] = data_[1] * std::sin(angle) + data_[4] * std::cos(angle); // 4 : index - data_[5] = data_[2] * std::sin(angle) + data_[5] * std::cos(angle); // 5 : index -#else - float scaleXTemp = data_[0] * Sin(QUARTER_IN_DEGREE - angle) - data_[3] * Sin(angle); // 3 : index - float shearXTemp = data_[1] * Sin(QUARTER_IN_DEGREE - angle) - data_[4] * Sin(angle); // 4 : index - float translateXTemp = data_[2] * Sin(QUARTER_IN_DEGREE - angle) - data_[5] * Sin(angle); // 2 5 : index - data_[3] = data_[0] * Sin(angle) + data_[3] * Sin(QUARTER_IN_DEGREE - angle); // 3 : index - data_[4] = data_[1] * Sin(angle) + data_[4] * Sin(QUARTER_IN_DEGREE - angle); // 4 : index - data_[5] = data_[2] * Sin(angle) + data_[5] * Sin(QUARTER_IN_DEGREE - angle); // 2 5 : index -#endif - data_[0] = scaleXTemp; - data_[1] = shearXTemp; - data_[2] = translateXTemp; // 2 : index - return *this; -} -} // namespace OHOS diff --git a/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h b/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h index e0a4e3767..748c81d8b 100755 --- a/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h +++ b/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h @@ -75,15 +75,13 @@ static constexpr uint16_t THREE_QUARTER_IN_DEGREE = 270; /** A full rotation: 360 degrees */ static constexpr uint16_t CIRCLE_IN_DEGREE = 360; /** Pi value */ -static constexpr double UI_PI = 3.14159265358979f; +static constexpr double UI_PI = 3.14159265358979; static constexpr float ATAN2_P3 = -0.3258775; static constexpr float ATAN2_P5 = 0.1556117; static constexpr float ATAN2_P7 = -0.0443360; static constexpr float RADIAN_TO_ANGLE = 57.295779513; static constexpr float UI_FLT_EPSILON = 1E-5; static constexpr int16_t ORDER_MATRIX_4 = 4; -static constexpr float VERTEX_DIST_EPSILON = 1e-14; -static constexpr float BOXER = 180.0f; float Sin(float angle); float Acos(float value); diff --git a/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/image_info.h b/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/image_info.h index 536af1f9a..681721b8c 100755 --- a/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/image_info.h +++ b/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/image_info.h @@ -38,7 +38,7 @@ #include #include "graphic_config.h" namespace OHOS { -#define MAX_IMG_PATH_LEN 128 +#define MAX_IMG_PATH_LEN 64 /** * @brief Defines image head node information. */ diff --git a/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/trans_affine.h b/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/trans_affine.h deleted file mode 100644 index 596043dea..000000000 --- a/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/trans_affine.h +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef GRAPHIC_LTE_TRANS_AFFINE_H -#define GRAPHIC_LTE_TRANS_AFFINE_H - -#include "gfx_utils/graphic_math.h" - -namespace OHOS { -const float affineEpsilon = 1e-14; -const uint16_t parlIndexSize = 6; -/** - * @brief Map source transformation - * @since 1.0 - * @version 1.0 - */ -class TransAffine : public Matrix3 { -public: - /** - * @brief Initialize to identity matrix - * @since 1.0 - * @version 1.0 - */ - TransAffine() : Matrix3() {} - /** - * @brief Custom matrix - * @since 1.0 - * @version 1.0 - */ - TransAffine(float v0, float v1, float v2, float v3, float v4, float v5) - : Matrix3(v0, v2, v4, v1, v3, v5, 0, 0, 1) {} - /** - * @brief Converts a rectangle to a parallelogram - * @since 1.0 - * @version 1.0 - */ - TransAffine(float x1, float y1, float x2, float y2, const float* parl) - { - RectToParl(x1, y1, x2, y2, parl); - } - - void SetData(int32_t index, float value) - { - data_[index] = value; - } - /** - * @brief Convert the original parallelogram to the target parallelogram - * @param x1 x-axis coordinate of the upper left corner of the rectangle - * @param y1 y-axis coordinate of the upper left corner of the rectangle - * @param x2 x-axis coordinates of the lower right corner of the rectangle - * @param y2 y-axis coordinates of the lower right corner of the rectangle - * @param parl Target parallelogram - * @since 1.0 - * @version 1.0 - */ - const TransAffine& RectToParl(float x1, float y1, - float x2, float y2, - const float* parl); - - /** - * @brief reset TransAffine - * @since 1.0 - * @version 1.0 - */ - const TransAffine& Reset(); - - /** - * @brief Element offset - * @param deltaX x-axis offset - * @param deltaY y-axis offset - * @since 1.0 - * @version 1.0 - */ - const TransAffine& Translate(float x, float y); - /** - * @brief Element rotation - * @param angle Rotate angle - * @since 1.0 - * @version 1.0 - */ - const TransAffine& Rotate(float angle); - /** - * @brief Element Scale - * @param scale Overall amplification factor - * @since 1.0 - * @version 1.0 - */ - const TransAffine& Scale(float scale); - /** - * @brief Element Scale - * @param x x-axis magnification factor - * @param y y-axis magnification factor - * @since 1.0 - * @version 1.0 - */ - const TransAffine& Scale(float x, float y); - - /** - * @brief Transformation matrix multiplication - * @param metrix - * @since 1.0 - * @version 1.0 - */ - const TransAffine& Multiply(const TransAffine& metrix); - - /** - * @brief Matrix flip - * @since 1.0 - * @version 1.0 - */ - const TransAffine& Invert(); - - const TransAffine& operator*=(const TransAffine& metrix) - { - return Multiply(metrix); - } - - /** - * @brief Convert x, y - * @param x x-coordinate - * @param y y-coordinate - * @since 1.0 - * @version 1.0 - */ - void Transform(float* x, float* y) const; - - /** - * @brief inverse transformation - * @param x x-coordinate - * @param y y-coordinate - * @since 1.0 - * @version 1.0 - */ - void InverseTransform(float* x, float* y) const; - - /** - * @brief Computes the reciprocal of a determinant - * @since 1.0 - * @version 1.0 - */ - float DeterminantReciprocal() const - { - float reciprocal = data_[0] * data_[4] - data_[3] * data_[1]; - if (reciprocal == 0) { - return VERTEX_DIST_EPSILON; - } - return 1.0f / reciprocal; - } - - /** - * @brief Check the matrix for degradation - * @since 1.0 - * @version 1.0 - */ - bool IsValid(float epsilon = affineEpsilon) const; - - /** - * @brief Check whether it is an identity matrix - * @since 1.0 - * @version 1.0 - */ - bool IsIdentity() const; - - /** - * @brief zoom - * @param x x-coordinate - * @param y y-coordinate - * @since 1.0 - * @version 1.0 - */ - void ScalingAbs(float* x, float* y) const; - - /** - * @brief Set rotation matrix - * @since 1.0 - * @version 1.0 - */ - static TransAffine TransAffineRotation(float angle); - - /** - * @brief Set scaling matrix - * @since 1.0 - * @version 1.0 - */ - static TransAffine TransAffineScaling(float x, float y) - { - return TransAffine(x, 0.0f, 0.0f, y, 0.0f, 0.0f); - } - - /** - * @brief Set scaling matrix - * @since 1.0 - * @version 1.0 - */ - static TransAffine TransAffineScaling(float scale) - { - return TransAffine(scale, 0.0f, 0.0f, scale, 0.0f, 0.0f); - } - /** - * @brief Set translation matrix - * @since 1.0 - * @version 1.0 - */ - static TransAffine TransAffineTranslation(float x, float y) - { - return TransAffine(1.0f, 0.0f, 0.0f, 1.0f, x, y); - } -}; - -inline void TransAffine::Transform(float* x, float* y) const -{ - float tmp = *x; - *x = tmp * data_[0] + *y * data_[1] + data_[2]; - *y = tmp * data_[3] + *y * data_[4] + data_[5]; -} - -inline void TransAffine::InverseTransform(float* x, float* y) const -{ - float reciprocal = DeterminantReciprocal(); - float a = (*x - data_[2]) * reciprocal; - float b = (*y - data_[5]) * reciprocal; - *x = a * data_[4] - b * data_[1]; - *y = b * data_[0] - a * data_[3]; -} - -inline const TransAffine& TransAffine::Translate(float deltaX, float deltaY) -{ - data_[2] += deltaX; - data_[5] += deltaY; - return *this; -} - -inline const TransAffine& TransAffine::Scale(float scaleX, float scaleY) -{ - data_[0] *= scaleX; - data_[1] *= scaleX; - data_[2] *= scaleX; - data_[3] *= scaleY; - data_[4] *= scaleY; - data_[5] *= scaleY; - return *this; -} - -inline const TransAffine& TransAffine::Scale(float scale) -{ - data_[0] *= scale; - data_[1] *= scale; - data_[2] *= scale; - data_[3] *= scale; - data_[4] *= scale; - data_[5] *= scale; - return *this; -} - -inline void TransAffine::ScalingAbs(float* x, float* y) const -{ - *x = Sqrt(data_[0] * data_[0] + data_[1] * data_[1]); - *y = Sqrt(data_[3] * data_[3] + data_[4] * data_[4]); -} -} // namespace OHOS -#endif 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..a94b564ea 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 @@ -47,10 +47,6 @@ static Audio::AudioManager& g_amInstance = Audio::AudioManager::GetInstance(); void TriggerEventListener(const AudioEventListener *listener) { - if (listener == nullptr) { - // listener is nullptr - return; - } if (!JsAsyncWork::DispatchAsyncWork(AsyncExecuteCallback, const_cast(listener))) { MEDIA_ERR_LOG("dispatch async work failed."); } 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..89c3399eb 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 @@ -174,6 +174,7 @@ static bool InitPlayerResources(MediaVideoPlay *videoPlay) videoPlay->player_ = player; videoPlay->isPlaybackCompleted_ = false; + videoPlay->isPlaybackStopped_ = false; videoPlay->interruptHintStop_ = false; videoPlay->playError_ = false; @@ -498,6 +499,10 @@ int32_t MediaVideoPlay::StopVideoPlay(void) { MEDIA_ERR_LOG("StopVideoPlay start!"); MediaMutexLock(mutex_); + if (!isPlayed_) { + MEDIA_INFO_LOG("video play is not start,can not stop!"); + goto EXIT; + } if (isPlaybackStopped_ || isPlaybackCompleted_ || interruptHintStop_) { if (isLoop_) { if (!isPlaybackCompleted_) { @@ -511,12 +516,12 @@ int32_t MediaVideoPlay::StopVideoPlay(void) return MEDIA_OK; } } +EXIT: isPlaybackStopped_ = true; MediaThreadCondSignal(cond_); MediaMutexUnLock(mutex_); if (isSyncExitMode_) { MediaThreadJoin(&threadHandle_); - isPlaybackStopped_ = false; dynamic_cast(surface_)->ClearBuffers(); // clear buffers safely in sync mode to reduce peak memory } play = nullptr; @@ -546,6 +551,15 @@ void MediaVideoPlay::SetSyncExitMode(bool isSyncExitMode) void MediaVideoPlay::DestroyVideoPlaySource(void) { + if (!isEntered_) { + if (isSyncExitMode_) { + MediaThreadJoin(&threadHandle_); + // clear buffers safely in sync mode to reduce peak memory + dynamic_cast(surface_)->ClearBuffers(); + } + MEDIA_ERR_LOG("video is not played\n"); + return; + } needSendBackgroundFrame_ = false; StopVideoPlay(); uint32_t count = 0; diff --git a/code/sdk/middleware/utils/codeloader/private/codeloader_execute_command_memory_commands.c b/code/sdk/middleware/utils/codeloader/private/codeloader_execute_command_memory_commands.c index 1c71f18b8..0fed0d7e9 100755 --- a/code/sdk/middleware/utils/codeloader/private/codeloader_execute_command_memory_commands.c +++ b/code/sdk/middleware/utils/codeloader/private/codeloader_execute_command_memory_commands.c @@ -372,36 +372,42 @@ static bool codeloader_command_processor_set_flash_limits_common_helper( bool ret_value = true; uint16_t apps_area_pages; - // set recover region - start_address = RECOVERY_FLASH_REGION_START; - core_section_length = FLASH_PAGE_SIZE * recovery_code_length; - codeloader_command_set_core_region(CORE_IMAGES_RECOVERY, core_section_length, start_address); - - // set bt region - start_address = BT_FLASH_REGION_START; - core_section_length = FLASH_PAGE_SIZE * bt_code_length; - codeloader_command_set_core_region(CORE_IMAGES_BT, core_section_length, start_address); - - // set dsp region - start_address = DSP_FLASH_REGION_START; - core_section_length = FLASH_PAGE_SIZE * dsp_code_length; - codeloader_command_set_core_region(CORE_IMAGES_PROTOCOL, core_section_length, start_address); - - // set extern0 region - start_address = DSP_CODEC_FLASH_REGION_START; - core_section_length = FLASH_PAGE_SIZE * extern0_code_length; - codeloader_command_set_core_region(CORE_IMAGES_EXTERN0, core_section_length, start_address); - - // set apps region - apps_area_pages = (uint16_t)APP_FLASH_REGION_PAGES; - start_address = (uint32_t)APP_FLASH_REGION_START; - - // check apps images will fit into allocated area - if (apps_code_length > apps_area_pages) { + // Core Images always starts at end of the SSB. + start_address = (uint32_t)((uintptr_t)(g_hal_sectors_flash_region_end)); + // make sure we can never put system images in the Application Area + if ((start_address + ((bt_code_length + recovery_code_length + dsp_code_length + extern0_code_length) * + FLASH_PAGE_SIZE)) > APP_FLASH_REGION_START) { ret_value = false; } else { - core_section_length = FLASH_PAGE_SIZE * apps_code_length; - codeloader_command_set_core_region(CORE_IMAGES_APPS, core_section_length, start_address); + // set recover region + core_section_length = FLASH_PAGE_SIZE * recovery_code_length; + codeloader_command_set_core_region(CORE_IMAGES_RECOVERY, core_section_length, start_address); + start_address += core_section_length; + // set bt region + core_section_length = FLASH_PAGE_SIZE * bt_code_length; + codeloader_command_set_core_region(CORE_IMAGES_BT, core_section_length, start_address); + start_address += core_section_length; + + // set dsp region + core_section_length = FLASH_PAGE_SIZE * dsp_code_length; + codeloader_command_set_core_region(CORE_IMAGES_PROTOCOL, core_section_length, start_address); + start_address += core_section_length; + + // set extern0 region + core_section_length = FLASH_PAGE_SIZE * extern0_code_length; + codeloader_command_set_core_region(CORE_IMAGES_EXTERN0, core_section_length, start_address); + + // set apps region + apps_area_pages = (uint16_t)APP_FLASH_REGION_PAGES; + start_address = (uint32_t)APP_FLASH_REGION_START; + + // check apps images will fit into allocated area + if (apps_code_length > apps_area_pages) { + ret_value = false; + } else { + core_section_length = FLASH_PAGE_SIZE * apps_code_length; + codeloader_command_set_core_region(CORE_IMAGES_APPS, core_section_length, start_address); + } } return ret_value; } 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..8811498b4 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..2b088ccd8 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-r/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-r/libx_vfs_private.a index bcb9c68b6..d4ad57565 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/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js/libx_vfs_private.a index 54aaff3d7..9af3d9c5c 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..0c9171776 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..71587fc57 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..8b6acb947 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..23468d2a0 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..1fa6576d7 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..b856b1a57 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..ba9c39112 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..6ade7132a 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..d3ffd47b8 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..2ac65c0ad 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..f29bef29f 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..24138d847 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..80921f3d0 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-r/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-r/libfs_yaffs2.a index 41f28ea0d..f120d29d8 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/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js/libfs_yaffs2.a index 5ae1a87ce..f9f27b792 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..f21bf59a2 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..39ededcc0 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..d30d0ab50 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..8c44918f4 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..99adba076 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..721fb7c7e 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..24f1ab15d 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..0f6afbc05 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..ec02bba40 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..fe9825e06 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..139ea697c 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/middleware/utils/nv/nv_storage_lib/nv_async_store.c b/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.c index 28359880f..a132b7934 100644 --- a/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.c +++ b/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.c @@ -52,7 +52,6 @@ static errcode_t nv_asynv_send_msg_to_write_flash(nv_key_map_t* cur_key) if (ret != OSAL_SUCCESS) { return ERRCODE_FAIL; } - cur_key->flush_flag = false; return ERRCODE_SUCC; } @@ -203,7 +202,6 @@ static errcode_t nv_async_store_init_keys_one_page(kv_page_handle_t *page) nv_psram_free(cur_key); return ERRCODE_FAIL; } - cur_key->flush_flag = true; (void)nv_async_hash_add(cur_key); } key_found = kv_page_find_next_key(page, NULL, &key); @@ -346,8 +344,6 @@ static errcode_t nv_async_msg_process(nv_queue_msg_handle_t *msg_data_t) } g_nv_async_flash_space = status.max_key_space; - /* 当前key已刷新到flush上 */ - msg_data->flush_flag = true; osal_sem_up(&nv_async_sem); return res; } @@ -390,20 +386,14 @@ static errcode_t nv_async_thread_msg_event_init(void) errcode_t nv_async_flush(void) { nv_queue_msg_handle_t msg_data_t; - CstlHashIterator it; - errcode_t res; - /* 遍历hash表,将当前还没刷新到flash上的NV刷新到flash */ - for (it = CstlHashIterBegin(g_hash_table); it != CstlHashIterEnd(g_hash_table); - it = CstlHashIterNext(g_hash_table, it)) { - nv_key_map_t *cur_data = (nv_key_map_t *)CstlHashIterValue(g_hash_table, it); - if (cur_data->flush_flag == false) { - msg_data_t.key_id = cur_data->key_id; - msg_data_t.key_ram_location = (uintptr_t)cur_data; - res = nv_async_msg_process(&msg_data_t); - if (res != ERRCODE_SUCC) { - nv_log_err("[NV] nv_async_flush fail! key_id=0x%x", msg_data_t.key_id); - } - } + uint32_t msg_data_size = sizeof(nv_queue_msg_handle_t); + uint8_t cur_queue_num = (uint8_t)osal_msg_queue_get_msg_num(g_nv_msg_queue_id); + + while (cur_queue_num > 0) { + (void)memset_s(&msg_data_t, msg_data_size, 0, msg_data_size); + osal_msg_queue_read_copy(g_nv_msg_queue_id, &msg_data_t, &msg_data_size, OSAL_MSGQ_NO_WAIT); + nv_async_msg_process(&msg_data_t); + cur_queue_num--; } return ERRCODE_SUCC; diff --git a/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.h b/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.h index 782b0354e..46a519229 100644 --- a/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.h +++ b/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.h @@ -16,11 +16,10 @@ extern "C" { typedef struct nv_key_map { uint16_t key_id; /* Key ID */ - uint16_t key_len : 12; /* Key length */ + uint16_t key_len : 13; /* Key length */ uint16_t permanent : 1; /* 是否是永久Key */ uint16_t encrypted : 1; /* 是否是加密Key */ uint16_t non_upgrade : 1; /* 是否不可以升级 */ - uint16_t flush_flag : 1; /* 是否已刷新到flash */ uint8_t kvalue[0]; /* key value */ } nv_key_map_t; 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..8dccc7839 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..67622a669 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/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a index fd474142e..c3b361c64 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..fd74cca09 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/CMakeLists.txt b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/CMakeLists.txt index 321df8bc4..d259e499d 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/CMakeLists.txt +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/CMakeLists.txt @@ -260,7 +260,6 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/components/baidu_map_component.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/app_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/device_module.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/modules/network_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/vibrator_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/battery_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/sensor_module.cpp @@ -273,7 +272,6 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/console_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/date_time_format_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/feature_ability_module.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/image_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/intl_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/jstest_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/localization_module.cpp diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/js_fwk_common.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/js_fwk_common.h index 553f2e8b3..664f57fc8 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/js_fwk_common.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/js_fwk_common.h @@ -86,7 +86,7 @@ void ThrowError(); constexpr uint16_t PATH_LENGTH_MAX = 1024; constexpr uint8_t NAME_LENGTH_MAX = 255; constexpr uint8_t DEVICE_ID_LENGTH_MAX = 65; -constexpr uint16_t FILE_CONTENT_LENGTH_MAX = 1024 * 48; +constexpr uint16_t FILE_CONTENT_LENGTH_MAX = 1024 * 30; // hex code constexpr uint8_t DEC = 10; @@ -277,7 +277,7 @@ jerry_value_t *ConvertDragEventInfo(const DragEvent &event, const uint16_t id); jerry_value_t *ConvertKeyEventInfo(const KeyEvent &event); #endif void ClearEventListener(const jerry_value_t args[], uint8_t argc); -bool DumpPrintMemoryInfo(); + jerry_value_t *ConvertRotateEventInfo(const RotateEvent &event); JSValue GetRootAbilitySlice(); JSValue CallWithRootAbilitySlice(JSValue func, JSValue args[], JSSize size); 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..19cfb8430 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..9788f97cd 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/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a index c090187f1..8fdfdbf50 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..ce01aba77 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/canvas_component.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.cpp index 6d9a3aded..63cea7b39 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.cpp @@ -20,8 +20,6 @@ #include "js_fwk_common.h" #include "product_adapter.h" #include "securec.h" -#include "modules/presets/image_module.h" -#include "image_component.h" namespace OHOS { namespace ACELite { @@ -52,11 +50,6 @@ const char * const CanvasComponent::FUNC_ARC = "arc"; const char * const CanvasComponent::FUNC_CLOSEPATH = "closePath"; const char * const CanvasComponent::FUNC_STROKE = "stroke"; const char * const CanvasComponent::FUNC_CLEAR = "clear"; -const char * const CanvasComponent::FUNC_DRAWIMAGE = "drawImage"; -const char * const CanvasComponent::FUNC_TRANFORM = "transform"; -const char * const CanvasComponent::FUNC_SETTRANFORM = "setTransform"; -const char * const CanvasComponent::FUNC_ROTATE = "rotate"; -const char * const CanvasComponent::FUNC_SCALE = "scale"; // create canvas draw attribute-callback mapping const AttrMap CanvasComponent::attrMap_[] = { @@ -80,12 +73,7 @@ const MethodMap CanvasComponent::methodMap_[] = { {FUNC_ARC, Arc}, {FUNC_CLOSEPATH, ClosePath}, {FUNC_STROKE, Stroke}, - {FUNC_CLEAR, Clear}, - {FUNC_DRAWIMAGE, DrawImage}, - {FUNC_TRANFORM, Transform}, - {FUNC_SETTRANFORM, SetTransform}, - {FUNC_ROTATE, Rotate}, - {FUNC_SCALE, Scale} + {FUNC_CLEAR, Clear} }; CanvasComponent::CanvasComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) @@ -836,162 +824,6 @@ jerry_value_t CanvasComponent::Stroke(const jerry_value_t func, return UNDEFINED; } -jerry_value_t CanvasComponent::DrawImage(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); - if (component == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get canvas component from js object failed")); - } - if (argsNum < ArgsCount::NUM_1) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: DrawImage arg error!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("canvas_component: DrawImage arg error!")); - } - char* imageName = nullptr; - int16_t startX = 0; - int16_t startY = 0; - int16_t width = -1; - int16_t height = -1; - if (ParseImageName(args, imageName, width, height) != UNDEFINED) { - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("parse Imagename function error")); - } - if (argsNum >= ArgsCount::NUM_2) { - startX = IntegerOf(args[ArgsIndex::IDX_1]); - } - if (argsNum >= ArgsCount::NUM_3) { - startY = IntegerOf(args[ArgsIndex::IDX_2]); - } - if (argsNum >= ArgsCount::NUM_4) { - width = IntegerOf(args[ArgsIndex::IDX_3]); - } - if (argsNum >= ArgsCount::NUM_5) { - height = IntegerOf(args[ArgsIndex::IDX_4]); - } - Point startLocat = {startX, startY}; - - if (width > 0 || height > 0) { - component->canvas_.DrawImage(startLocat, imageName, component->paint_, width, height); - } else { - component->canvas_.DrawImage(startLocat, imageName, component->paint_); - } - ACE_FREE(imageName); - return UNDEFINED; -} - -jerry_value_t CanvasComponent::Transform(const jerry_value_t func, - const jerry_value_t dom, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - if (argsNum < ArgsCount::NUM_6) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the number of rotate method parameter error!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("rotate method parameter error")); - } - - CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); - if (component == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get canvas component from js object failed")); - } - - float scaleX = FloatOf(args[ArgsIndex::IDX_0]); - float shearX = FloatOf(args[ArgsIndex::IDX_1]); - float shearY = FloatOf(args[ArgsIndex::IDX_2]); - float scaleY = FloatOf(args[ArgsIndex::IDX_3]); - int16_t translateX = IntegerOf(args[ArgsIndex::IDX_4]); - int16_t translateY = IntegerOf(args[ArgsIndex::IDX_5]); - component->paint_.Transform(scaleX, shearX, shearY, scaleY, translateX, translateY); - return UNDEFINED; -} - - -jerry_value_t CanvasComponent::SetTransform(const jerry_value_t func, - const jerry_value_t dom, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - if (argsNum < ArgsCount::NUM_6) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the number of rotate method parameter error!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("rotate method parameter error")); - } - - CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); - if (component == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get canvas component from js object failed")); - } - - float scaleX = FloatOf(args[ArgsIndex::IDX_0]); - float shearX = FloatOf(args[ArgsIndex::IDX_1]); - float shearY = FloatOf(args[ArgsIndex::IDX_2]); - float scaleY = FloatOf(args[ArgsIndex::IDX_3]); - int16_t translateX = IntegerOf(args[ArgsIndex::IDX_4]); - int16_t translateY = IntegerOf(args[ArgsIndex::IDX_5]); - component->paint_.SetTransform(scaleX, shearX, shearY, scaleY, translateX, translateY); - return UNDEFINED; -} - -jerry_value_t CanvasComponent::Rotate(const jerry_value_t func, - const jerry_value_t dom, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - if (argsNum < ArgsCount::NUM_1) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the number of rotate method parameter error!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("rotate method parameter error")); - } - - CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); - if (component == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get canvas component from js object failed")); - } - - float angle = FloatOf(args[ArgsIndex::IDX_0]); - component->paint_.Rotate(angle); - return UNDEFINED; -} - -jerry_value_t CanvasComponent::Scale(const jerry_value_t func, - const jerry_value_t dom, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - if (argsNum < ArgsCount::NUM_2) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the number of scale method parameter error!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("scale method parameter error")); - } - - CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); - if (component == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get canvas component from js object failed")); - } - - float scaleX = FloatOf(args[ArgsIndex::IDX_0]); - float scaleY = FloatOf(args[ArgsIndex::IDX_1]); - component->paint_.Scale(scaleX, scaleY); - return UNDEFINED; -} - jerry_value_t CanvasComponent::Clear(const jerry_value_t func, const jerry_value_t context, const jerry_value_t args[], @@ -1011,67 +843,6 @@ jerry_value_t CanvasComponent::Clear(const jerry_value_t func, return UNDEFINED; } -jerry_value_t CanvasComponent::ParseImageName(const jerry_value_t args[], - char*& imageName, - int16_t &width, - int16_t &height) -{ - ImageComponent* imageCom = nullptr; - const char *src = nullptr; - char* imageNameBuf = nullptr; - // The parameter is the file name - if (jerry_value_is_string(args[ArgsIndex::IDX_0])) { - imageNameBuf = MallocStringOf(args[ArgsIndex::IDX_0]); - if (imageNameBuf == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get imageName value failed"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get imageName value failed")); - } - imageName = imageNameBuf; - return UNDEFINED; - // Parameters are objects retrieved from HML - } else if (jerry_value_is_object(args[ArgsIndex::IDX_0])) { - void *nativePtr = nullptr; - jerry_get_object_native_pointer(args[ArgsIndex::IDX_0], &nativePtr, nullptr); - imageCom = reinterpret_cast(nativePtr); - if (imageCom != nullptr) { - src = imageCom->GetSrc(); - if (src == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get imagePath value failed"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get imagePath value failed")); - } - size_t strLen = strlen(src) + 1; - imageName = static_cast(ace_malloc(strLen)); - if (memcpy_s(imageName, strLen, src, strLen) != EOK) { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get imagePath value failed"); - return UNDEFINED; - } - return UNDEFINED; - } else { - // The argument is the object passed through the new Image() - imageName = GetImageObjectParam(args); - if (strlen(imageName) < 1) { - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get imageName value failed")); - } - return UNDEFINED; - } - } else { - HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get imageName value failed"); - return jerry_create_error(JERRY_ERROR_TYPE, - reinterpret_cast("get imageName value failed")); - } - return UNDEFINED; -} - -char* CanvasComponent::GetImageObjectParam(const jerry_value_t args[]) -{ - jerry_value_t src = jerryx_get_property_str(args[ArgsIndex::IDX_0], ImageModule::attrSrc); - char* srcVal = MallocStringOf(src); - return srcVal; -} - void CanvasComponent::GetSubFont(const char *font, const uint8_t index, char *&subFont) const { if (font == nullptr || *font == '\0') { diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.h index 4cd9b97c7..e7a388d5c 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.h @@ -173,41 +173,11 @@ private: const jerry_value_t args[], const jerry_length_t argsNum); - static jerry_value_t DrawImage(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - - static jerry_value_t Transform(const jerry_value_t func, - const jerry_value_t dom, - const jerry_value_t args[], - const jerry_length_t argsNum); - - static jerry_value_t SetTransform(const jerry_value_t func, - const jerry_value_t dom, - const jerry_value_t args[], - const jerry_length_t argsNum); - - static jerry_value_t ParseImageName(const jerry_value_t args[], - char*& imageName, - int16_t &width, - int16_t &height); static jerry_value_t Clear(const jerry_value_t func, const jerry_value_t context, const jerry_value_t args[], const jerry_length_t argsNum); - static jerry_value_t Rotate(const jerry_value_t func, - const jerry_value_t dom, - const jerry_value_t args[], - const jerry_length_t argsNum); - - static jerry_value_t Scale(const jerry_value_t func, - const jerry_value_t dom, - const jerry_value_t args[], - const jerry_length_t argsNum); - - static char* GetImageObjectParam(const jerry_value_t args[]); UICanvas canvas_; jerry_value_t context_; Paint paint_; @@ -238,12 +208,7 @@ private: static const char * const FUNC_ARC; static const char * const FUNC_CLOSEPATH; static const char * const FUNC_STROKE; - static const char * const FUNC_DRAWIMAGE; - static const char * const FUNC_TRANFORM; - static const char * const FUNC_SETTRANFORM; static const char * const FUNC_CLEAR; - static const char * const FUNC_ROTATE; - static const char * const FUNC_SCALE; }; } // namespace ACELite } // namespace OHOS 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..554e82684 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 @@ -1314,11 +1314,6 @@ bool Component::RegisterCommonEventListener(UIView &view, void Component::ReleaseCommonEventListeners() { - RootView *rootView = RootView::GetInstance(); - if (rootView != nullptr) { - rootView->ClearOnKeyActListener(); - } - ACE_DELETE(onKeyInputListener_); ACE_DELETE(onClickListener_); ACE_DELETE(onLongPressListener_); #ifdef JS_TOUCH_EVENT_SUPPORT diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.cpp index 0dc4ad514..f794b07ef 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.cpp @@ -32,11 +32,6 @@ ImageComponent::ImageComponent(jerry_value_t options, jerry_value_t children, Ap SetComponentName(K_IMAGE); } -const char *ImageComponent::GetSrc() -{ - return imageView_.GetPath(); -} - bool ImageComponent::CreateNativeViews() { // set default value diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.h index 26fe8c21b..0868e2162 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.h @@ -30,8 +30,7 @@ public: ImageComponent() = delete; ImageComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager); ~ImageComponent() override {} - const char *GetSrc(); - + protected: bool CreateNativeViews() override; UIView *GetComponentRootView() const override; diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp index c1aae2c9b..ce9a837f8 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp @@ -329,10 +329,6 @@ static void ExecuteSendMsgToJS(void *data) if (flag) { if ((!CheckIsJsValueFunction(success)) || (!CheckIsJsValueDefined(context))) { HILOG_ERROR(HILOG_MODULE_ACE, "Error in ExecuteSendMsgToJS. Invalid params detected!"); - if (msgBody != nullptr) { - AdapterFree(msgBody); - msgBody = nullptr; - } return; } OHOS::ACELite::JSIValue successArgv[OHOS::ACELite::ARGC_ONE] = { dataInfo }; @@ -341,10 +337,6 @@ static void ExecuteSendMsgToJS(void *data) } else { if ((!CheckIsJsValueDefined(context)) || (!CheckIsJsValueFunction(fail))) { HILOG_ERROR(HILOG_MODULE_ACE, "Error in ExecuteSendMsgToJS. Invalid params detected!"); - if (msgBody != nullptr) { - AdapterFree(msgBody); - msgBody = nullptr; - } return; } OHOS::ACELite::JSIValue failArgv[OHOS::ACELite::ARGC_ONE] = { dataInfo }; @@ -507,126 +499,124 @@ bool setCallbackFunction(OHOS::ACELite::JSIValue callback,uint8_t type,bool isSu if (!OHOS::ACELite::JSI::ValueIsUndefined(callback)) { if (!OHOS::ACELite::JSI::ValueIsFunction(callback)) { HILOG_ERROR(HILOG_MODULE_ACE, "Success callback value is not a function"); - ReleaseJsValue(callback); - return false; } else { switch (type) { case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI: if (isSuccess) { - poi_successCallback = callback; + poi_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - poi_failCallback = callback; + poi_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE: if (isSuccess) { - auth_successCallback = callback; + auth_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - auth_failCallback = callback; + auth_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT: if (isSuccess) { - nav_successCallback = callback; + nav_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - nav_failCallback = callback; + nav_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH: if (isSuccess) { - poi_sug_successCallback = callback; + poi_sug_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - poi_sug_failCallback = callback; + poi_sug_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION: - geo_location_Callback = callback; + geo_location_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START: - route_plan_start_Callback = callback; + route_plan_start_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC: - route_plan_success_Callback = callback; + route_plan_success_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL: - route_plan_fail_Callback = callback; + route_plan_fail_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START: - navi_start_Callback = callback; + navi_start_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY: - navi_destroy_Callback = callback; + navi_destroy_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE: - road_guide_text_update_Callback = callback; + road_guide_text_update_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE: - road_guide_icon_update_Callback = callback; + road_guide_icon_update_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE: - remain_time_Callback = callback; + remain_time_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE: - remain_distance_Callback = callback; + remain_distance_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE: - remain_route_Callback = callback; + remain_route_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE: - gps_status_Callback = callback; + gps_status_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY: - route_far_Callback = callback; + route_far_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING: - route_plan_yawing_Callback = callback; + route_plan_yawing_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE: - reroute_Callback = callback; + reroute_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION: - arrivedest_Callback = callback; + arrivedest_Callback = OHOS::ACELite::JSI::AcquireValue(callback); break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH: if (isSuccess) { - geocode_search_successCallback = callback; + geocode_search_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - geocode_search_failCallback = callback; + geocode_search_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH: if (isSuccess) { - regeocode_search_successCallback = callback; + regeocode_search_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - regeocode_search_failCallback = callback; + regeocode_search_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH: if (isSuccess) { - route_riding_successCallback = callback; + route_riding_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - route_riding_failCallback = callback; + route_riding_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH: if (isSuccess) { - route_walking_successCallback = callback; + route_walking_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - route_walking_failCallback = callback; + route_walking_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH: if (isSuccess) { - route_transit_successCallback = callback; + route_transit_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - route_transit_failCallback = callback; + route_transit_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; case MSGCENTER_TYPE_ID_VECTOR_NAVI_BT_CONNECTED: if (isSuccess) { - bt_connect_successCallback = callback; + bt_connect_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); } else { - bt_connect_failCallback = callback; + bt_connect_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); } break; default: @@ -656,13 +646,10 @@ JSIValue BaiduMapComponentModule::poi_nearby_search(const JSIValue thisVal, cons poi_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vector_navi_req_poi(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,false); + msg_center_vector_navi_req_poi(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,data,strlen(data)); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::route_riding_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -675,13 +662,10 @@ JSIValue BaiduMapComponentModule::route_riding_search(const JSIValue thisVal, co route_riding_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vector_navi_req_route_riding_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH,false); + msg_center_vector_navi_req_route_riding_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::route_walking_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -694,13 +678,10 @@ JSIValue BaiduMapComponentModule::route_walking_search(const JSIValue thisVal, c route_walking_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vector_navi_req_route_walking_search(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH,false); + msg_center_vector_navi_req_route_walking_search(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::route_transit_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -713,13 +694,10 @@ JSIValue BaiduMapComponentModule::route_transit_search(const JSIValue thisVal, c route_transit_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vector_navi_req_route_transit_search(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH,false); + msg_center_vector_navi_req_route_transit_search(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::auth_license(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -732,13 +710,10 @@ JSIValue BaiduMapComponentModule::auth_license(const JSIValue thisVal, const JSI auth_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vector_navi_req_auth_license(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,false); + msg_center_vector_navi_req_auth_license(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,data,strlen(data)); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::getGeolocation(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -749,12 +724,9 @@ JSIValue BaiduMapComponentModule::getGeolocation(const JSIValue thisVal, const J ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION); geo_location_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); - bool hasCallback = setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION,true); - if (hasCallback) { - msg_center_vector_navi_req_geo_location(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION,true); + msg_center_vector_navi_req_geo_location(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION,data,strlen(data)); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::naviInit(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -767,13 +739,10 @@ JSIValue BaiduMapComponentModule::naviInit(const JSIValue thisVal, const JSIValu nav_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vector_navi_req_navi_init(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,false); + msg_center_vector_navi_req_navi_init(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,data,strlen(data)); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRoutePlanStart(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -783,7 +752,7 @@ JSIValue BaiduMapComponentModule::onRoutePlanStart(const JSIValue thisVal, const ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START); route_plan_start_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRoutePlanSuccess(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -793,7 +762,7 @@ JSIValue BaiduMapComponentModule::onRoutePlanSuccess(const JSIValue thisVal, con ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC); route_plan_success_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRoutePlanFail(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -803,7 +772,7 @@ JSIValue BaiduMapComponentModule::onRoutePlanFail(const JSIValue thisVal, const ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL); route_plan_fail_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onNaviStart(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -813,7 +782,7 @@ JSIValue BaiduMapComponentModule::onNaviStart(const JSIValue thisVal, const JSIV ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START); navi_start_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onNaviDestroy(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -823,7 +792,7 @@ JSIValue BaiduMapComponentModule::onNaviDestroy(const JSIValue thisVal, const JS ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY); navi_destroy_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRoadGuideTextUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -833,7 +802,7 @@ JSIValue BaiduMapComponentModule::onRoadGuideTextUpdate(const JSIValue thisVal, ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE); road_guide_text_update_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRouteGuideIconUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -843,7 +812,7 @@ JSIValue BaiduMapComponentModule::onRouteGuideIconUpdate(const JSIValue thisVal, ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE); road_guide_icon_update_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRemainTimeUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -853,7 +822,7 @@ JSIValue BaiduMapComponentModule::onRemainTimeUpdate(const JSIValue thisVal, con ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE); remain_time_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRemainDistanceUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -863,7 +832,7 @@ JSIValue BaiduMapComponentModule::onRemainDistanceUpdate(const JSIValue thisVal, ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE); remain_distance_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRemainRouteUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -873,7 +842,7 @@ JSIValue BaiduMapComponentModule::onRemainRouteUpdate(const JSIValue thisVal, co ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE); remain_route_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onGpsStatusChange(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -883,7 +852,7 @@ JSIValue BaiduMapComponentModule::onGpsStatusChange(const JSIValue thisVal, cons ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE); gps_status_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRouteFarAway(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -893,7 +862,7 @@ JSIValue BaiduMapComponentModule::onRouteFarAway(const JSIValue thisVal, const J ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY); route_far_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onRoutePlanYawing(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -904,7 +873,7 @@ JSIValue BaiduMapComponentModule::onRoutePlanYawing(const JSIValue thisVal, cons route_plan_yawing_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING,true); //msg_center_vector_navi_req_route_plan_yawing(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING,Callback,1); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onReRouteComplete(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -914,7 +883,7 @@ JSIValue BaiduMapComponentModule::onReRouteComplete(const JSIValue thisVal, cons ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE); reroute_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::onArriveDest(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -924,7 +893,7 @@ JSIValue BaiduMapComponentModule::onArriveDest(const JSIValue thisVal, const JSI ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION); arrivedest_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION,true); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } JSIValue BaiduMapComponentModule::poi_sug_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) @@ -937,13 +906,10 @@ JSIValue BaiduMapComponentModule::poi_sug_search(const JSIValue thisVal, const J poi_sug_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vertor_navi_req_poi_sug_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,false); + msg_center_vertor_navi_req_poi_sug_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); } /** @@ -1034,13 +1000,10 @@ JSIValue BaiduMapComponentModule::Geocode_search(const JSIValue thisVal, const J geocode_search_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vector_navi_req_geocode_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,false); + msg_center_vector_navi_req_geocode_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); } @@ -1054,13 +1017,10 @@ JSIValue BaiduMapComponentModule::Regeocode_search(const JSIValue thisVal, const regeocode_search_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); - bool hasSuccessCallback = setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,true); - bool hasFailCallback = setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,false); - if (hasSuccessCallback || hasFailCallback) { - msg_center_vector_navi_req_regeocode_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,data,strlen(data)); - } - ace_free(data); - return JSI::CreateBoolean(true); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,false); + msg_center_vector_navi_req_regeocode_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); } /** @@ -1072,8 +1032,7 @@ JSIValue BaiduMapComponentModule::Destroy_page(const JSIValue thisVal, const JSI char *data = JSI::JsonStringify(args[0]); HILOG_INFO(HILOG_MODULE_ACE,"Destroy_page : %s \n",data); msg_center_vector_navi_req_destroy_page(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_DESTROY_PAGE,data,strlen(data)); - ace_free(data); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } /** @@ -1091,8 +1050,7 @@ JSIValue BaiduMapComponentModule::onBTConnect(const JSIValue thisVal, const JSIV OHOS::ACELite::JSIValue disconnectCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], DISCONNECT); setCallbackFunction(connectCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_BT_CONNECTED,true); setCallbackFunction(disconnectCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_BT_CONNECTED,false); - ace_free(data); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } /** @@ -1104,8 +1062,7 @@ JSIValue BaiduMapComponentModule::NaviDestroy(const JSIValue thisVal, const JSIV char *data = JSI::JsonStringify(args[0]); HILOG_INFO(HILOG_MODULE_ACE,"exitNavigation : %s \n",data); msg_center_vector_navi_req_destroy_from_watch(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_DESTROY_FROM_WATCH,data,strlen(data)); - ace_free(data); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } /** @@ -1117,96 +1074,9 @@ JSIValue BaiduMapComponentModule::StopAnswer(const JSIValue thisVal, const JSIVa char *data = JSI::JsonStringify(args[0]); HILOG_INFO(HILOG_MODULE_ACE,"StopAnswer : %s \n",data); msg_center_xiaodu_send_stop_answer(MSGCENTER_CMD_XIAODU,MSGCENTER_TYPE_ID_XIAODU_SEND_JS_EXIT,data,strlen(data)); - ace_free(data); - return JSI::CreateBoolean(true); + return JSI::CreateBoolean(0); } -void BaiduMapComponentModule::OnDestroy() -{ - HILOG_INFO(HILOG_MODULE_ACE, "BaiduMapComponent OnDestroy\n"); - - //poi_nearby_search - ReleaseJsValue(poi_successCallback); - ReleaseJsValue(poi_failCallback); - ReleaseJsValue(poi_callbackContext); - //route_riding_search - ReleaseJsValue(route_riding_successCallback); - ReleaseJsValue(route_riding_failCallback); - ReleaseJsValue(route_riding_callbackContext); - //route_walking_search - ReleaseJsValue(route_walking_successCallback); - ReleaseJsValue(route_walking_failCallback); - ReleaseJsValue(route_walking_callbackContext); - //route_transit_search - ReleaseJsValue(route_transit_successCallback); - ReleaseJsValue(route_transit_failCallback); - ReleaseJsValue(route_transit_callbackContext); - //auth_license - ReleaseJsValue(auth_successCallback); - ReleaseJsValue(auth_failCallback); - ReleaseJsValue(auth_callbackContext); - //onRoutePlanStart - ReleaseJsValue(route_plan_start_Callback); - ReleaseJsValue(route_plan_start_callbackContext); - //onRoutePlanSuccess - ReleaseJsValue(route_plan_success_Callback); - ReleaseJsValue(route_plan_success_callbackContext); - //onRoutePlanFail - ReleaseJsValue(route_plan_fail_Callback); - ReleaseJsValue(route_plan_fail_callbackContext); - //onNaviStart - ReleaseJsValue(navi_start_Callback); - ReleaseJsValue(navi_start_callbackContext); - //onNaviDestroy - ReleaseJsValue(navi_destroy_Callback); - ReleaseJsValue(navi_destroy_callbackContext); - //onRoadGuideTextUpdate - ReleaseJsValue(road_guide_text_update_Callback); - ReleaseJsValue(road_guide_text_update_callbackContext); - //onRouteGuideIconUpdate - ReleaseJsValue(road_guide_icon_update_Callback); - ReleaseJsValue(road_guide_icon_update_callbackContext); - //onRemainTimeUpdate - ReleaseJsValue(remain_time_Callback); - ReleaseJsValue(remain_time_callbackContext); - //onRemainDistanceUpdate - ReleaseJsValue(remain_distance_Callback); - ReleaseJsValue(remain_distance_callbackContext); - //onRemainRouteUpdate - ReleaseJsValue(remain_route_Callback); - ReleaseJsValue(remain_route_callbackContext); - //onGpsStatusChange - ReleaseJsValue(gps_status_Callback); - ReleaseJsValue(gps_status_callbackContext); - //onRouteFarAway - ReleaseJsValue(route_far_Callback); - ReleaseJsValue(route_far_callbackContext); - //onRoutePlanYawing - ReleaseJsValue(route_plan_yawing_Callback); - ReleaseJsValue(route_plan_yawing_callbackContext); - //onReRouteComplete - ReleaseJsValue(reroute_Callback); - ReleaseJsValue(reroute_callbackContext); - //onArriveDest - ReleaseJsValue(arrivedest_Callback); - ReleaseJsValue(arrivedest_callbackContext); - //poi_sug_search - ReleaseJsValue(poi_sug_successCallback); - ReleaseJsValue(poi_sug_failCallback); - ReleaseJsValue(poi_sug_callbackContext); - //geocode_search - ReleaseJsValue(geocode_search_successCallback); - ReleaseJsValue(geocode_search_failCallback); - ReleaseJsValue(geocode_search_callbackContext); - //regeocode_search - ReleaseJsValue(regeocode_search_successCallback); - ReleaseJsValue(regeocode_search_failCallback); - ReleaseJsValue(regeocode_search_callbackContext); - //BT_connect - ReleaseJsValue(bt_connect_successCallback); - ReleaseJsValue(bt_connect_failCallback); - ReleaseJsValue(bt_connect_callbackContext); -} void InitBaiduMapComponentModule(JSIValue exports) { @@ -1269,10 +1139,6 @@ void InitBaiduMapComponentModule(JSIValue exports) * stop anwser */ JSI::SetModuleAPI(exports, "stopAnswer", BaiduMapComponentModule::StopAnswer); - /** - * destroy - */ - JSI::SetOnDestroy(exports, BaiduMapComponentModule::OnDestroy); } } // namespace ACELite diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.h index f3d0e4599..5c665e1e5 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.h @@ -111,11 +111,6 @@ public: * stop answer */ static JSIValue StopAnswer(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); - - /** - * destroy - */ - static void OnDestroy(); }; void InitBaiduMapComponentModule(JSIValue exports); 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 deleted file mode 100644 index 2cd2d4ade..000000000 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2020 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ace_log.h" -#include "js_app_context.h" -#include "js_async_work.h" -#include "product_adapter.h" -#include -#include -#include "media_log.h" -#include "network_module.h" - -namespace OHOS { -namespace ACELite { -NetCallBack NetWorkModule::callback_; - -void NetWorkModule::TriggerCallbackListener(char *netConnectStatus, uint32_t Len) -{ - 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; - if (!JsAsyncWork::DispatchAsyncWork(AsyncExecuteCallback, const_cast(&callback_.netParam))) { - MEDIA_ERR_LOG("dispatch async work failed."); - } -} - -static bool ValidJsValue(JSIValue value) -{ - return (value != nullptr) && (!JSI::ValueIsUndefined(value)); -} - -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 argv[ARGC_ONE] = {result}; - JSI::CallFunction(callback_.net_connect_callback, callback_.net_connect_thisVal, argv, ARGC_ONE); - JSI::ReleaseValue(result); - } -} - -JSIValue NetWorkModule::RegisterConnectListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) -{ - if ((args == nullptr) || (argsNum == 0) || JSI::ValueIsUndefined(args[0])) { - HILOG_ERROR(HILOG_MODULE_ACE, "Invalid arguments for registering net connection callback"); - return JSI::CreateUndefined(); - } - - if (callback_.net_connect_callback != nullptr) { - HILOG_WARN(HILOG_MODULE_ACE, "net connection callback already registered"); - return JSI::CreateUndefined(); - } - - callback_.net_connect_thisVal = JSI::AcquireValue(thisVal); - callback_.net_connect_callback = JSI::AcquireValue(args[0]); - if (callback_.net_connect_callback == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "Failed to register net connection callback"); - return JSI::CreateUndefined(); - } - - // 可以在注册回调后执行其他必要的操作 - net_connect_status_change("test", strlen("test")); - - return JSI::CreateUndefined(); -} - -JSIValue NetWorkModule::UnregisterConnectListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) -{ - if (callback_.net_connect_callback == nullptr) { - HILOG_ERROR(HILOG_MODULE_ACE, "No net connection callback registered to unregister"); - return JSI::CreateUndefined(); - } - JSI::ReleaseValue(callback_.net_connect_thisVal); - JSI::ReleaseValue(callback_.net_connect_callback); - callback_.net_connect_thisVal = nullptr; - callback_.net_connect_callback = nullptr; - - return JSI::CreateUndefined(); -} - -JSIValue NetWorkModule::GetConnectState(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) -{ - - return JSI::CreateString(callback_.netParam.status); -} - -} -} - -#ifdef __cplusplus -extern "C" { -#endif - -void net_connect_status_change(char *netConnectStatus, uint32_t Len) -{ - OHOS::ACELite::NetWorkModule::TriggerCallbackListener(netConnectStatus, Len); -} - -#ifdef __cplusplus -} -#endif \ No newline at end of file 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 deleted file mode 100644 index 2ddad8815..000000000 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/network_module.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -* Copyright (c) CompanyNameMagicTag. 2021-2021. All rights reserved. -* Description: audio capture wrapper -* Author: Media Software Group -* Create: 2021-09-13 -*/ - -#ifndef NET_CONNECT_MODULE_H -#define NET_CONNECT_MODULE_H - -#include -#include "acelite_config.h" -#include "jsi.h" -#include "js_async_work.h" -#include "non_copyable.h" -#include "product_adapter.h" -#include "abilityms_slite_client.h" - -#ifdef __cplusplus -extern "C" { -#endif -void net_connect_status_change(char *netConnectStatus, uint32_t Len); -#ifdef __cplusplus -}; -#endif - -namespace OHOS { -namespace ACELite { - -struct NetParam { - char *status = nullptr; - uint32_t Len = 0; -}; - -struct NetCallBack { - JSIValue net_connect_callback = nullptr; - JSIValue net_connect_thisVal = nullptr; - NetParam netParam; -}; - -class NetWorkModule final : public MemoryHeap { -public: - ACE_DISALLOW_COPY_AND_MOVE(NetWorkModule); - NetWorkModule() = default; - ~NetWorkModule() = default; - static NetCallBack callback_; - static JSIValue RegisterConnectListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); - 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); -}; - -void InitNetWorkModule(JSIValue exports) -{ - JSI::SetModuleAPI(exports, "registerConnectListener", NetWorkModule::RegisterConnectListener); - JSI::SetModuleAPI(exports, "unregisterConnectListener", NetWorkModule::UnregisterConnectListener); - JSI::SetModuleAPI(exports, "getConnectState", NetWorkModule::GetConnectState); -} - - -} -} - - -#endif diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h index 2779e85a7..db16bf374 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h @@ -75,7 +75,6 @@ extern void InitBatteryModule(JSIValue exports); extern void InitLocaleModule(JSIValue exports); #endif -extern void InitNetWorkModule(JSIValue exports); // #ifdef FEATURE_ACELITE_SYSTEM_CAPABILITY // extern void InitCapabilityModule(JSIValue exports); // #endif @@ -133,7 +132,6 @@ const Module OHOS_MODULES[] = { // #ifdef FEATURE_ACELITE_SYSTEM_CAPABILITY // {"capability", InitCapabilityModule}, // #endif - {"network", InitNetWorkModule}, }; } // namespace ACELite } // namespace OHOS 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 deleted file mode 100644 index 5e4dbe069..000000000 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.cpp +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "ace_log.h" -#include "locale_util.h" -#include "key_parser.h" -#include "keys.h" -#include "image.h" -#include "image_module.h" -#include "common/image_cache_manager.h" -namespace OHOS { -namespace ACELite { -constexpr jerry_object_native_info_t ImageModule::gcCallback; -const char * const ImageModule::attrOnload = "onload"; -const char * const ImageModule::attrOnError = "onerror"; -const char * const ImageModule::attrSrc = "src"; -const char * const ImageModule::attrWidth = "width"; -const char * const ImageModule::attrHeight = "height"; -const char * const ImageModule::className = "Image"; - -void ImageModule::Init(jerry_value_t intlHandle) -{ - (void)intlHandle; - jerry_value_t gObj = jerry_get_global_object(); - JerrySetFuncProperty(gObj, className, CreateImage); -} -void ImageModule::RegisterAttributeFunc(jerry_value_t canvas2dContext, - const char *attributeName, - jerry_external_handler_t setterHandler, - jerry_external_handler_t getterHandler) -{ - // register canvas js attribute setter property via the jerry_define_own_property method - jerry_value_t propName = jerry_create_string(reinterpret_cast(attributeName)); - jerry_property_descriptor_t desc; - jerry_init_property_descriptor_fields(&desc); - desc.is_set_defined = true; - desc.setter = jerry_create_external_function(setterHandler); - desc.is_get_defined = true; - desc.getter = jerry_create_external_function(getterHandler); - jerry_value_t returnValue = jerry_define_own_property(canvas2dContext, propName, &desc); - jerry_free_property_descriptor_fields(&desc); - ReleaseJerryValue(propName, returnValue, VA_ARG_END_FLAG); -} -jerry_value_t ImageModule::CreateImage(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - if (!jerry_value_is_constructor(func)) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("use new to create Image")); - } - ImageModule *imageModule = new ImageModule(); - if (imageModule == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("memory is not enough")); - } - - imageModule->width_ = -1; - imageModule->height_ = -1; - if (argsNum >= 1) { - if (jerry_value_is_number(args[0])) { - imageModule->width_ = jerry_value_to_number(args[0]); - } else if (jerry_value_is_string(args[0])) { - char* val = MallocStringOf(args[0]); - if (val == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("val is nullptr")); - } - imageModule->width_ = atoi(val); - ACE_FREE(val); - } - } - if (argsNum >= static_cast(ArgsCount::NUM_2)) { - if (jerry_value_is_number(args[1])) { - imageModule->height_ = jerry_value_to_number(args[1]); - } else if (jerry_value_is_string(args[1])) { - char* val = MallocStringOf(args[1]); - if (val == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("val is nullptr")); - } - imageModule->height_ = atoi(val); - ACE_FREE(val); - } - } - - jerry_set_object_native_pointer(context, imageModule, &gcCallback); - RegisterAttributeFunc(context, attrOnload, OnLoadSetter, OnLoadGetter); - RegisterAttributeFunc(context, attrOnError, OnErrorSetter, OnErrorGetter); - RegisterAttributeFunc(context, attrSrc, OnSrcSetter, OnSrcGetter); - RegisterAttributeFunc(context, attrWidth, OnWidthSetter, OnWidthGetter); - RegisterAttributeFunc(context, attrHeight, OnHeightSetter, OnHeightGetter); - return UNDEFINED; -} - -jerry_value_t ImageModule::OnLoadSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - if (argsNum == 1 && jerry_value_is_function(args[0])) { - jerry_release_value(imageModel->onLoadFunc_); - imageModel->onLoadFunc_ = args[0]; - } else { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("set imageModel onload arg fail")); - } - return UNDEFINED; -} - -jerry_value_t ImageModule::OnLoadGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - (void)args; - (void)argsNum; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - return imageModel->onLoadFunc_; -} - -jerry_value_t ImageModule::OnErrorSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - if (argsNum >= 1 && jerry_value_is_function(args[0])) { - jerry_release_value(imageModel->onErrorFunc_); - imageModel->onErrorFunc_ = args[0]; - } else { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("set imageModel onload arg fail")); - } - return UNDEFINED; -} - -jerry_value_t ImageModule::OnErrorGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - (void)args; - (void)argsNum; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - return imageModel->onErrorFunc_; -} - -jerry_value_t ImageModule::OnSrcSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - - if (argsNum >= 1) { - ACE_FREE(imageModel->src_); - imageModel->src_ = const_cast(ParseImageSrc(args[0])); - } - if (imageModel->src_ == nullptr || strlen(imageModel->src_) == 0) { - OnCallBack(context, imageModel, false, "src is null"); - return UNDEFINED; - } - jerry_release_value(imageModel->jerrySrc_); - imageModel->jerrySrc_ = jerry_create_string(reinterpret_cast(imageModel->src_)); - - ImageInfo* image = ImageCacheManager::GetInstance().LoadSingleRes(imageModel->src_); - if (!image) { - OnCallBack(context, imageModel, false, "unknown image"); - return UNDEFINED; - } - OnCallBack(context, imageModel, true, "load sucess"); - return UNDEFINED; -} - -jerry_value_t ImageModule::OnSrcGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - (void)args; - (void)argsNum; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - if (jerry_value_is_string(imageModel->jerrySrc_)) { - return imageModel->jerrySrc_; - } - return UNDEFINED; -} - -jerry_value_t ImageModule::OnHeightSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - if (argsNum < 1) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("set height fail")); - } - imageModel->height_ = IntegerOf(args[0]); - return UNDEFINED; -} - -jerry_value_t ImageModule::OnHeightGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - (void)args; - (void)argsNum; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - return imageModel->height_; -} - -jerry_value_t ImageModule::OnWidthSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - if (argsNum < 1) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("set width fail")); - } - imageModel->width_ = IntegerOf(args[0]); - return UNDEFINED; -} - -jerry_value_t ImageModule::OnWidthGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum) -{ - (void)func; - (void)args; - (void)argsNum; - ImageModule* imageModel = nullptr; - jerry_get_object_native_pointer(context, (void**)&imageModel, &gcCallback); - if (imageModel == nullptr) { - return jerry_create_error(JERRY_ERROR_EVAL, - reinterpret_cast("get imageModel fail")); - } - return imageModel->width_; -} - -void ImageModule::OnCallBack(const jerry_value_t context, - const ImageModule *imageModule, - bool isSucess, - const char* msg) -{ - jerry_value_t targetFunction; - if (imageModule == nullptr) { - return; - } - if (isSucess) { - targetFunction = imageModule->onLoadFunc_; - } else { - targetFunction = imageModule->onErrorFunc_; - } - if (!jerry_value_is_function(targetFunction)) { - return; - } - const int16_t argcount = 1; - jerry_value_t arg = jerry_create_string(reinterpret_cast(msg)); - jerry_value_t args[argcount] = {arg}; - jerry_value_t ret_val = jerry_call_function (targetFunction, context, args, argcount); - if (jerry_value_is_error (ret_val)) { - HILOG_ERROR(HILOG_MODULE_ACE, "call back failed!"); - } - jerry_release_value(arg); - jerry_release_value (ret_val); -} -} -} - 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 deleted file mode 100644 index 867ebc253..000000000 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/image_module.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ACELITE_IMAGE_MODEL_H -#define OHOS_ACELITE_IMAGE_MODEL_H - -#include "acelite_config.h" -#include "image_component.h" -#include "gfx_utils/list.h" -#include "js_fwk_common.h" -namespace OHOS { -namespace ACELite { -class ImageModule final : public MemoryHeap { -enum class ArgsCount { NUM_1 = 1, NUM_2, NUM_3, NUM_4, NUM_5, NUM_6 }; -public: - const char* GetSrc() - { - return src_; - } - - int16_t GetWidth() - { - return width_; - } - - int16_t GetHeight() - { - return height_; - } - - ACE_DISALLOW_COPY(ImageModule); - /** - * @brief register Image object - */ - static void Init(jerry_value_t intlHandle); - - static void RegisterAttributeFunc(jerry_value_t canvas2dContext, - 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; - static const char * const attrSrc; - static const char * const attrWidth; - static const char * const attrHeight; - static const char * const className; -private: - ImageModule() - : src_(nullptr), - width_(-1), - height_(-1), - onLoadFunc_(UNDEFINED), - onErrorFunc_(UNDEFINED), - jerrySrc_(UNDEFINED) {} - - ~ImageModule() - { - jerry_release_value(onLoadFunc_); - jerry_release_value(onErrorFunc_); - jerry_release_value(jerrySrc_); - ACE_FREE(src_); - } - - static jerry_value_t CreateImage(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnLoadSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnLoadGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnErrorSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnErrorGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnSrcSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnSrcGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnHeightSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnHeightGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnWidthSetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - static jerry_value_t OnWidthGetter(const jerry_value_t func, - const jerry_value_t context, - const jerry_value_t args[], - const jerry_length_t argsNum); - -private: - char* src_; - int16_t width_; - int16_t height_; - jerry_value_t onLoadFunc_; - jerry_value_t onErrorFunc_; - jerry_value_t jerrySrc_; -}; -} -} -#endif // NUMBER_FORMAT_MODEL_H diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/intl_module.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/intl_module.cpp index bbb4da921..40214f00c 100755 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/intl_module.cpp +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/intl_module.cpp @@ -21,7 +21,6 @@ #include "string.h" #include "number_format_module.h" #include "js_fwk_common.h" -#include "image_module.h" namespace OHOS { namespace ACELite { void IntlModule::Init() @@ -34,7 +33,6 @@ void IntlModule::Init() #ifdef FEATURE_DATE_FORMAT DateTimeFormatModule::Init(baseObj); #endif - ImageModule::Init(baseObj); JerrySetNamedProperty(globalObj, "Intl", baseObj); jerry_release_value(globalObj); } 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..d4ecb8d31 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..53a5362dc 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/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a index 5cf8f150c..686c9eaaf 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..b91cc5452 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/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..bba9869d1 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..5ef202516 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/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a index 75cadbf49..73de5fecc 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..8e4eeec29 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/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..b18558186 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 @@ -12,7 +12,7 @@ #include "bts_br_gap.h" #include "bts_hfp_hf.h" #include "sample_common.h" -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI #include "audio_manager.h" #else #include "bt_audio_manager_wrapper.h" @@ -59,7 +59,7 @@ typedef struct { hfp_hf_sample_cmd_handle_func func; } sample_hfp_hf_hdl_info; -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI struct AudioManager *g_audio_manager = NULL; struct AudioAdapter *g_primary_adapter = NULL; struct AudioAdapter *g_bluetooth_adapter = NULL; @@ -121,7 +121,7 @@ static void sample_handle_hfp_connection_state_changed(const bd_addr_t *bd_addr, static int32_t g_hfp_media_status = 0; static int32_t g_hfp_media_flag = 0; -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI #define MAX_AUDIO_ADAPTER_NUM 2 #define MAX_KEY_VALUE_LEN 25 @@ -143,7 +143,7 @@ static int32_t g_hdl_dn_spk = -1; static int32_t g_hdl_dn_sco = -1; #endif -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI static void audio_sample_attr_init(enum AudioFormat audio_format, struct AudioSampleAttributes *param) { param->type = AUDIO_IN_COMMUNICATION; @@ -379,7 +379,7 @@ static int32_t abrogation_audio_capture_render_pipeline(void) } #endif -#ifndef MEMORY_MINI_HFP_SUPPORT +#ifndef MEMORY_MINI static int32_t audio_stream_init(void) { /* 请求音频焦点 */ @@ -444,7 +444,7 @@ static int32_t sample_audio_init_start_task_body(const void *data) g_hfp_media_flag = HFP_MEDIA_FLAG_BUSY; int ret; -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI ret = audio_capture_render_init(); if (ret != 0) { bts_sample_log("{%s():%d} audio capture render init failed\n", __FUNCTION__, __LINE__); @@ -458,7 +458,7 @@ static int32_t sample_audio_init_start_task_body(const void *data) g_hfp_media_status = HFP_MEDIA_STATUS_INIT; /* 建立电话上下行通路 */ -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI ret = establish_audio_capture_render_pipeline(); if (ret != 0) { bts_sample_log("{%s():%d} establish audio capture render pipeline failed\n", __FUNCTION__, __LINE__); @@ -490,7 +490,7 @@ static int32_t sample_audio_deinit_task_body(const void *data) /* 设置媒体状态繁忙 */ g_hfp_media_flag = HFP_MEDIA_FLAG_BUSY; -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI abrogation_audio_capture_render_pipeline(); #else abrogation_audio_stream_pipeline(); @@ -651,7 +651,7 @@ static void sample_handle_hfp_call_state_changed(const bd_addr_t *bd_addr, const void sample_hfp_hf_set_spk_volume(uint8_t volume) { -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI /* vol range [0, 1.0] */ float vol = (float)volume / SAMPLE_HFP_PROF_VOL_LEVEL; if (g_audio_render_down_link != NULL) { @@ -686,13 +686,13 @@ static void sample_handle_hfp_codec_changed(const bd_addr_t *bd_addr, int codec) sample_hfp_hf_print_addr(bd_addr); bts_sample_log_with_func("codec : %d\n", codec); if (codec == HFP_HF_CODEC_ID_CVSD) { -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI g_hfp_codec = AUDIO_FORMAT_PCM_16_BIT; #else g_hfp_codec = PCM; #endif } else if (codec == HFP_HF_CODEC_ID_MSBC) { -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI g_hfp_codec = AUDIO_FORMAT_mSBC; #else g_hfp_codec = mSBC; @@ -756,7 +756,7 @@ static void sample_hfp_hf_cmd_00_reg_callback(const char **params, int32_t param // 蓝牙通话注册回调 void wstp_hfp_hf_reg_callback(void) { -#ifdef MEMORY_MINI_HFP_SUPPORT +#ifdef MEMORY_MINI audio_hal_init(); #endif errcode_t ret = ERRCODE_BT_SUCCESS; diff --git a/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_spp_service.c b/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_spp_service.c index 618e1e9a1..af41b6e68 100755 --- a/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_spp_service.c +++ b/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_spp_service.c @@ -158,8 +158,6 @@ static void sample_spp_cmd_server_create(const char **params, int32_t params_cnt bts_sample_log_with_func("spp_server_create ret: %x\n", ret); } -static osal_task *g_spp_server_accept_task = NULL; -static bool g_spp_server_wait_accept = false; static int sample_spp_server_accept_task_body(const void *data) { int server_id = (int)(intptr_t)data; @@ -168,13 +166,6 @@ static int sample_spp_server_accept_task_body(const void *data) int ret = spp_server_accept(server_id); bts_sample_log_with_func("spp_server_accept ret: %x\n", ret); - g_spp_server_wait_accept = false; - bts_sample_log_with_func("spp_server_accept task %x task.task %x\n", - g_spp_server_accept_task, g_spp_server_accept_task->task); - if (g_spp_server_accept_task != NULL && g_spp_server_accept_task->task != NULL) { - osal_kthread_destroy(g_spp_server_accept_task, 0); - g_spp_server_accept_task = NULL; - } return OSAL_SUCCESS; } @@ -182,20 +173,15 @@ static int sample_spp_server_accept_task_body(const void *data) /* 等待client连接 */ void wstp_spp_cmd_server_accept(uint32_t server_id) { - if (g_spp_server_wait_accept == true) { - bts_sample_log_with_func("create task fail. exsit running task.\n"); - return; - } - g_spp_server_wait_accept = true; - g_spp_server_accept_task = osal_kthread_create(sample_spp_server_accept_task_body, + osal_task *task = osal_kthread_create(sample_spp_server_accept_task_body, (void *)(uintptr_t)server_id, "spp_server_accept_task", SAMPLE_SPP_TASK_STACK_SIZE); - if (g_spp_server_accept_task == NULL) { + if (task == NULL) { bts_sample_log_with_func("create task fail\n"); return; } - int ret = osal_kthread_set_priority(g_spp_server_accept_task, SAMPLE_SPP_TASK_PRI); + int ret = osal_kthread_set_priority(task, SAMPLE_SPP_TASK_PRI); if (ret != OSAL_SUCCESS) { bts_sample_log_with_func("set pri error: %08x\n", ret); } 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..d118c69b4 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 @@ -63,8 +63,7 @@ typedef enum { BTSRV_SAMPLE_GAP_GET_FEATURE_CONFIG, /* 33 蓝牙特性获取 */ BTSRV_SAMPLE_GAP_RECONNECT_PHONE, /* 34 重连手机 */ - BTSRV_SAMPLE_GAP_SET_INQUIRY_PARAM, /* 35 设置搜到参数 */ - BTSRV_SAMPLE_GAP_SET_SERVICE_TASK_PRIORITY, /* 36 设置BT_SERVICE_TASK优先级 */ + BTSRV_SAMPLE_GAP_SET_INQUIRY_PARAM, /* 35 设置搜到参数 */ } btsrv_gap_sample_cmd_id; typedef enum { @@ -681,8 +680,6 @@ static void btsrv_sample_cmd_disconnect_remote_device(const char **params, int32 errcode_t ret = gap_ble_disconnect_remote_device(&bd_addr); bts_sample_log("gap_disconnect_remote_device ret(bool): %u\n", ret); } - -bd_addr_t g_remote_connect_addr = {0}; acl_conn_ext_mode g_acl_conn_ext_mode = ACL_EXT_MODE_CONNECT_A2DP; /* 连接设备 params: addr addr_type */ static void btsrv_sample_cmd_connect_remote_device(const char **params, int32_t params_cnt) @@ -718,7 +715,6 @@ bool wstp_connect_remote_device(const bd_addr_t *bd_addr) return false; } errcode_t ret = gap_connect_remote_device(bd_addr); - (void)memcpy_s(&g_remote_connect_addr, sizeof(bd_addr_t), bd_addr, sizeof(bd_addr_t)); bts_sample_log("gap_connect_remote_device ret(errcode_t): %x\n", ret); return (ret == ERRCODE_BT_SUCCESS) ? true : false; } @@ -728,17 +724,6 @@ static void sample_gap_state_changed_callback(const int transport, const int sta bts_sample_log("gap_state_changed_callback transport: %d status: %d\n", transport, status); } -/* 主动发起连接 */ -static bool is_active_connection(const bd_addr_t *bd_addr) -{ - if (memcmp(g_remote_connect_addr.addr, bd_addr->addr, BD_ADDR_LEN) == 0) { - (void)memset_s(g_remote_connect_addr.addr, sizeof(bd_addr_t), 0, sizeof(bd_addr_t)); - return true; - } else { - return false; - } -} - static void sample_gap_acl_state_changed_callback(const bd_addr_t *bd_addr, gap_acl_state_t state, unsigned int reason) { bts_sample_log("gap_acl_state_changed_callback addr: "); @@ -753,7 +738,7 @@ static void sample_gap_acl_state_changed_callback(const bd_addr_t *bd_addr, gap_ } #ifndef MEMORY_MINI #if (BTH_BREDR_ONLY == YES) || (BTH_BREDR_LE_DOUBLE == YES) - if (state == GAP_ACL_STATE_CONNECTED && ((uint32_t)device_class & 0x200) == 0 && is_active_connection(bd_addr)) { + if (state == GAP_ACL_STATE_CONNECTED && ((uint32_t)device_class & 0x200) == 0) { /* 只要是非手机设备,连接成功后就先初始化audio manager为音乐播放 */ bts_sample_log("sample_gap_acl_state_changed_callback call AudioManagerInit - AUDIO_STREAM_MUSIC\n"); @@ -1206,17 +1191,6 @@ static void btsrv_sample_cmd_reconnect_phone(const char **params, int32_t params bts_sample_log("reconnect phone ret:%d.\n", ret); } -static void btsrv_sample_cmd_set_service_task_priority(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 task_priority = (uint16_t)atoi(params[0]); - errcode_t ret = bts_set_service_task_priority(task_priority); - bts_sample_log("bts set service task priority ret:0x%x priority:%d\n", ret, task_priority); -} - btsrv_sample_cmd_hdl_info g_btsrv_gap_sample_hdls[] = { /* 0 */ { BTSRV_SAMPLE_GAP_ENABLE_BLE, btsrv_sample_cmd_enable_ble }, @@ -1270,7 +1244,6 @@ 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} }; void btsrv_gap_sample_cmd(uint32_t cmd_id, const char **params, int32_t params_cnt) diff --git a/code/sdk/tools/pkg/bin/brandy/bt.bin b/code/sdk/tools/pkg/bin/brandy/bt.bin index 41c634dfb..7e312acea 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:23a8ebf4fe1e677662ba96dd9882af0c8247ecfee9fcb7c5c79666128b66f125 +size 425536 diff --git a/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin b/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin index 5df93c67b..0769cfb63 100755 --- a/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin +++ b/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c132d7fb64e2064b3f823e2415fda1ccf6c490c84c89651397f51823b8d72782 +oid sha256:52718d4082ae98fca23b0b5e19bd01a07bcb42bb9f7f152e203854f8bac7bd7a size 350088 diff --git a/code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin b/code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin index 1c60a8219..bf844e961 100755 --- a/code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin +++ b/code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:955fa51b4e669f5c6730cdb6a1af28a886593e312c7de19a294be3416f37f09e +oid sha256:37c3879f164d520afa160bee7505eabd501840aca871b3077033ebc3bfbe0c23 size 331008 diff --git a/code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin b/code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin index c0b77b065..5208ee43b 100755 --- a/code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin +++ b/code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3cbcb5af41b109af9b8385fb4dd2412013115cd287c7b7fa88e4752a2d9dee23 +oid sha256:7ef85fa292de2d6ccfd8009f7a758234cf2fa4d5a2df9def4e8fc46f0765ba6b size 344736 diff --git a/code/sdk/tools/pkg/chip_packet/brandy/packet.py b/code/sdk/tools/pkg/chip_packet/brandy/packet.py index 4482204fc..b4451d336 100755 --- a/code/sdk/tools/pkg/chip_packet/brandy/packet.py +++ b/code/sdk/tools/pkg/chip_packet/brandy/packet.py @@ -24,17 +24,11 @@ from param_packet import gen_flash_part_bin from nv_binary import nv_begin # brandy packet -def build_brandy_other_bin(pack_style_str, flash_size): +def build_brandy_other_bin(pack_style_str): ''' build brandy partition and nv ''' chip_dir = os.path.join(SDK_DIR, "build", "config", "target_config", "brandy") # 分区配置文件路径 - partition_cfg = os.path.join(chip_dir, "param_sector") - if flash_size.endswith("0x1000000"): - # partition_cfg = os.path.join(partition_cfg, "param_sector_16M.json") - partition_cfg = os.path.join(partition_cfg, "param_sector_fd230.json") - else: - partition_cfg = os.path.join(partition_cfg, "param_sector.json") - print("partition_cfg {}".format(partition_cfg)) + partition_cfg = os.path.join(chip_dir, "param_sector", "param_sector.json") partition_bin = os.path.join(SDK_DIR, "output", "brandy", "partition_table.bin") # nv配置文件路径 nv_config_json = os.path.join(chip_dir, "nv_bin_cfg") @@ -52,72 +46,10 @@ def build_brandy_other_bin(pack_style_str, flash_size): gen_flash_part_bin(partition_cfg, partition_bin) nv_begin(nv_config_json, targets, 0) -def make_all_in_one_packet_8M(pack_style_str): - # make all in one packet - bin_dir = os.path.join(PKG_DIR, "bin", "brandy") - application_dir = os.path.join(SDK_DIR, - "output", - "brandy", - "acore", - pack_style_str) - recovery_target = "%s-r" % pack_style_str - recovery_target = recovery_target.replace('-user', '') - recovery_bin = os.path.join(SDK_DIR, - "output", - "brandy", - "acore", - recovery_target, - "recovery.bin") - recovery_bx = recovery_bin + "|0x70050000|0x40000|100" - - upload_app_fwpkg = os.path.join(PKG_DIR, "fwpkg", "brandy", "upload_app.fwpkg") - - ssb = os.path.join(SDK_DIR, "output", "brandy", "acore", "brandy-ssb", "ssb.bin") - if not os.path.exists(ssb): - ssb = os.path.join(bin_dir, "ssb.bin") - print("ssb_path: ", ssb) - ssb_bx = ssb + "|0x70000000|0x20000|0" - - partition = os.path.join(SDK_DIR, "output", "brandy", "partition_table.bin") - partition_bx = partition + "|0x7004F000|0x1000|100" - nv = os.path.join(SDK_DIR, "output", "brandy", "nv_bin", "brandy_all_nv.bin") - nv_bx = nv + "|0x707F9000|0x4000|100" - - app = os.path.join(application_dir, "application.bin") - app_bx = app + "|0x702B0000|0x549000|18" - bt = os.path.join(bin_dir, "bt.bin") - bt_bx = bt + "|0x70090000|0x70000|20" - - target_env = TargetEnvironment(pack_style_str) - dsp_version = target_env.get("dsp_version") - dsp_main = os.path.join(bin_dir, "dsp", dsp_version, "dsp_main.bin") - dsp_main_bx = dsp_main + "|0x70100000|0x70000|22" - dsp_overlay = os.path.join(bin_dir, "dsp", dsp_version, "dsp_overlay.bin") - dsp_overlay_bx = dsp_overlay + "|0x70170000|0x140000|26" - - fs = os.path.join(application_dir, "file.bin") - fs_bx = fs + "|0xFFFFFFFF|0xFFFFFFFF|101" - - try: - packet_post_agvs = list() - packet_post_agvs.append(ssb_bx) - packet_post_agvs.append(partition_bx) - packet_post_agvs.append(app_bx) - packet_post_agvs.append(recovery_bx) - packet_post_agvs.append(bt_bx) - packet_post_agvs.append(dsp_main_bx) - packet_post_agvs.append(dsp_overlay_bx) - packet_post_agvs.append(nv_bx) - packet_post_agvs.append(fs_bx) - packet_bin(upload_app_fwpkg, packet_post_agvs) - except Exception as e: - print(e) - exit(-1) - -def make_all_in_one_packet_fd230(pack_style_str): +def make_all_in_one_packet(pack_style_str): # make all in one packet - print("make_all_in_one_packet_fd230 {}".format(pack_style_str)) + build_brandy_other_bin(pack_style_str) bin_dir = os.path.join(PKG_DIR, "bin", "brandy") application_dir = os.path.join(SDK_DIR, @@ -184,79 +116,6 @@ def make_all_in_one_packet_fd230(pack_style_str): print(e) exit(-1) -def make_all_in_one_packet_16M(pack_style_str): - # make all in one packet - bin_dir = os.path.join(PKG_DIR, "bin", "brandy") - application_dir = os.path.join(SDK_DIR, - "output", - "brandy", - "acore", - pack_style_str) - recovery_target = "%s-r" % pack_style_str - recovery_target = recovery_target.replace('-user', '') - recovery_bin = os.path.join(SDK_DIR, - "output", - "brandy", - "acore", - recovery_target, - "recovery.bin") - recovery_bx = recovery_bin + "|0x70B80000|0x100000|100" - - upload_app_fwpkg = os.path.join(PKG_DIR, "fwpkg", "brandy", "upload_app.fwpkg") - - ssb = os.path.join(SDK_DIR, "output", "brandy", "acore", "brandy-ssb", "ssb.bin") - if not os.path.exists(ssb): - ssb = os.path.join(bin_dir, "ssb.bin") - print("ssb_path: ", ssb) - ssb_bx = ssb + "|0x70000000|0x20000|0" - - partition = os.path.join(SDK_DIR, "output", "brandy", "partition_table.bin") - partition_bx = partition + "|0x7004F000|0x1000|100" - nv = os.path.join(SDK_DIR, "output", "brandy", "nv_bin", "brandy_all_nv.bin") - nv_bx = nv + "|0x70C80000|0x4000|100" - - app = os.path.join(application_dir, "application.bin") - app_bx = app + "|0x70380000|0x800000|18" - - bt = os.path.join(bin_dir, "bt.bin") - bt_bx = bt + "|0x70090000|0x70000|20" - - target_env = TargetEnvironment(pack_style_str) - dsp_version = target_env.get("dsp_version") - dsp_main = os.path.join(bin_dir, "dsp", dsp_version, "dsp_main.bin") - dsp_main_bx = dsp_main + "|0x70100000|0xC0000|22" - dsp_overlay = os.path.join(bin_dir, "dsp", dsp_version, "dsp_overlay.bin") - dsp_overlay_bx = dsp_overlay + "|0x701C0000|0x1C0000|26" - - fs = os.path.join(application_dir, "file.bin") - fs_bx = fs + "|0xFFFFFFFF|0xFFFFFFFF|101" - - try: - packet_post_agvs = list() - packet_post_agvs.append(ssb_bx) - packet_post_agvs.append(partition_bx) - packet_post_agvs.append(app_bx) - packet_post_agvs.append(recovery_bx) - packet_post_agvs.append(bt_bx) - packet_post_agvs.append(dsp_main_bx) - packet_post_agvs.append(dsp_overlay_bx) - packet_post_agvs.append(nv_bx) - packet_post_agvs.append(fs_bx) - packet_bin(upload_app_fwpkg, packet_post_agvs) - except Exception as e: - print(e) - exit(-1) - - -def make_all_in_one_packet(pack_style_str, flash_size): - # make all in one packet - build_brandy_other_bin(pack_style_str, flash_size) - if flash_size.endswith("0x1000000"): - make_all_in_one_packet_fd230(pack_style_str) - # make_all_in_one_packet_16M(pack_style_str) - else: - make_all_in_one_packet_8M(pack_style_str) - def is_packing_files_exist(soc, pack_style_str): """ 判断打包文件是否存在 diff --git a/code/sdk/tools/pkg/packet.py b/code/sdk/tools/pkg/packet.py index cab6482be..70fab3483 100755 --- a/code/sdk/tools/pkg/packet.py +++ b/code/sdk/tools/pkg/packet.py @@ -17,7 +17,6 @@ def main(): print("Parameter error") build_soc = sys.argv[1] build_target = sys.argv[2] - flash_size = sys.argv[3] load_fmt = "chip_packet.%s.packet" %build_soc load_mod = importlib.import_module(load_fmt) @@ -27,7 +26,7 @@ def main(): lost = ";".join(lost_file) print(f"cannot find {lost}") exit(-1) - load_mod.make_all_in_one_packet(build_target, flash_size) + load_mod.make_all_in_one_packet(build_target) if __name__ == "__main__": main() diff --git a/patch_602_0812_to_0911.txt b/patch_602_0812_to_0911.txt deleted file mode 100644 index cf713ecfb..000000000 --- a/patch_602_0812_to_0911.txt +++ /dev/null @@ -1,49 +0,0 @@ -【补丁名称】patch_602_0812_to_0911 -【基础版本】b602 + 0521 + 0626 + 7020 + 0812 -【修复问题】 -BT合入内容 - 1、提供配置BT_SERVICE_TASK任务优先级的接口。 - 2、白名单流控方案,解决BLE配对B核数据积压导致内存不足问题。 - 3、解决T1来电未打断音乐的问题。 - 4、解决task创建过多导致通话通路未创建的问题。 - 5、屏蔽bt睡眠唤醒统计日志。 -PLT合入内容 - 1、msgcenter与native app代码解耦。 - 2、nv flash下电前刷新机制调整。 - 3、支持16M norFlash部署。 -MEDIA合入内容 - 1、解决视频停播问题。 -GUI合入内容 - 1、修复MemCheck挂死问题 - 2、修复UIKIT SAMPLE选择足球效果死机重启 - 3、UICrossView优化 - 4、针对无动画的ChangeSlice优化 - 5、异步及ULPS优化 - 6、支持切换页面时清除设备分发状态和缓存数据 - 7、支持SlipFlow - 8、修复视频表盘滑动到指南针不转动问题 -OHOS合入内容 - 1、解决jsapp内多次跳转page内存持续增长OOM问题。 - 2、增加network jsi,方便客户native对接。 - 3、解决贪吃蛇性能问题,提供drawImage方式。 -NATIVE-JS sample合入内容 - 1、解决美人鱼耳机无法控制音量问题。 - 2、解决取消配对后连接状态未刷新问题。 - 3、调整音量同步逻辑。 - 4、音乐播放结束回调不能直接操作UI。 - 5、刪除PresenterTask类。 - 6、解决蜂窝list内存泄露。 -【修改影响】NA - -【使用方法】 - 1、合入0521补丁 - 2、合入0626补丁 - 3、合入0720补丁 - 4、合入0812补丁 - 4、合入0909补丁 -【自测情况】 - 自验证范围: - 全功能冒烟 - 自验证target: - Native-js、target3 rc版本 -【是否合入版本】根据测试结果确定