From: luozheng <1732036298@qq.com> Date: Thu, 23 Apr 2026 02:53:47 +0000 (+0800) Subject: 1201patch合并(补交遗漏的) X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=d36ad443cf794181b6ea58984ce99a5dbad929d2;p=mirrors%2FFD230.git 1201patch合并(补交遗漏的) --- diff --git a/code/sdk/application/wearable/n9/nativeapp/nativelauncher/include/ui_stopwatch_resource.h b/code/sdk/application/wearable/n9/nativeapp/nativelauncher/include/ui_stopwatch_resource.h deleted file mode 100644 index 56019f1cd..000000000 --- a/code/sdk/application/wearable/n9/nativeapp/nativelauncher/include/ui_stopwatch_resource.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2025-2025. All rights reserved. - * Description: UIStopWatchResource - * Create: 2025-06-05 - */ - -#ifndef UI_STOPWATCH_RESOURCE_H -#define UI_STOPWATCH_RESOURCE_H - -#include - -namespace OHOS { -static const int IMAGE_STOPWATCH_STOPWATCH01 = 0x100001; -static const int IMAGE_STOPWATCH_STOPWATCH02 = 0x100002; -static const int IMAGE_STOPWATCH_STOPWATCH04 = 0x100003; -static const int IMAGE_STOPWATCH_STOPWATCH06 = 0x100004; -static const int IMAGE_STOPWATCH_STOPWATCH08 = 0x100005; -static const int IMAGE_STOPWATCH_STOPWATCH10 = 0x100006; -static const int IMAGE_STOPWATCH_STOPWATCH12 = 0x100007; -static const int IMAGE_STOPWATCH_STOPWATCH14 = 0x100008; -static const int IMAGE_STOPWATCH_STOPWATCH16 = 0x100009; -static const int IMAGE_STOPWATCH_STOPWATCH19 = 0x10000a; -static const int IMAGE_STOPWATCH_STOPWATCH20 = 0x10000b; -} // OHOS -#endif // UI_STOPWATCH_RESOURCE_H diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/languagecode/src/LanguageSwitchView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/languagecode/src/LanguageSwitchView.cpp index 62381f6d1..519c62691 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/languagecode/src/LanguageSwitchView.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/languagecode/src/LanguageSwitchView.cpp @@ -110,8 +110,9 @@ namespace OHOS bool LanguageSwitchView::LanguageSwitchScrollViewInit(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::LanguageSwitchScrollViewInit"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::LanguageSwitchScrollViewInit"); LanguageSwitchScrollView = new UIScrollView(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::LanguageSwitchScrollViewInit1"); if (LanguageSwitchScrollView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::LanguageSwitchScrollView new fail!"); @@ -321,7 +322,8 @@ namespace OHOS { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::OnStart"); LanguageSwitchViewInit(); - InithintView(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::OnStart1"); + // InithintView(); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::OnStart end"); return; } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/uisample/src/UISampleView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/uisample/src/UISampleView.cpp deleted file mode 100644 index 66dace231..000000000 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/uisample/src/UISampleView.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. - * Description: SettingView.cpp - * Author: - * Create: 2021-11-23 - */ - -#include - -#include "uisample/include/UISampleView.h" -#include "uisample/include/UISamplePresenter.h" -#include "ui_test_group.h" - -namespace OHOS { -static UISampleView *g_pUISampleView = nullptr; - -UISampleView::UISampleView() -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UISampleView::UISampleView"); - g_pUISampleView = this; -} - -UISampleView::~UISampleView() -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UISampleView::~UISampleView"); - g_pUISampleView = nullptr; -} - -UISampleView* UISampleView::GetInstance() -{ - return g_pUISampleView; -} - -void UISampleView::InitView() -{ - if ((mainList_ == nullptr) && (adapter_ == nullptr)) { - mainList_ = new UIList(UIList::VERTICAL); - mainList_->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - mainList_->SetThrowDrag(true); - mainList_->SetReboundSize(100); // 100: rebound size - mainList_->SetElastic(true); - mainList_->SetYScrollBarVisible(true); - adapter_ = new TestCaseListAdapter(); - UITestGroup::GetInstance()->SetUpTestCase(); - mainList_->SetAdapter(adapter_); - - dragListener_ = new UISampleOnDragListener(); - if (dragListener_ == nullptr) { - return; - } - mainList_->SetOnDragListener(dragListener_); - } - AddViewToRootContainer(mainList_); - RootView::GetInstance()->Invalidate(); -} - -void UISampleView::OnStart() -{ - InitView(); -} - -void UISampleView::OnStop() -{ - if (adapter_ != nullptr) { - delete adapter_; - adapter_ = nullptr; - } - if (dragListener_ != nullptr) { - delete dragListener_; - dragListener_ = nullptr; - } - if (mainList_ != nullptr) { - delete mainList_; - mainList_ = nullptr; - } - return; -} -} diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp deleted file mode 100644 index fe58f9101..000000000 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp +++ /dev/null @@ -1,160 +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 "test_case_list_adapter.h" -#include "common/screen.h" -#include "components/ui_button.h" -#include "components/ui_label_button.h" -#include "gfx_utils/list.h" -#include "ui_test.h" -#include "uisample/include/UISampleView.h" -#include "ui_test_group.h" -#include "wearable_log.h" - -namespace OHOS { -namespace { -const uint16_t TESTCASE_BUTTON_HEIGHT = 100; -const uint16_t STYLE_BORDER_WIDTH_VALUE = 4; -} // namespace - -static RootView::OnKeyActListener *g_keyListener = nullptr; - -uint16_t TestCaseListAdapter::GetCount() -{ - return UITestGroup::GetInstance()->GetTestCase().Size(); -} - -class TransparentBackButton : public UIButton { -public: - TransparentBackButton() : UIButton() - { - opaScale_ = OPA_TRANSPARENT; - } - - bool OnClickEvent(const ClickEvent& event) override - { - UISampleView::GetInstance()->GetRootContainer()->RemoveAll(); - UITest* uiTest = UITestGroup::GetInstance()->GetTestCase(GetViewId()); - if (uiTest != nullptr) { - uiTest->TearDown(); - } - RootView::GetInstance()->SetOnKeyActListener(g_keyListener); - g_keyListener = nullptr; - UISampleView::GetInstance()->InitView(); - return true; - } -}; - -class UiTestClickListener : public UIView::OnClickListener { -public: - UiTestClickListener() {} - ~UiTestClickListener() - { - if (backBtn_ != nullptr) { - delete backBtn_; - backBtn_ = nullptr; - } - } - - bool OnClick(UIView& view, const ClickEvent& event) override - { - UIViewGroup* rootContainer = UISampleView::GetInstance()->GetRootContainer(); - UITest* uiTest = UITestGroup::GetInstance()->GetTestCase(view.GetViewId()); - if (uiTest == nullptr) { - return false; - } - uiTest->SetUp(); - rootContainer->RemoveAll(); - UIView* tempView = const_cast(uiTest->GetTestView()); - if (tempView != nullptr) { - tempView->SetTouchable(true); - tempView->SetViewId(view.GetViewId()); - tempView->SetPosition(tempView->GetX(), tempView->GetY()); - rootContainer->Add(tempView); - g_keyListener = RootView::GetInstance()->GetOnKeyActListener(); - RootView::GetInstance()->SetOnKeyActListener(nullptr); - } - 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()); - rootContainer->Add(backBtn_); - rootContainer->Invalidate(); - return true; - } - -private: - UIButton* backBtn_{nullptr}; -}; - -UIView* TestCaseListAdapter::GetView(UIView* inView, int16_t index) -{ - List testCaseList = UITestGroup::GetInstance()->GetTestCase(); - if (testCaseList.IsEmpty()) { - return nullptr; - } - if ((index > testCaseList.Size() - 1) || (index < 0)) { - return nullptr; - } - UILabelButton* item = nullptr; - if (inView == nullptr) { - item = new UILabelButton(); - item->SetPosition(0, 0); - item->SetStyleForState(STYLE_BORDER_WIDTH, STYLE_BORDER_WIDTH_VALUE, UIButton::RELEASED); - item->SetStyleForState(STYLE_BORDER_WIDTH, STYLE_BORDER_WIDTH_VALUE, UIButton::PRESSED); - item->SetStyleForState(STYLE_BORDER_WIDTH, STYLE_BORDER_WIDTH_VALUE, UIButton::INACTIVE); - item->SetStyleForState(STYLE_BORDER_OPA, 0, UIButton::RELEASED); - item->SetStyleForState(STYLE_BORDER_OPA, 0, UIButton::PRESSED); - item->SetStyleForState(STYLE_BORDER_OPA, 0, UIButton::INACTIVE); - item->Resize(HORIZONTAL_RESOLUTION - TEXT_DISTANCE_TO_LEFT_SIDE, TESTCASE_BUTTON_HEIGHT); - } else { - item = static_cast(inView); - } - - if (listener_ == nullptr) { - listener_ = new UiTestClickListener(); - } - ListNode* node = testCaseList.Begin(); - for (uint16_t i = 0; i < index; i++) { - node = node->next_; - } - item->SetOnClickListener(listener_); - item->SetText(node->data_.sliceId); - item->SetViewId(node->data_.sliceId); - item->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); // 40: means font size - item->SetViewIndex(index); - item->SetAlign(TEXT_ALIGNMENT_LEFT); - item->SetLabelPosition(150, 0); // 150: label x-coordinate - item->SetStyleForState(STYLE_BORDER_RADIUS, 0, UIButton::RELEASED); - item->SetStyleForState(STYLE_BORDER_RADIUS, 0, UIButton::PRESSED); - item->SetStyleForState(STYLE_BORDER_RADIUS, 0, UIButton::INACTIVE); - item->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::RELEASED); - item->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::PRESSED); - item->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::INACTIVE); - return item; -} - -int16_t TestCaseListAdapter::GetItemWidthWithMargin(int16_t index) -{ - // 2: two borders on both sides - return HORIZONTAL_RESOLUTION - TEXT_DISTANCE_TO_LEFT_SIDE + STYLE_BORDER_WIDTH_VALUE * 2; -} - -int16_t TestCaseListAdapter::GetItemHeightWithMargin(int16_t index) -{ - return TESTCASE_BUTTON_HEIGHT + STYLE_BORDER_WIDTH_VALUE * 2; // 2: two borders on both sides -} -} // namespace OHOS diff --git a/code/sdk/application/wearable/n9/service/device_msg/device_location.cpp b/code/sdk/application/wearable/n9/service/device_msg/device_location.cpp deleted file mode 100644 index d24a14f75..000000000 --- a/code/sdk/application/wearable/n9/service/device_msg/device_location.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved. - */ -#include "device_location.h" -#include "wearable_log.h" -#include "locator.h" - -using namespace OHOS::Location; - -LocationInfo_t g_locationInfo = {0}; - -class GnssStatusCallback : public IGnssStatusCallback { -public: - GnssStatusCallback() {} - ~GnssStatusCallback() {} - - void OnStatusChange(const std::shared_ptr &statusInfo) override - { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "OnStatusChange, num:%d\n", statusInfo->GetSatellitesNumber()); - for (int32_t satIdx = 0; satIdx < statusInfo->GetSatellitesNumber(); satIdx++) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "sat index:%d svid:%d ele:%.3f az:%.3f cnr:%.3f \n", satIdx, - statusInfo->GetSatelliteIds()[satIdx], statusInfo->GetAltitudes()[satIdx], - statusInfo->GetAzimuths()[satIdx], statusInfo->GetCarrierToNoiseDensitys()[satIdx]); - } - } - -private: -}; - -class NmeaMessageCallback : public INmeaMessageCallback { -public: - NmeaMessageCallback() {} - ~NmeaMessageCallback() {} - - void OnMessageChange(int64_t timestamp, const std::string msg) override - { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "OnMessageChange timestamp :%lld msg:%s\n", timestamp, msg.c_str()); - } - -private: -}; - -class LocatorCallback : public ILocatorCallback { -public: - LocatorCallback() {} - - ~LocatorCallback() {} - - void OnLocationReport(const std::shared_ptr &location) override - { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "OnLocationReport Lat:%.3f Long:%.3f Alt:%.3f Speed:%.3f dir:%.3f\n", - location->GetLatitude(), location->GetLongitude(), location->GetAltitude(), location->GetSpeed(), - location->GetDirection()); - } - - void OnErrorReport(const int errorCode) override - { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "error code:%d\n", errorCode); - } - - void OnLocatingStatusChange(const int status) override - { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "OnLocatingStatusChange status:%d\n", status); - } - -private: -}; - -typedef struct { - Locator *locator; - bool isStarted; - LocatorCallback locatorCallback; - GnssStatusCallback gnssStatusCallback; - NmeaMessageCallback nmeaMessageCallback; -} LocationSampleContext; - -static LocationSampleContext g_locationContext = { - .locator = nullptr, - .isStarted = false, -}; - -int32_t deviceLocationStartLocating() -{ - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "LocationStartLocating\n"); - if (g_locationContext.locator == nullptr) { - g_locationContext.locator = &Locator::GetInstance(); - } - if (g_locationContext.locator == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator is nullptr\n"); - return ERRCODE_FAILURE; - } - - bool isEnabled = false; - LocationErrCode errCode = g_locationContext.locator->IsLocationEnabled(isEnabled); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator IsLocationEnabled failed:%d\n", errCode); - return errCode; - } - - if (!isEnabled) { - errCode = g_locationContext.locator->EnableAbility(true); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator EnableAbility failed:%d\n", errCode); - return errCode; - } - } - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "RegisterGnssStatusCallback\n"); - errCode = g_locationContext.locator->RegisterGnssStatusCallback(&g_locationContext.gnssStatusCallback); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator RegisterGnssStatusCallback failed:%d\n", errCode); - return errCode; - } - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "RegisterNmeaMessageCallback\n"); - errCode = g_locationContext.locator->RegisterNmeaMessageCallback(&g_locationContext.nmeaMessageCallback); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator RegisterNmeaMessageCallback failed:%d\n", errCode); - return errCode; - } - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "StartLocating\n"); - RequestConfig requestConfig; - requestConfig.SetPriority(PRIORITY_ACCURACY); - errCode = g_locationContext.locator->StartLocating(&requestConfig, &g_locationContext.locatorCallback); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator StartLocating failed:%d\n", errCode); - return errCode; - } - g_locationContext.isStarted = true; - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "StartLocating end\n"); - return ERRCODE_SUCCESS; -} - -int32_t deviceLocationStopLocating() -{ - if (!g_locationContext.isStarted) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator is not started\n"); - return ERRCODE_FAILURE; - } - LocationErrCode errCode = - g_locationContext.locator->UnregisterNmeaMessageCallback(&g_locationContext.nmeaMessageCallback); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator UnregisterNmeaMessageCallback failed:%d\n", errCode); - return errCode; - } - errCode = g_locationContext.locator->UnregisterGnssStatusCallback(&g_locationContext.gnssStatusCallback); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator RegisterGnssStatusCallback failed:%d\n", errCode); - return errCode; - } - errCode = g_locationContext.locator->StopLocating(&g_locationContext.locatorCallback); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator StopLocating failed:%d\n", errCode); - return errCode; - } - g_locationContext.isStarted = false; - - bool isEnabled = false; - errCode = g_locationContext.locator->IsLocationEnabled(isEnabled); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator IsLocationEnabled failed:%d\n", errCode); - return errCode; - } - if (!isEnabled) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator Is not Enabled\n"); - return ERRCODE_FAILURE; - } - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "EnableAbility false\n"); - errCode = g_locationContext.locator->EnableAbility(false); - if (errCode != ERRCODE_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "locator EnableAbility failed:%d\n", errCode); - return errCode; - } - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Disable end\n"); - return ERRCODE_SUCCESS; -} \ No newline at end of file diff --git a/code/sdk/application/wearable/n9/service/device_msg/device_location.h b/code/sdk/application/wearable/n9/service/device_msg/device_location.h deleted file mode 100644 index 3305d698c..000000000 --- a/code/sdk/application/wearable/n9/service/device_msg/device_location.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved. - */ -#ifndef DEVICE_LOCATION_H -#define DEVICE_LOCATION_H -#include - -typedef struct LocationInfo { - int32_t latitude_; - int32_t longitude_; - uint16_t altitude_; - uint16_t accuracy_; - uint16_t speed_; - uint16_t direction_; - int64_t timeStamp_; -} LocationInfo_t; - -int32_t deviceLocationStartLocating(); -int32_t deviceLocationStopLocating(); -#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/n9/service/msg_center/CMakeLists.txt b/code/sdk/application/wearable/n9/service/msg_center/CMakeLists.txt index 26a88bb61..07e95c9a2 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/CMakeLists.txt +++ b/code/sdk/application/wearable/n9/service/msg_center/CMakeLists.txt @@ -161,7 +161,6 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_customer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_cmd.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/alarm_notification.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/makephone_notification.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/common/msg_center_common.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/common/msg_center_utils.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/common/msg_center_self_cmd.cpp @@ -189,7 +188,6 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_customer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/msg_center_cmd.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/alarm_notification.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/makephone_notification.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/ketinput/src/NotifyOnKeyListener.cpp # ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/phone_msg_notification.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/notify/pairing_notification.cpp diff --git a/code/sdk/application/wearable/n9/service/msg_center/include/notify/makephone_notification.h b/code/sdk/application/wearable/n9/service/msg_center/include/notify/makephone_notification.h deleted file mode 100644 index 82210db63..000000000 --- a/code/sdk/application/wearable/n9/service/msg_center/include/notify/makephone_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. - * Description: makephone notification api - * Author: CompanyName - * Create: 2023-08-11 - */ - -#ifndef MAKEPHONE_NOTIFICATION_H -#define MAKEPHONE_NOTIFICATION_H - -enum class CallTimerType { - NOTIFY_PHONE_CALLING_DISPLAY = 0, - NOTIFY_PHONE_CURTIME_DISPLAY = 1, - NOTIFY_PHONE_UNKNOWN = 10, -}; - -namespace OHOS { -class VolumeSettingView; -UIViewGroup* CreatePhoneCallView(void); -UIViewGroup* CreateCallingView(void); -UIViewGroup* CreateMultiplePhoneView(void); -UIViewGroup* CreateWaitingHintsView(void); -void HonrsViewChange(void); -VolumeSettingView *GetvolumeSetting(void); -void FreeCallingView(void); -void FreePhoneCallView(void); -void FreeMultiplePhoneCallView(void); -void FreeWaitingHintsView(void); -void RefreshMicrophoneImageSrc(const char* src); -void CallTimerCallBackProc(int data); -void CallCurTimerCallBack(int data); -void StartCallTimer(CallTimerType type, int32_t interval); -void DisableCallTimer(CallTimerType type); -void EnableWaitingView(void); -void DisableWatingView(void); - -class CallViewEventListener : public OHOS::UIView::OnClickListener, - public OHOS::UIView::OnLongPressListener, - public OHOS::UIView::OnTouchListener, - public OHOS::UIView::OnDragListener { -public: - CallViewEventListener(); - ~CallViewEventListener() override; - static CallViewEventListener *GetInstance(void); - bool OnClick(OHOS::UIView& view, const OHOS::ClickEvent& event) override; - bool OnDrag(UIView& view, const DragEvent& event) override - { - return true; - } - bool OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) override - { - return true; - } - bool OnPress(OHOS::UIView& view, const OHOS::PressEvent& event) override - { - return true; - } - bool OnLongPress(OHOS::UIView& view, const OHOS::LongPressEvent& event) override - { - return true; - } - bool OnRelease(OHOS::UIView& view, const OHOS::ReleaseEvent& event) override - { - return true; - } - - bool OnDragStart(OHOS::UIView& view, const OHOS::DragEvent& event) override - { - return true; - } -}; -}; // namespace OHOS - -#endif /* MAKEPHONE_NOTIFICATION_H */ diff --git a/code/sdk/application/wearable/n9/service/msg_center/include/notify/notification_manager.h b/code/sdk/application/wearable/n9/service/msg_center/include/notify/notification_manager.h index 5ab45f53b..478ba0789 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/include/notify/notification_manager.h +++ b/code/sdk/application/wearable/n9/service/msg_center/include/notify/notification_manager.h @@ -23,7 +23,6 @@ #include "components/root_view.h" #include "components/ui_view_group.h" #include "alarm_notification.h" -#include "makephone_notification.h" // #include "phone_msg_notification.h" constexpr uint16_t HALF_SCREEN = 2; diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/msg_center_customer.cpp index 079621246..a54eac759 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/n9/service/msg_center/src/msg_center_customer.cpp @@ -1,1764 +1,1776 @@ /* - * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. - * Description: broadcast feature implement - * Author: CompanyName - * Create: 2021-11-11 - */ - - #include - #include "securec.h" - #include "adapter.h" - #include "ohos_init.h" - #include "samgr_lite.h" - #include "memory_adapter.h" - #include "wearable_log.h" - #include "service_id_define.h" - #include "broadcast_service.h" - #include "alarm/include/AlarmClockModel.h" - #include "AlarmPopUpPresenter.h" - #include "CallerLogModel.h" - #include "notification_manager.h" - #include "NativeAbility.h" - #include "abilityms_slite_client.h" - #include "element_name.h" - #include "want.h" - #include "msg_center.h" - #include "msg_center_msg.h" - #include "msg_center_protocol.h" - #include "xiaodu_navi_vector.h" - #include "baidumap.h" - #include "common_def.h" - #include "keyinput.h" - #include "KeyInputListener.h" - #include "VolumeSettingView.h" - #include "VolumeSettingPresenter.h" - #include "VolumeSettingView.h" - - #define DIALDATASET 1 - - #ifdef SUPPORT_BLE_SERVICE - #include "bleInstruct.h" - #endif - - #ifdef CUSTOM_ZHIHUI - - #ifdef SUPPORT_CAT1_HFP_AG_SERV - #include "phoneservice/include/PhoneAGService.h" - #endif - - #include "goal/include/goalmodel.h" - #include "goal/include/goalview.h" - #include "goal/include/goalother.h" - - #include "ConfigModel.h" - #include "PlayersModelC.h" - #include "PlayersModel.h" - - #include "main/include/PullUpDownView.h" - - - #include "custom_save_runtime.h" - #include "transmitting.h" - #include "charge_notification.h" - #include "motion_recognition_notification.h" - #include "sedentaryReminder_notification.h" - #include "findwatch_notification.h" - #include "debug_output_notification/debug_output_notification.h" - #include "pairing_notification.h" - #include "phone_crt.h" - #include "main/include/dial/DialModelChargeC.h" - #include "saveele/include/SaveEleModel.h" - #include "testchangingC.h" - #include "custom_runtime.h" - #include "message_notification.h" - #include "goal_notification.h" - #include "drinkReminder_notification.h" - #include "sleep_notification.h" - #include "sleep/include/SleepModel.h" - #include "health/health_service/health_service.h" - #include "player/include/PlayersModelC.h" - #include "system/include/SystemLogModelC.h" - - #include "bloodoxygen/include/BloodOxygenModel.h" - #include "heartrate/include/HeartModel.h" - #include "saveele/include/SaveEleModel.h" - #include "respiratorytraining/include/RespiratoryTrainingModel.h" - - #include "custom_utilscpp.h" - #include "custom_utils.h" - #ifdef SUPPORT_POWER_MANAGER - #include "power_display_service.h" - #endif - #endif - - #ifdef SUPPORT_CYWEE_SERVICE - #include "cywee_hal.h" - #include "cywee_data.h" - #include "cywee_service.h" - #endif - - #ifdef SUPPORT_CAT1_SERVICE - #include "cat1_pub_api.h" - #endif - #include "uiservice/include/ui_service.h" - - #include "goal_notification.h" - namespace OHOS { - - #ifdef __cplusplus - extern "C" { - #endif - - /* 订阅事件设定优先级 */ - const PriorityMapper PRI_MAPPER[] = { - {TOPIC_EVENT_ALARM_RING, PRIORITY_ONE}, - {TOPIC_EVENT_NEXTDAY_UPDATE, PRIORITY_TWO}, - {TOPIC_EVENT_HFP_INCOMMING, PRIORITY_ONE}, - {TOPIC_EVENT_HFP_FINISHED, PRIORITY_ONE}, - {TOPIC_EVENT_HFP_PHONE_ACTIVE, PRIORITY_ONE}, - {TOPIC_EVENT_HFP_WATCH_ACTIVE, PRIORITY_ONE}, - {TOPIC_EVENT_HFP_WATCH_TO_PHONE, PRIORITY_ONE}, - {TOPIC_EVENT_HFP_PHONE_TO_WATCH, PRIORITY_ONE}, - - #ifdef SUPPORT_CAT1_MODEM - {TOPIC_EVENT_CAT1_INCOMMING, PRIORITY_ONE}, - {TOPIC_EVENT_CAT1_CALLCONNTED, PRIORITY_ONE}, - {TOPIC_EVENT_CAT1_CALLENDED, PRIORITY_ONE}, - {TOPIC_EVENT_CAT1_CALLDIAL,PRIORITY_ONE}, - {TOPIC_EVENT_CAT1_SIGNAL_UPDATE, PRIORITY_ONE}, - {TOPIC_EVENT_CAT1_POWER_ON, PRIORITY_ONE}, - {TOPIC_EVENT_CAT1_POWER_OFF, PRIORITY_ONE}, - {TOPIC_EVENT_CAT1_CALL_FAIL,PRIORITY_ONE}, - {TOPIC_EVENT_HFP_HINT,PRIORITY_ONE}, - #endif - {TOPIC_EVENT_ON_TIME,PRIORITY_TWO}, - - #ifdef SUPPORT_CYWEE_SERVICE - // {TOPIC_EVENT_ACTIVITY_UPDATE,PRIORITY_TWO}, - // {TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE,PRIORITY_TWO}, - {TOPIC_EVENT_AR_ALERT_TYPE_UPDATE,PRIORITY_TWO}, - {TOPIC_EVENT_INACTIVITY_UPDATE,PRIORITY_TWO}, - // {TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE,PRIORITY_TWO}, - #endif - {TOPIC_EVENT_GOAL_SHOW_VIEW,PRIORITY_TWO}, - {TOPIC_EVENT_STEPDATA_UPDATE,PRIORITY_TWO}, - - - {TOPIC_EVENT_BLE_TRAINING,PRIORITY_TWO}, - {TOPIC_EVENT_BLE_TRANSMIT,PRIORITY_ONE}, - - {TOPIC_EVENT_CHARGE_PLUG, PRIORITY_TWO}, - {TOPIC_EVENT_CHARGE_UNPLUG, PRIORITY_TWO}, - {TOPIC_EVENT_LOWPOWER_ALARM,PRIORITY_TWO}, - - {TOPIC_EVENT_DEVICE_BIND, PRIORITY_ONE}, - {TOPIC_EVENT_FIND_WATCH,PRIORITY_TWO},// 找手表 [2] - {TOPIC_EVENT_DRINKREMINDER,PRIORITY_TWO},//喝水提醒 [2] - {TOPIC_EVENT_MESSAGENOTE,PRIORITY_THREE},//消息提醒 [3] - {TOPIC_EVENT_MESSAGE_UPDATA,PRIORITY_TWO},//消息更新提醒 [3] - {TOPIC_EVENT_SLEEPNOTE,PRIORITY_THREE},//睡眠弹窗 [3] - {TOPIC_EVENT_DEBUGOUTPUT,PRIORITY_ONE},//开发调试专用窗口 - {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,PRIORITY_ONE},//关机动画 - }; - - bool g_pressFlag = false; - bool g_longPressFlag = false; - - static bool CheckPriority(const Topic topic) - { - uint16_t mapperSize = sizeof(PRI_MAPPER) / sizeof(PRI_MAPPER[0]); - for (uint16_t i = 0; i < mapperSize; i++) { - if (topic == PRI_MAPPER[i].topicId) { - if (PRI_MAPPER[i].prId <= OHOS::NativeAbility::GetInstance().GetCurSlicePriority() && - PRI_MAPPER[i].prId <= OHOS::NotificationManager::GetInstance()->GetNotifyPriority()) { - return true; - } else { - return false; - } - } - } - return false; - } - - /* 订阅事件可定制 */ - void MsgCenterSubscribe() - { - MsgCenterSubscribeTopic(TOPIC_EVENT_ALARM_RING); - MsgCenterSubscribeTopic(TOPIC_EVENT_NEXTDAY_UPDATE); - MsgCenterSubscribeTopic(TOPIC_EVENT_ON_TIME); - MsgCenterSubscribeTopic(TOPIC_EVENT_STEPDATA_UPDATE); - MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_INCOMMING); - MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_PHONE_ACTIVE); - MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_WATCH_ACTIVE); - MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_FINISHED); - MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_PHONE_TO_WATCH); - MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_WATCH_TO_PHONE); - MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_HINT); - // MsgCenterSubscribeTopic(TOPIC_EVENT_ACTIVITY_UPDATE); - // MsgCenterSubscribeTopic(TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE); - MsgCenterSubscribeTopic(TOPIC_EVENT_AR_ALERT_TYPE_UPDATE); - MsgCenterSubscribeTopic(TOPIC_EVENT_INACTIVITY_UPDATE); - // MsgCenterSubscribeTopic(TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE); - MsgCenterSubscribeTopic(TOPIC_EVENT_BLE_TRAINING); - MsgCenterSubscribeTopic(TOPIC_EVENT_BLE_TRANSMIT); - MsgCenterSubscribeTopic(TOPIC_EVENT_GOAL_SHOW_VIEW); - MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_PLUG); - MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_UNPLUG); - MsgCenterSubscribeTopic(TOPIC_EVENT_LOWPOWER_ALARM); - #ifdef SUPPORT_CAT1_MODEM - MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_INCOMMING); - MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_CALLCONNTED); - MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_CALLENDED); - MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_CALLDIAL); - // MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_SIGNAL_UPDATE); - // MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_POWER_ON); - // MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_POWER_OFF); - MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_CALL_FAIL); +* Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. +* Description: broadcast feature implement +* Author: CompanyName +* Create: 2021-11-11 +*/ + +#include +#include "securec.h" +#include "adapter.h" +#include "ohos_init.h" +#include "samgr_lite.h" +#include "memory_adapter.h" +#include "wearable_log.h" +#include "service_id_define.h" +#include "broadcast_service.h" +#include "alarm/include/AlarmClockModel.h" +#include "AlarmPopUpPresenter.h" +#include "CallerLogModel.h" +#include "notification_manager.h" +#include "NativeAbility.h" +#include "abilityms_slite_client.h" +#include "element_name.h" +#include "want.h" +#include "msg_center.h" +#include "msg_center_msg.h" +#include "msg_center_protocol.h" +#include "xiaodu_navi_vector.h" +#include "baidumap.h" +#include "common_def.h" +#include "keyinput.h" +#include "KeyInputListener.h" +#include "VolumeSettingView.h" +#include "VolumeSettingPresenter.h" +#include "VolumeSettingView.h" + +#define DIALDATASET 1 + +#ifdef SUPPORT_BLE_SERVICE +#include "bleInstruct.h" +#endif + +#ifdef CUSTOM_ZHIHUI + +#ifdef SUPPORT_CAT1_HFP_AG_SERV +#include "phoneservice/include/PhoneAGService.h" +#endif + +#include "goal/include/goalmodel.h" +#include "goal/include/goalview.h" +#include "goal/include/goalother.h" + +#include "ConfigModel.h" +#include "PlayersModelC.h" +#include "PlayersModel.h" + +#include "main/include/PullUpDownView.h" + + +#include "custom_save_runtime.h" +#include "transmitting.h" +#include "charge_notification.h" +#include "motion_recognition_notification.h" +#include "sedentaryReminder_notification.h" +#include "findwatch_notification.h" +#include "debug_output_notification/debug_output_notification.h" +#include "pairing_notification.h" +#include "phone_crt.h" +#include "main/include/dial/DialModelChargeC.h" +#include "saveele/include/SaveEleModel.h" +#include "testchangingC.h" +#include "custom_runtime.h" +#include "message_notification.h" +#include "goal_notification.h" +#include "drinkReminder_notification.h" +#include "sleep_notification.h" +#include "sleep/include/SleepModel.h" +#include "health/health_service/health_service.h" +#include "player/include/PlayersModelC.h" +#include "system/include/SystemLogModelC.h" + +#include "bloodoxygen/include/BloodOxygenModel.h" +#include "heartrate/include/HeartModel.h" +#include "saveele/include/SaveEleModel.h" +#include "respiratorytraining/include/RespiratoryTrainingModel.h" + +#include "custom_utilscpp.h" +#include "custom_utils.h" +#ifdef SUPPORT_POWER_MANAGER +#include "power_display_service.h" +#endif +#endif + +#ifdef SUPPORT_CYWEE_SERVICE +#include "cywee_hal.h" +#include "cywee_data.h" +#include "cywee_service.h" +#endif + +#ifdef SUPPORT_CAT1_SERVICE +#include "cat1_pub_api.h" +#endif +#include "uiservice/include/ui_service.h" + +#include "goal_notification.h" +namespace OHOS { + +#ifdef __cplusplus +extern "C" { +#endif + +/* 订阅事件设定优先级 */ +const PriorityMapper PRI_MAPPER[] = { + {TOPIC_EVENT_ALARM_RING, PRIORITY_ONE}, + {TOPIC_EVENT_NEXTDAY_UPDATE, PRIORITY_TWO}, + {TOPIC_EVENT_HFP_INCOMMING, PRIORITY_ONE}, + {TOPIC_EVENT_HFP_FINISHED, PRIORITY_ONE}, + {TOPIC_EVENT_HFP_PHONE_ACTIVE, PRIORITY_ONE}, + {TOPIC_EVENT_HFP_WATCH_ACTIVE, PRIORITY_ONE}, + {TOPIC_EVENT_HFP_WATCH_TO_PHONE, PRIORITY_ONE}, + {TOPIC_EVENT_HFP_PHONE_TO_WATCH, PRIORITY_ONE}, - #endif - MsgCenterSubscribeTopic(TOPIC_EVENT_DEVICE_BIND); - MsgCenterSubscribeTopic(TOPIC_EVENT_FIND_WATCH); - MsgCenterSubscribeTopic(TOPIC_EVENT_DRINKREMINDER); - MsgCenterSubscribeTopic(TOPIC_EVENT_MESSAGENOTE); - MsgCenterSubscribeTopic(TOPIC_EVENT_SLEEPNOTE); - MsgCenterSubscribeTopic(TOPIC_EVENT_DEBUGOUTPUT); - MsgCenterSubscribeTopic(TOPIC_EVENT_SHUTDOWN_ANIMATIOR); - } - - static OHOS::UIViewGroup* ShowGoalNotify(void) - { - return OHOS::GoalviewShow(); - } - - static OHOS::UIViewGroup* ShowAlarmNotify(void) - { - return OHOS::CreateAlarmView(); - } - - static OHOS::UIViewGroup* ShowPhoneCallNotify(void) - { - return OHOS::CreatePhoneCallView(); - } - - static OHOS::UIViewGroup* ShowCallingNotify(void) - { - return OHOS::CreateCallingView(); - } - - static OHOS::UIViewGroup* ShowMultiPhoneCallNotify(void) - { - return OHOS::CreateMultiplePhoneView(); - } - - - /*显示绑定通知*/ - static OHOS::UIViewGroup* showDeviceBindingNotify(void) - { - return OHOS::CreateDeviceBindingView(); - } - - /*显示解绑通知*/ - static OHOS::UIViewGroup* showDeviceUnBindingNotify(void) - { - return OHOS::CreateDeviceUnBindingView(); - } - - /*显示解除绑定请求(与新设备连接)通知*/ - static OHOS::UIViewGroup* showDeviceUnbindingRequestNotify(void) - { - return OHOS::CreateDeviceUnbindingRequestGroupView(); - } - - /*显示低电量通知*/ - static OHOS::UIViewGroup* showlowpowerNotify(void) - { - return OHOS::lowPowerShow(); - } - - static OHOS::UIViewGroup* ShowChargeingNotify(void) - { - return OHOS::ShowChargeingView(); - } - - - static OHOS::UIViewGroup* showFindWatchNotify(void) - { - return OHOS::CreateFindWatchView(); - } - - /*显示喝水提醒视图*/ - static OHOS::UIViewGroup* showDrinkReminderNotify(void) - { - return OHOS::CreateDrinkReminderView(); - } - - /*显示久坐提醒视图*/ - static OHOS::UIViewGroup* showSedentaryReminderNotify(void) - { - return OHOS::CreateSedentaryReminderView(); - } - - /*显示运动识别视图*/ - static OHOS::UIViewGroup* showMotionRecognitionNotify(void) - { - return OHOS::CreateMotionRecognitionView(); - } - - /*显示传输中*/ - static OHOS::UIViewGroup* showtransmitNotify(void) - { - return OHOS::transmittingShow(); - } - - //关机动画 - static OHOS::UIViewGroup* showShutdownAnimatorNotify(void) - { - return OHOS::showShutDownAnimation(); - } - //无法呼叫sos - static OHOS::UIViewGroup* showSOSNotify(void) - { - return OHOS::SOS_cant_dial(); - } - - /*显示消息提醒*/ - static OHOS::UIViewGroup *showMessageNotify(void) { - OHOS::UIViewGroup *view = OHOS::CreateMessageView(); - printf("showMessageNotify %p",view); - return view; - } - /*显示睡眠提醒*/ - static OHOS::UIViewGroup* showSleepNotify(void) - { - return OHOS::CreateSleepNotifyView(); - } - - //显示新来电 - static OHOS::UIViewGroup* showcallhintNotify(void) - { - return OHOS::CALL_INCOMING_HINT(); - } - - static OHOS::UIViewGroup* showDebugOutputNotify(void) - { - return OHOS::CreateDebugOutputMainView(); - } - - - static OHOS::UIViewGroup* showcallfailNotify(void) - { - return OHOS::CALL_FAIL_HINT(); - } - - static OHOS::UIViewGroup* showCat1UpdataNotify(void) - { - // return OHOS::Cat1PythonUpdataShow(); - } - - - void MsgCenterNotifyAlarmProc(const Topic topic, Request* req) - { - unused(req); - // The alarm notification is not displayed if the incoming call notification is already being processed - if (CheckPriority(topic)) { - // AlarmClockModel::GetInstance()->PopInterPlayMusic(); - // AlarmViewEventListener::GetInstance()->PopAlarmRing(); - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); - NotificationManager::GetInstance()->ShowNotify(ShowAlarmNotify, static_cast(topic), true); - } else { - // just delay the alarm - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "just delay the alarm"); - // AlarmClockModel::GetInstance()->AlarmGetClockNum(); - // AlarmPopUpPresenter::GetInstance()->DelayAlarmRing(); - AlarmViewEventListener::GetInstance()->DelayAlarmRing(); - } - } - /*NextDay*/ - void MsgCenterNotifyNextDayProc(const Topic topic, Request *req) - { - unused(topic); - unused(req); - AlarmClockModel::GetInstance()->NextDayNotify(); - // current_year = 0; - printf("******nextday is begin******\r\n"); - // 存储nextday执行日志 - start_report_nextday_log_start(); - /* ----------------------------------- 睡眠相关 ----------------------------------- */ - if (!ConfigModel::GetInstance()->get_configData_int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP)) - { - // 未设置睡眠监控 nextday进行清除睡眠数据。 - SleepModel::GetInstance().DeleteSleepData(); - // 通知UI更新 - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(&OHOS::SleepModel::UpdateSleepView, &OHOS::SleepModel::GetInstance())); - } - printf("sleep end\n"); - /* ---------------------------------- 健康数据相关 ---------------------------------- */ - // 清空当日的心率血氧数据 - HealthService::GetInstance()->CleanHealthData(); - // 通知UI更新 - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(&OHOS::HeartModel::CleanAllData, OHOS::HeartModel::GetInstance())); - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(&OHOS::BloodOxygenModel::CleanAllData, - OHOS::BloodOxygenModel::GetInstance())); - printf("health end\n"); - /* ---------------------------------- 呼吸训练相关 ---------------------------------- */ - RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime(); - - // 存储nextday执行日志 - start_report_nextday_log_end(); - // 清除popup_windows日志 - nextday_clear_popup_windows_log(); - - printf("******nextday is end******\r\n"); - #ifdef SUPPORT_CYWEE_SERVICE - /* --------------------------------- 每日目标相关 --------------------------------- */ - cywee_reset_history_daily_data(); //清除运动相关数据 - - // 午夜清除运动数据 - for(int i=1;i<6;i++) - { - set_Is_show_flag(1,i); - } +#ifdef SUPPORT_CAT1_MODEM + {TOPIC_EVENT_CAT1_INCOMMING, PRIORITY_ONE}, + {TOPIC_EVENT_CAT1_CALLCONNTED, PRIORITY_ONE}, + {TOPIC_EVENT_CAT1_CALLENDED, PRIORITY_ONE}, + {TOPIC_EVENT_CAT1_CALLDIAL,PRIORITY_ONE}, + {TOPIC_EVENT_CAT1_SIGNAL_UPDATE, PRIORITY_ONE}, + {TOPIC_EVENT_CAT1_POWER_ON, PRIORITY_ONE}, + {TOPIC_EVENT_CAT1_POWER_OFF, PRIORITY_ONE}, + {TOPIC_EVENT_CAT1_CALL_FAIL,PRIORITY_ONE}, + {TOPIC_EVENT_HFP_HINT,PRIORITY_ONE}, +#endif + {TOPIC_EVENT_ON_TIME,PRIORITY_TWO}, + +#ifdef SUPPORT_CYWEE_SERVICE + // {TOPIC_EVENT_ACTIVITY_UPDATE,PRIORITY_TWO}, + // {TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE,PRIORITY_TWO}, + {TOPIC_EVENT_AR_ALERT_TYPE_UPDATE,PRIORITY_TWO}, + {TOPIC_EVENT_INACTIVITY_UPDATE,PRIORITY_TWO}, + // {TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE,PRIORITY_TWO}, +#endif + {TOPIC_EVENT_GOAL_SHOW_VIEW,PRIORITY_TWO}, + {TOPIC_EVENT_STEPDATA_UPDATE,PRIORITY_TWO}, + + + {TOPIC_EVENT_BLE_TRAINING,PRIORITY_TWO}, + {TOPIC_EVENT_BLE_TRANSMIT,PRIORITY_ONE}, + + {TOPIC_EVENT_CHARGE_PLUG, PRIORITY_TWO}, + {TOPIC_EVENT_CHARGE_UNPLUG, PRIORITY_TWO}, + {TOPIC_EVENT_LOWPOWER_ALARM,PRIORITY_TWO}, + + {TOPIC_EVENT_DEVICE_BIND, PRIORITY_ONE}, + {TOPIC_EVENT_FIND_WATCH,PRIORITY_TWO},// 找手表 [2] + {TOPIC_EVENT_DRINKREMINDER,PRIORITY_TWO},//喝水提醒 [2] + {TOPIC_EVENT_MESSAGENOTE,PRIORITY_THREE},//消息提醒 [3] + {TOPIC_EVENT_MESSAGE_UPDATA,PRIORITY_TWO},//消息更新提醒 [3] + {TOPIC_EVENT_SLEEPNOTE,PRIORITY_THREE},//睡眠弹窗 [3] + {TOPIC_EVENT_DEBUGOUTPUT,PRIORITY_ONE},//开发调试专用窗口 + {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,PRIORITY_ONE},//关机动画 +}; + +bool g_pressFlag = false; +bool g_longPressFlag = false; + +static bool CheckPriority(const Topic topic) +{ + uint16_t mapperSize = sizeof(PRI_MAPPER) / sizeof(PRI_MAPPER[0]); + for (uint16_t i = 0; i < mapperSize; i++) { + if (topic == PRI_MAPPER[i].topicId) { + if (PRI_MAPPER[i].prId <= OHOS::NativeAbility::GetInstance().GetCurSlicePriority() && + PRI_MAPPER[i].prId <= OHOS::NotificationManager::GetInstance()->GetNotifyPriority()) { + return true; + } else { + return false; + } + } + } + return false; +} + +/* 订阅事件可定制 */ +void MsgCenterSubscribe() +{ + MsgCenterSubscribeTopic(TOPIC_EVENT_ALARM_RING); + MsgCenterSubscribeTopic(TOPIC_EVENT_NEXTDAY_UPDATE); + MsgCenterSubscribeTopic(TOPIC_EVENT_ON_TIME); + MsgCenterSubscribeTopic(TOPIC_EVENT_STEPDATA_UPDATE); + MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_INCOMMING); + MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_PHONE_ACTIVE); + MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_WATCH_ACTIVE); + MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_FINISHED); + MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_PHONE_TO_WATCH); + MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_WATCH_TO_PHONE); + MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_HINT); + // MsgCenterSubscribeTopic(TOPIC_EVENT_ACTIVITY_UPDATE); + // MsgCenterSubscribeTopic(TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE); + MsgCenterSubscribeTopic(TOPIC_EVENT_AR_ALERT_TYPE_UPDATE); + MsgCenterSubscribeTopic(TOPIC_EVENT_INACTIVITY_UPDATE); + // MsgCenterSubscribeTopic(TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE); + MsgCenterSubscribeTopic(TOPIC_EVENT_BLE_TRAINING); + MsgCenterSubscribeTopic(TOPIC_EVENT_BLE_TRANSMIT); + MsgCenterSubscribeTopic(TOPIC_EVENT_GOAL_SHOW_VIEW); + MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_PLUG); + MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_UNPLUG); + MsgCenterSubscribeTopic(TOPIC_EVENT_LOWPOWER_ALARM); +#ifdef SUPPORT_CAT1_MODEM + MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_INCOMMING); + MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_CALLCONNTED); + MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_CALLENDED); + MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_CALLDIAL); + // MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_SIGNAL_UPDATE); + // MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_POWER_ON); + // MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_POWER_OFF); + MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_CALL_FAIL); + +#endif + MsgCenterSubscribeTopic(TOPIC_EVENT_DEVICE_BIND); + MsgCenterSubscribeTopic(TOPIC_EVENT_FIND_WATCH); + MsgCenterSubscribeTopic(TOPIC_EVENT_DRINKREMINDER); + MsgCenterSubscribeTopic(TOPIC_EVENT_MESSAGENOTE); + MsgCenterSubscribeTopic(TOPIC_EVENT_SLEEPNOTE); + MsgCenterSubscribeTopic(TOPIC_EVENT_DEBUGOUTPUT); + MsgCenterSubscribeTopic(TOPIC_EVENT_SHUTDOWN_ANIMATIOR); +} + +static OHOS::UIViewGroup* ShowGoalNotify(void) +{ + return OHOS::GoalviewShow(); +} + +static OHOS::UIViewGroup* ShowAlarmNotify(void) +{ + return OHOS::CreateAlarmView(); +} + +static OHOS::UIViewGroup* ShowCallingNotify(void) +{ + // return OHOS::CreateCallingView(); + return nullptr; +} + +static OHOS::UIViewGroup* ShowMultiPhoneCallNotify(void) +{ + // return OHOS::CreateMultiplePhoneView(); + return nullptr; +} + + +/*显示绑定通知*/ +static OHOS::UIViewGroup* showDeviceBindingNotify(void) +{ + return OHOS::CreateDeviceBindingView(); +} + +/*显示解绑通知*/ +static OHOS::UIViewGroup* showDeviceUnBindingNotify(void) +{ + return OHOS::CreateDeviceUnBindingView(); +} + +/*显示解除绑定请求(与新设备连接)通知*/ +static OHOS::UIViewGroup* showDeviceUnbindingRequestNotify(void) +{ + return OHOS::CreateDeviceUnbindingRequestGroupView(); +} + +/*显示低电量通知*/ +static OHOS::UIViewGroup* showlowpowerNotify(void) +{ + return OHOS::lowPowerShow(); +} + +static OHOS::UIViewGroup* ShowChargeingNotify(void) +{ + return OHOS::ShowChargeingView(); +} + + +static OHOS::UIViewGroup* showFindWatchNotify(void) +{ + return OHOS::CreateFindWatchView(); +} + +/*显示喝水提醒视图*/ +static OHOS::UIViewGroup* showDrinkReminderNotify(void) +{ + return OHOS::CreateDrinkReminderView(); +} + +/*显示久坐提醒视图*/ +static OHOS::UIViewGroup* showSedentaryReminderNotify(void) +{ + return OHOS::CreateSedentaryReminderView(); +} + +/*显示运动识别视图*/ +static OHOS::UIViewGroup* showMotionRecognitionNotify(void) +{ + return OHOS::CreateMotionRecognitionView(); +} + +/*显示传输中*/ +static OHOS::UIViewGroup* showtransmitNotify(void) +{ + return OHOS::transmittingShow(); +} + +//关机动画 +static OHOS::UIViewGroup* showShutdownAnimatorNotify(void) +{ + return OHOS::showShutDownAnimation(); +} +//无法呼叫sos +static OHOS::UIViewGroup* showSOSNotify(void) +{ + return OHOS::SOS_cant_dial(); +} + +/*显示消息提醒*/ +static OHOS::UIViewGroup *showMessageNotify(void) { + OHOS::UIViewGroup *view = OHOS::CreateMessageView(); + printf("showMessageNotify %p",view); + return view; +} +/*显示睡眠提醒*/ +static OHOS::UIViewGroup* showSleepNotify(void) +{ + return OHOS::CreateSleepNotifyView(); +} + +//显示新来电 +static OHOS::UIViewGroup* showcallhintNotify(void) +{ + return OHOS::CALL_INCOMING_HINT(); +} + +static OHOS::UIViewGroup* showDebugOutputNotify(void) +{ + return OHOS::CreateDebugOutputMainView(); +} + + +static OHOS::UIViewGroup* showcallfailNotify(void) +{ + return OHOS::CALL_FAIL_HINT(); +} + +static OHOS::UIViewGroup* showCat1UpdataNotify(void) +{ + // return OHOS::Cat1PythonUpdataShow(); +} + + +void MsgCenterNotifyAlarmProc(const Topic topic, Request* req) +{ + unused(req); + // The alarm notification is not displayed if the incoming call notification is already being processed + if (CheckPriority(topic)) { + // AlarmClockModel::GetInstance()->PopInterPlayMusic(); + // AlarmViewEventListener::GetInstance()->PopAlarmRing(); + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + NotificationManager::GetInstance()->ShowNotify(ShowAlarmNotify, static_cast(topic), true); + } else { + // just delay the alarm + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "just delay the alarm"); + // AlarmClockModel::GetInstance()->AlarmGetClockNum(); + // AlarmPopUpPresenter::GetInstance()->DelayAlarmRing(); + AlarmViewEventListener::GetInstance()->DelayAlarmRing(); + } +} +/*NextDay*/ +void MsgCenterNotifyNextDayProc(const Topic topic, Request *req) +{ + unused(topic); + unused(req); + AlarmClockModel::GetInstance()->NextDayNotify(); + // current_year = 0; + printf("******nextday is begin******\r\n"); + // 存储nextday执行日志 + start_report_nextday_log_start(); + /* ----------------------------------- 睡眠相关 ----------------------------------- */ + if (!ConfigModel::GetInstance()->get_configData_int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP)) + { + // 未设置睡眠监控 nextday进行清除睡眠数据。 + SleepModel::GetInstance().DeleteSleepData(); + // 通知UI更新 + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::SleepModel::UpdateSleepView, &OHOS::SleepModel::GetInstance())); + } + printf("sleep end\n"); + /* ---------------------------------- 健康数据相关 ---------------------------------- */ + // 清空当日的心率血氧数据 + HealthService::GetInstance()->CleanHealthData(); + // 通知UI更新 + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::HeartModel::CleanAllData, OHOS::HeartModel::GetInstance())); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::BloodOxygenModel::CleanAllData, + OHOS::BloodOxygenModel::GetInstance())); + printf("health end\n"); + /* ---------------------------------- 呼吸训练相关 ---------------------------------- */ + RespiratoryTrainingModel::GetInstance().ClearTotalRespiratoryTrainingTime(); + + // 存储nextday执行日志 + start_report_nextday_log_end(); + // 清除popup_windows日志 + nextday_clear_popup_windows_log(); + + printf("******nextday is end******\r\n"); +#ifdef SUPPORT_CYWEE_SERVICE + /* --------------------------------- 每日目标相关 --------------------------------- */ + cywee_reset_history_daily_data(); //清除运动相关数据 + + // 午夜清除运动数据 + for(int i=1;i<6;i++) + { + set_Is_show_flag(1,i); + } + + do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA, NULL); + + SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); + printf("sport end\n"); +#endif + +} +void MsgCenterNotifyONtimeProc(const Topic topic, Request* req) +{ + unused(req); + AlarmClockEventData* time=(AlarmClockEventData*)req->data; + #ifdef SUPPORT_CYWEE_SERVICE + + cywee_save_data(); //暂时没有这个函数 + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时步数"); + cywee_step_history_save(time->value); + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时站立数据"); + if(cywee_get_stand_flag()) + cywee_stand_history_save(time->value); + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时卡路里数据"); + cywee_calories_history_save(time->value); + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时距离数据"); + cywee_distances_history_save(time->value); + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时燃脂数据"); + cywee_fat_history_save(time->value); + // 保存完增加一次读取数据 + SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); +#endif + } +//设备绑定通知 +void MsgCenterNotifyDeviceBindProc(const Topic topic, Request* req) +{ + #ifdef SUPPORT_BLE_SERVICE + //unused(req); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyBindProc Bind!"); + // const power_display_svr_api_t *display_api = power_display_svr_get_api(); + // if (display_api->get_screen_state() != SCREEN_ON) + // { + // display_api->turn_on_screen(); + // } + uint8_t* data=(uint8_t*)req->data; + /* 安全:固定上限 + 显式终止 */ + const size_t kMaxDevName = 64; + char devname[kMaxDevName + 1] = {0}; + if (data != NULL && req->len >= 2) + { + switch(data[0]) + { + case DEVICEBIND: + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + { + /* 设备名在 payload[2..],长度为 req->len-2,做边界裁剪并追加'\0' */ + size_t name_len = (req->len > 2) ? (size_t)req->len - 2 : 0; + if (name_len > 0) + { + size_t copy_len = (name_len > kMaxDevName) ? kMaxDevName : name_len; + (void)memcpy_s(devname, sizeof(devname), (const char*)req->data + 2, copy_len); + devname[copy_len] = '\0'; + PairingViewEventListener::GetInstance().SetDeviceName(devname); + } + else + { + PairingViewEventListener::GetInstance().SetDeviceName(NULL); + } + } + if(NotificationManager::GetInstance()->HasNotifyShowing()) + { + NotificationManager::GetInstance()->StopNotify(); + } + NotificationManager::GetInstance()->ShowNotify(showDeviceBindingNotify, (uint16_t)topic, true); + break; + case DEVICEUNBIND: + + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + { + size_t name_len = (req->len > 2) ? (size_t)req->len - 2 : 0; + if (name_len > 0) + { + size_t copy_len = (name_len > kMaxDevName) ? kMaxDevName : name_len; + (void)memcpy_s(devname, sizeof(devname), (const char*)req->data + 2, copy_len); + devname[copy_len] = '\0'; + PairingViewEventListener::GetInstance().SetDeviceName(devname); + } + else + { + PairingViewEventListener::GetInstance().SetDeviceName(NULL); + } + } + NotificationManager::GetInstance()->ShowNotify(showDeviceUnBindingNotify, (uint16_t)topic, true); + break; + case DeviceUnBindingRequest: + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showDeviceUnbindingRequestNotify, (uint16_t)topic, true); + break; + case SHUTDOWN: + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, " SHUTDOWN"); + set_lowpower_falg(3); + if (NotificationManager::GetInstance()->HasNotifyShowing()) + NotificationManager::GetInstance()->StopNotify(); + + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + + NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); + //low_power_play(true); + break; + case REBOOT: + set_lowpower_falg(4); + if (NotificationManager::GetInstance()->HasNotifyShowing()) + NotificationManager::GetInstance()->StopNotify(); + + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); + //low_power_play(false); + break; + + default: + break; + } + + } + #endif +} + + + +void MsgCenterNotifybleTransmit(const Topic topic, Request* req) +{ +#ifdef SUPPORT_BLE_SERVICE +unused(topic); +uint8_t* data=(uint8_t*)req->data; +WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifybleTransmit:%d",data[0]); + + +if(data[0]==TRANS_FREE) +{ + if(transmittingISShow()) + NotificationManager::GetInstance()->StopNotify(); +} +else if (data[0]==IS_NEED_CAT1_OTA) +{ + + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + + // NotificationManager::GetInstance()->ShowNotify(showCat1UpdataNotify, (uint16_t)topic, true); +} +else if (data[0]==FILE_IS_DONE) +{ + set_transmittingShow_falg(data[0]); +} +else +{ + set_transmittingShow_falg(data[0]); + + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + + NotificationManager::GetInstance()->ShowNotify(showtransmitNotify, (uint16_t)topic, true); +} +#endif +} + +void MsgCenterNotifyChargePlugProc(const Topic topic, Request* req) +{ + #ifdef SUPPORT_BATTERY_SERVICE + unused(req); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: CHarger Plug !"); +#ifdef SYSTEM_LOG_SERVICE + uapi_save_runtime_log(RUNTIME_LOG_CHARGE_START);//充电开始事件 +#endif + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + if (display_api->get_screen_state() != SCREEN_ON) + { + display_api->turn_on_screen(); + } + + if(PullUpDownView::GetInstance()) + { + GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PullUpDownView::UpdateBatteryProcess, OHOS::PullUpDownView::GetInstance() )); + } +#if DIALDATASET + // DialModelCharge::GetInstance()->UpdatechargeStatus(1); + setChargeStatus(1); +#endif + SaveEleModel::GetInstance()->SetChargeStatus(true); + + if (uapi_dev_runtime_get_train_status()) + { + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: CHarger Plug ! but train status is true"); + return ; + } + + + if(IsTestCHANGINGViewCreated()) + { + ChangeViewcolorC(1); + } + else + { + if (CheckPriority(topic) && !uapi_dev_runtime_get_factory_test_status_flag()) //产测模式不弹充电弹窗 + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true); + } + } + #endif +} + +/*充电器已拔掉*/ +void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req) +{ + #ifdef SUPPORT_BATTERY_SERVICE + unused(req); + unused(topic); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: CHarger UnPlug !"); +#ifdef SYSTEM_LOG_SERVICE + //充电停止事件 + uapi_save_runtime_log(RUNTIME_LOG_CHARGE_STOP);//TOOD* +#endif + if(PullUpDownView::GetInstance()) + { + GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PullUpDownView::UpdateBatteryProcess, OHOS::PullUpDownView::GetInstance() )); + } +#if DIALDATASET + // DialModelCharge::GetInstance()->UpdatechargeStatus(0); + setChargeStatus(0); +#endif + SaveEleModel::GetInstance()->SetChargeStatus(false); + + + if(IsTestCHANGINGViewCreated()) + { + ChangeViewcolorC(0); + } + else + { + if(is_UIViewGroup_charge()) + { + NotificationManager::GetInstance()->StopNotify(); + } + } +#endif +} + +/*低电量提醒*/ +void MsgCenterNotifyLowPowerAlarmProc(const Topic topic, Request* req) +{ +WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: LowPower Alarm !"); +uint8 *x= (uint8 *)(req->data); +const power_display_svr_api_t *display_api = power_display_svr_get_api(); +// if(*x==3) +// { +// if (display_api->get_screen_state() != SCREEN_ON) +// { +// display_api->turn_on_screen(); +// } +// display_api->set_screen_set_keepon_timeout(1000*5); +// //倒计时结束后,直接执行关机动画 +// low_power_play(); +// } +if(*x==0) +{ + //提醒低电充电 + if (display_api->get_screen_state() != SCREEN_ON) + { + display_api->turn_on_screen(); + } + display_api->set_screen_set_keepon_timeout(1000*5); + + set_lowpower_falg(0); + if (CheckPriority(topic)) + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); + } +} +else +{ + //电量过低,直接提醒关机 + if (display_api->get_screen_state() != SCREEN_ON) + { + display_api->turn_on_screen(); + } + display_api->set_screen_set_keepon_timeout(1000*10); + set_lowpower_falg(1); + if (NotificationManager::GetInstance()->HasNotifyShowing()) + NotificationManager::GetInstance()->StopNotify(); + if (CheckPriority(topic)) + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); + } +} +} + //TODO: 亮屏弹窗倒计时5秒关机(不需要取消,强制关机) + // DialModelCharge::GetInstance()->UpdatechargeStatus(0); + // SaveEleModel::GetInstance()->SetChargeStatus(0); + + // testCHANINGView *t=testCHANINGView::GetInstance(); + // if(t!=NULL) + // { + // t->ChangeViewcolor(false); + // } + +#ifdef SUPPORT_CAT1_MODEM +void MsgCenterNotifyHfpIncomingProc(const Topic topic, Request* req) +{ + hfp_hf_calls_info_t callData = {0}; + int32 ret = memcpy_s(&callData, sizeof(hfp_hf_calls_info_t), req->data, req->len); + if (ret != EOK) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify memcpy_s request data fail!"); + } else { + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyHfpIncomingProc"); + CallerLogModel::GetInstance()->SetoperateNumber(callData.number, callData.number_len); + CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourcePhone); + NotificationManager::GetInstance()->SetWatchCallStatus(true); + if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get())) + { + // ui_api_vibrate_once_func(); + } +} +void MsgCenterNotifyHfpPhoneProc(const Topic topic, Request* req) +{ + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "1201patch合并为编译过屏蔽下方代码"); + #if 0 // 1201patch 为编译过屏蔽 + unused(req); + // finish a single-channel call, or switch to phone, stop the notify + if (CallerLogModel::GetInstance()->GetNotifyFlag()) + { + DisableWatingView(); + if ((topic == TOPIC_EVENT_HFP_FINISHED && GetCurrCallNum() == 0) || + topic == TOPIC_EVENT_HFP_PHONE_ACTIVE || topic == TOPIC_EVENT_HFP_WATCH_TO_PHONE) + { + NotificationManager::GetInstance()->StopNotify(); + NotificationManager::GetInstance()->SetWatchCallStatus(false); + } + } + #endif +} + +void MsgCenterNotifyHfpWatchProc(const Topic topic, Request* req) +{ + +WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "1201patch合并为编译过屏蔽下方代码"); +#if 0 // 1201patch 为编译过屏蔽 +unused(req); +if (CallerLogModel::GetInstance()->GetNotifyFlag()) +{ + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + // default not mute + SetMicMute(false); + if (CallerLogModel::GetInstance()->IsMulitplePhoneStatus()) + { + NotificationManager::GetInstance()->ShowNotify(ShowMultiPhoneCallNotify, + static_cast(topic), true); + } else + { + NotificationManager::GetInstance()->ShowNotify(ShowCallingNotify, static_cast(topic), true); +} + NotificationManager::GetInstance()->SetWatchCallStatus(true); +} +#endif +} + +void MsgCenterNotifyHfpWatchHintProc(const Topic topic, Request* req) +{ + unused(req); + + phone_VibratorFunc(); + + if(NotificationManager::GetInstance()->HasNotifyShowing()) + NotificationManager::GetInstance()->StopNotify(); + + NotificationManager::GetInstance()->ShowNotify(showcallhintNotify, + static_cast(topic), true); +} + +//来电处理函数 +void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) +{ + unused(topic); + unused(topic); + if (req == NULL) return ; + char* call_data = (char*)malloc(req->len); + if(call_data==NULL) + { + return; + } + int32 ret = memcpy_s(call_data, req->len, req->data, req->len); + if (ret != EOK) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify memcpy_s request data fail!"); + } else { + // Prevent this from happening: + // When the incoming call view is displayed, the calling number is not set in CallerLogModel. + + if(NotificationManager::GetInstance()->GetWatchCallStatus() && + (CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourceCat1)) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OPERATE_WATCH_REJECT %s!=%s??",call_data,CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + CallerLogModel::GetInstance()->tempSetoperateNumberCAT1END(call_data,req->len); + cat1_phone_state_change_cb(OPERATE_WATCH_REJECT); + free(call_data); + return; + } + + if((NotificationManager::GetInstance()->GetWatchCallStatus() && + (CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourcePhone)) || uapi_dev_runtime_get_train_status() || transmittingISShow()) + { + + CallerLogModel::GetInstance()->tempSetoperateNumberCAT1(call_data,req->len); + cat1_phone_state_change_cb(OPERATE_WAITING); + free(call_data); + return; + } + + stopPlayingMusic(); + PlayersModel::GetInstance()->HandPausePhoneMusic(); // 暂停手机音乐 + uapi_set_screen_on_api(); + phone_paly_ring(); + + CallerLogModel::GetInstance()->SetoperateNumber(call_data,strlen(call_data)); + + cat1_phone_state_change_cb(OPERATE_INCOMING); + + } + free(call_data); + +} +//开始通话处理函数 +void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req) +{ + unused(topic); + unused(req); + + if (req == NULL) return ; + if(!NotificationManager::GetInstance()->GetWatchCallStatus()) + { + return; + } + AlarmClockModel::GetInstance()->AlarmPlayerStop(); + #ifdef SUPPORT_CAT1_HFP_AG_SERV + if(uapi_dev_runtime_get_earphone_connect_stat()) + { + + if(headset_Is_connect()) + { + if(headset_SCO_Is_connect()==false) + { + cat1_ag_send_call_event(TOPIC_EVENT_CAT1_INCOMMING,CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + } + else + { + if(cat1_api_get_cat1_volte_voice_state()==0) + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "headset_Is_connect is false"); + } + + } + else + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CONNECT_AG, nullptr, 0); + } + cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLCONNTED,NULL); + } + else + #endif + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0); + } + SetMicMutecat1(false); + cat1_phone_state_change_cb(OPERATE_WATCH_ACTIVE); + +} +#include "BluetoothModelC.h" +#include "audio_manager_c_wrapper.h" +#include "PhoneService.h" +//拨号处理函数 +void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req) +{ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify MsgCenterNotifyCat1dialProc"); + unused(topic); + unused(req); + if (req == NULL) return ; + char* call_data = (char*)malloc(req->len); + if(call_data==NULL) return; + int32 ret = memcpy_s(call_data, req->len, req->data, req->len); + if (ret != EOK) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify memcpy_s request data fail!"); + } else { + + // int ret = PlayersModel::GetInstance()->PlayerStop(); + stopPlayingMusic(); + + if(strcmp(call_data,"SOS")==0) + { + free(call_data); + NotificationManager::GetInstance()->ShowNotify(showSOSNotify, (uint16_t)topic, true); + return; + } - do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA, NULL); - - SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); - printf("sport end\n"); - #endif - - } - void MsgCenterNotifyONtimeProc(const Topic topic, Request* req) - { - unused(req); - AlarmClockEventData* time=(AlarmClockEventData*)req->data; - #ifdef SUPPORT_CYWEE_SERVICE - - cywee_save_data(); //暂时没有这个函数 - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时步数"); - cywee_step_history_save(time->value); - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时站立数据"); - if(cywee_get_stand_flag()) - cywee_stand_history_save(time->value); - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时卡路里数据"); - cywee_calories_history_save(time->value); - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时距离数据"); - cywee_distances_history_save(time->value); - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存每小时燃脂数据"); - cywee_fat_history_save(time->value); - // 保存完增加一次读取数据 - SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); - #endif - } - //设备绑定通知 - void MsgCenterNotifyDeviceBindProc(const Topic topic, Request* req) - { - #ifdef SUPPORT_BLE_SERVICE - //unused(req); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyBindProc Bind!"); - // const power_display_svr_api_t *display_api = power_display_svr_get_api(); - // if (display_api->get_screen_state() != SCREEN_ON) - // { - // display_api->turn_on_screen(); - // } - uint8_t* data=(uint8_t*)req->data; - /* 安全:固定上限 + 显式终止 */ - const size_t kMaxDevName = 64; - char devname[kMaxDevName + 1] = {0}; - if (data != NULL && req->len >= 2) - { - switch(data[0]) - { - case DEVICEBIND: - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); - { - /* 设备名在 payload[2..],长度为 req->len-2,做边界裁剪并追加'\0' */ - size_t name_len = (req->len > 2) ? (size_t)req->len - 2 : 0; - if (name_len > 0) - { - size_t copy_len = (name_len > kMaxDevName) ? kMaxDevName : name_len; - (void)memcpy_s(devname, sizeof(devname), (const char*)req->data + 2, copy_len); - devname[copy_len] = '\0'; - PairingViewEventListener::GetInstance().SetDeviceName(devname); - } - else - { - PairingViewEventListener::GetInstance().SetDeviceName(NULL); - } - } - if(NotificationManager::GetInstance()->HasNotifyShowing()) - { - NotificationManager::GetInstance()->StopNotify(); - } - NotificationManager::GetInstance()->ShowNotify(showDeviceBindingNotify, (uint16_t)topic, true); - break; - case DEVICEUNBIND: - - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); - { - size_t name_len = (req->len > 2) ? (size_t)req->len - 2 : 0; - if (name_len > 0) - { - size_t copy_len = (name_len > kMaxDevName) ? kMaxDevName : name_len; - (void)memcpy_s(devname, sizeof(devname), (const char*)req->data + 2, copy_len); - devname[copy_len] = '\0'; - PairingViewEventListener::GetInstance().SetDeviceName(devname); - } - else - { - PairingViewEventListener::GetInstance().SetDeviceName(NULL); - } - } - NotificationManager::GetInstance()->ShowNotify(showDeviceUnBindingNotify, (uint16_t)topic, true); - break; - case DeviceUnBindingRequest: - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showDeviceUnbindingRequestNotify, (uint16_t)topic, true); - break; - case SHUTDOWN: - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, " SHUTDOWN"); - set_lowpower_falg(3); - if (NotificationManager::GetInstance()->HasNotifyShowing()) - NotificationManager::GetInstance()->StopNotify(); - - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - - NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); - //low_power_play(true); - break; - case REBOOT: - set_lowpower_falg(4); - if (NotificationManager::GetInstance()->HasNotifyShowing()) - NotificationManager::GetInstance()->StopNotify(); - - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); - //low_power_play(false); - break; - - default: - break; - } +#ifdef SUPPORT_CAT1_SERVICE + cat1_cmd_send(CMD_4G_MAKE_CALL,call_data,strlen(call_data)); +#endif + CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len); + +#ifdef SUPPORT_CAT1_SERVICE + cat1_phone_state_change_cb(OPERATE_DIALING); +#endif + + #ifdef SUPPORT_CAT1_HFP_AG_SERV + if(uapi_dev_runtime_get_earphone_connect_stat()) + { + if(headset_Is_connect()) + { + cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLDIAL,NULL); - } - #endif - } - - - - void MsgCenterNotifybleTransmit(const Topic topic, Request* req) - { - #ifdef SUPPORT_BLE_SERVICE + if(headset_SCO_Is_connect()) + { + if(cat1_api_get_cat1_volte_voice_state()==0) + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); + } + } + else + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CONNECT_AG, nullptr, 0); + } + } + else + #endif + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0); + } + + } + free(call_data); +} +//电话结束处理函数 +void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req) +{ unused(topic); - uint8_t* data=(uint8_t*)req->data; - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifybleTransmit:%d",data[0]); + unused(req); - - if(data[0]==TRANS_FREE) + // just stop the notify + AlarmClockModel::GetInstance()->AlarmPlayerStop(); + + + if(!NotificationManager::GetInstance()->GetWatchCallStatus()) { - if(transmittingISShow()) - NotificationManager::GetInstance()->StopNotify(); + return; } - else if (data[0]==IS_NEED_CAT1_OTA) + + if (req == NULL) return ; + char* call_data = (char*)malloc(req->len); + + if(call_data==NULL) { - - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + return; + } + int32 ret = memcpy_s(call_data, req->len, req->data, req->len); + + if(strcmp("callfail",call_data)==0) + { + + // cat1_call_hungup(); + cat1_phone_state_change_cb(OPERATE_WATCH_FINISH); + CustomEventPublish(TOPIC_EVENT_CAT1_CALL_FAIL,NULL,0); - // NotificationManager::GetInstance()->ShowNotify(showCat1UpdataNotify, (uint16_t)topic, true); + free(call_data); + return; } - else if (data[0]==FILE_IS_DONE) + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s %s",call_data,CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + uint8_t offset_watch =0; + if(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()[0]=='+') + { + offset_watch++; + } + + uint8_t offset_call =0; + if(call_data[0]=='+') { - set_transmittingShow_falg(data[0]); + offset_call++; } + + if(strcmp(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()+offset_watch,call_data+offset_call)!=0 && + CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourceCat1) + { + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "no OPERATE_WATCH_FINISH"); + #ifdef SUPPORT_CAT1_HFP_AG_SERV + cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLENDED,NULL); + #endif + } else { - set_transmittingShow_falg(data[0]); - - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OPERATE_WATCH_FINISH"); + cat1_phone_state_change_cb(OPERATE_WATCH_FINISH); + #ifdef SUPPORT_CAT1_HFP_AG_SERV - NotificationManager::GetInstance()->ShowNotify(showtransmitNotify, (uint16_t)topic, true); + #endif } - #endif - } - - void MsgCenterNotifyChargePlugProc(const Topic topic, Request* req) - { - #ifdef SUPPORT_BATTERY_SERVICE - unused(req); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: CHarger Plug !"); - #ifdef SYSTEM_LOG_SERVICE - uapi_save_runtime_log(RUNTIME_LOG_CHARGE_START);//充电开始事件 - #endif - const power_display_svr_api_t *display_api = power_display_svr_get_api(); - if (display_api->get_screen_state() != SCREEN_ON) - { - display_api->turn_on_screen(); - } - - if(PullUpDownView::GetInstance()) - { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PullUpDownView::UpdateBatteryProcess, OHOS::PullUpDownView::GetInstance() )); - } - #if DIALDATASET - // DialModelCharge::GetInstance()->UpdatechargeStatus(1); - setChargeStatus(1); - #endif - SaveEleModel::GetInstance()->SetChargeStatus(true); - - if (uapi_dev_runtime_get_train_status()) - { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: CHarger Plug ! but train status is true"); - return ; - } - - - if(IsTestCHANGINGViewCreated()) - { - ChangeViewcolorC(1); - } - else - { - if (CheckPriority(topic) && !uapi_dev_runtime_get_factory_test_status_flag()) //产测模式不弹充电弹窗 - { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true); - } - } - #endif - } - - /*充电器已拔掉*/ - void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req) - { - #ifdef SUPPORT_BATTERY_SERVICE - unused(req); - unused(topic); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: CHarger UnPlug !"); - #ifdef SYSTEM_LOG_SERVICE - //充电停止事件 - uapi_save_runtime_log(RUNTIME_LOG_CHARGE_STOP);//TOOD* - #endif - if(PullUpDownView::GetInstance()) - { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PullUpDownView::UpdateBatteryProcess, OHOS::PullUpDownView::GetInstance() )); - } - #if DIALDATASET - // DialModelCharge::GetInstance()->UpdatechargeStatus(0); - setChargeStatus(0); - #endif - SaveEleModel::GetInstance()->SetChargeStatus(false); - - - if(IsTestCHANGINGViewCreated()) - { - ChangeViewcolorC(0); - } - else - { - if(is_UIViewGroup_charge()) - { - NotificationManager::GetInstance()->StopNotify(); - } - } - #endif - } - - /*低电量提醒*/ -void MsgCenterNotifyLowPowerAlarmProc(const Topic topic, Request* req) + + free(call_data); + +} + +void MsgCenterNotifyCat1FailEProc(const Topic topic, Request* req) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: LowPower Alarm !"); - uint8 *x= (uint8 *)(req->data); - const power_display_svr_api_t *display_api = power_display_svr_get_api(); - // if(*x==3) + unused(req); + + phone_VibratorFunc(); + + if(NotificationManager::GetInstance()->HasNotifyShowing()) + NotificationManager::GetInstance()->StopNotify(); + + NotificationManager::GetInstance()->ShowNotify(showcallfailNotify, + static_cast(topic), true); +} +#endif + + static uint8_t goal_type=0; + void MsgCenterNotifystepProc(const Topic topic, Request* req) + { + //unused(req); + if (req->msgId == TOPIC_EVENT_STEPDATA_UPDATE) + { + + #ifdef SUPPORT_CYWEE_SERVICE + if (req->data == nullptr) { + return; + } + // 计步数据累加 + + OHOS::GoalModel::GetInstance().show_data_step_refresh(); + OHOS::GoalModel::GetInstance().show_data_calories_refresh(); + OHOS::GoalModel::GetInstance().show_data_distance_refresh(); + + if(OHOS::GoalView::GetInstance()) + { + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::GoalView::GoalViewrefresh, OHOS::GoalView::GetInstance() )); + + // OHOS::GoalView::GetInstance()->GoalViewrefresh(); + } + if(OHOS::GoalotherView::GetInstance()) + { + //OHOS::GoalotherView::GetInstance()->GoalViewrefresh(); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::GoalotherView::GoalViewrefresh, OHOS::GoalotherView::GetInstance() )); + } + + if(OHOS::GoalModel::GetInstance().getstepvalue()>=100) + { + + goal_type=GOAL_STEP; + if(get_Is_show_flag(goal_type)) + { + if(OHOS::GoalModel::GetInstance().get_step_goal_show()) + { + CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); + } + } + } + + if(OHOS::GoalModel::GetInstance().is_goal_DISTANCE_done()) + { + goal_type=GOAL_DISTANCE; + if(get_Is_show_flag(goal_type)) + { + if(OHOS::GoalModel::GetInstance().get_other_goal_show()) + { + CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); + } + + } + } + + if(OHOS::GoalModel::GetInstance().is_goal_fatburning_done()) + { + goal_type=GOAL_FAT; + if(get_Is_show_flag(goal_type)) + { + if(OHOS::GoalModel::GetInstance().get_other_goal_show()) + { + CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); + } + } + } + + if(OHOS::GoalModel::GetInstance().is_goal_stand_done()) + { + goal_type=GOAL_STAND; + if(get_Is_show_flag(goal_type)) + { + if(OHOS::GoalModel::GetInstance().get_other_goal_show()) + { + CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); + } + } + } + + if(OHOS::GoalModel::GetInstance().is_goal_calories_done()) + { + goal_type=GOAL_CALOREIE; + if(get_Is_show_flag(goal_type)) + { + if(OHOS::GoalModel::GetInstance().get_other_goal_show()) + { + CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); + } + } + } + #endif + } + + + + } +#ifdef SUPPORT_CYWEE_SERVICE + //每日训练数据刷新 + // void MsgCenterNotifyActivityProc(const Topic topic, Request* req) + // { + // unused(topic); + // cywee_activity_result_t* c_activity_result_t = (cywee_activity_result_t *) malloc(req->len); + // if(c_activity_result_t==NULL) + // { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); + // return; + // } + + // int rets = memcpy_s(c_activity_result_t, req->len, (cywee_activity_result_t*)req->data, req->len); + // if (rets != EOK) + // { + // free(c_activity_result_t); + // c_activity_result_t = NULL; + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s c_activity_result_t failed, ret = %d", rets); + // return; + // } + // if(c_activity_result_t->activity_mode == SPORT_ACTIVE_MODE_NORMAL) + // { + // /*更新卡路里数据*/ + // //if(c_activity_result_t->calories!=0) + // { + // set_calories_data(c_activity_result_t->calories); + // #if DIALDATASET + // uint32_t calories= OHOS::GoalModel::GetInstance().show_data_calories_refresh(); + + // DialModelCalorie::GetInstance()->UpdateCalorie(calories); + // #endif + // } + // /*更新距离数据*/ + // //if(c_activity_result_t->distance != 0) + // { + // set_distance_data(c_activity_result_t->distance); + // #if DIALDATASET + // float distance= OHOS::GoalModel::GetInstance().show_data_distance_refresh(); + // DialModelDistance::GetInstance()->UpdateDistance(distance); + // #endif + // } + // } + // else if(c_activity_result_t->activity_mode == SPORT_ACTIVE_MODE_FREE_TRAINING && c_activity_result_t->MHR_zone >= 2) + // { + // /*更新燃脂时间数据*/ + // set_fat_time_data(1); + // } + + // free(c_activity_result_t); + // c_activity_result_t = NULL; + // } + // static int train_fat_time = 0; + // void MsgCenterNotifyActivityExtraInfoProc(const Topic topic, Request* req) // { - // if (display_api->get_screen_state() != SCREEN_ON) - // { - // display_api->turn_on_screen(); + // unused(topic); + // cywee_activity_result_extre_info_t* c_activity_result_extre_info_t = (cywee_activity_result_extre_info_t *) malloc(req->len); + // if(c_activity_result_extre_info_t==NULL) + // { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); + // return; + // } + + // int rets = memcpy_s(c_activity_result_extre_info_t, req->len, (cywee_activity_result_extre_info_t*)req->data, req->len); + // if (rets != EOK) + // { + // free(c_activity_result_extre_info_t); + // c_activity_result_extre_info_t = NULL; + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s c_activity_result_extre_info_t failed, ret = %d", rets); + // return; + // } + + // if(uapi_dev_runtime_get_train_status() && c_activity_result_extre_info_t->ativity_zone_high_duration) + // { + // train_fat_time = c_activity_result_extre_info_t->ativity_zone_high_duration; + // } + // /*更新燃脂时间数据*/ + // else if(uapi_dev_runtime_get_train_status() == 0 && train_fat_time) + // { + // set_fat_time_data(train_fat_time); + // train_fat_time = 0; // } - // display_api->set_screen_set_keepon_timeout(1000*5); - // //倒计时结束后,直接执行关机动画 - // low_power_play(); + + // free(c_activity_result_extre_info_t); + // c_activity_result_extre_info_t = NULL; // } - if(*x==0) + +/*运动识别*/ +void MsgCenterNotifyArAlertProc(const Topic topic, Request* req) +{ + uint8_t* motionType=(uint8_t*)req->data; + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyArAlertProc,motionType = %d !",*motionType); + MotionRecognitionViewEventListener::GetInstance().record_motion_recognition_log(); + if(*motionType > 5 || *motionType <1) //未知运动不弹窗 { - //提醒低电充电 - if (display_api->get_screen_state() != SCREEN_ON) - { - display_api->turn_on_screen(); - } - display_api->set_screen_set_keepon_timeout(1000*5); + return; + } + if (CheckPriority(topic)) + { + MotionRecognitionViewEventListener::GetInstance().SetMotionTypeId(*motionType); + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showMotionRecognitionNotify, (uint16_t)topic, true); + } - set_lowpower_falg(0); - if (CheckPriority(topic)) - { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); +} + +void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) +{ + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyInactivityProc !"); + inact_result_t *cywee_Inactivity_Info = (inact_result_t *)malloc(req->len); + if (!cywee_Inactivity_Info) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); + return; + } + + int rets = memcpy_s(cywee_Inactivity_Info, req->len, (inact_result_t*)req->data, req->len); + if (rets != EOK) + { + free(cywee_Inactivity_Info); + cywee_Inactivity_Info = NULL; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s cywee_inactivity_result_t failed, ret = %d", rets); + return; + } + + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "cywee_Inactivity_Info->output_number = %d", cywee_Inactivity_Info->output_number); + + switch (cywee_Inactivity_Info->output_number) + { + case INACTIVITY_MODE_SEDENTARY_OUTPUT: + if(cywee_Inactivity_Info->status == 1) + { + SedentaryReminderViewEventListener::GetInstance().record_sedentary_reminder_log(); + if (CheckPriority(topic)) + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true); + } + } + else if(cywee_Inactivity_Info->status==9) + { + cywee_set_stand_flag(); + } + break; + default: + break; + } + + free(cywee_Inactivity_Info); + cywee_Inactivity_Info = NULL; +} + +#endif + +//查找手表通知 +void MsgCenterNotifyFindWatchProc(const Topic topic, Request* req) +{ + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyFindWatchProc !"); + if (CheckPriority(topic)) + { + uint8_t* type=(uint8_t*)req->data; + if(*type == 1) + { + FindWatchViewEventListener::GetInstance().SetFindWatchNotifyFlag(true); + FindWatchViewEventListener::GetInstance().PopInterPlayMusic(nullptr);//播放铃声 + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showFindWatchNotify, (uint16_t)topic, true); + //如果查找手表铃声播放成功,记录该事件 + uapi_save_runtime_log(RUNTIME_LOG_RING_PLAY_START_FINDWATCH);//TOOD* + } else { + if (FindWatchViewEventListener::GetInstance().GetFindWatchNotifyFlag() == true) { + NotificationManager::GetInstance()->StopNotify(); + } + FindWatchViewEventListener::GetInstance().SetFindWatchNotifyFlag(false); } + } else { + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "NotifyPriority = %d ",NotificationManager::GetInstance()->GetNotifyPriority()); } - else +} + +void MsgCenterNotifyDebugOutProc(const Topic topic, Request *req) +{ + unused(req); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyDebugOutProc !"); + if (CheckPriority(topic)) + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + NotificationManager::GetInstance()->ShowNotify(showDebugOutputNotify, (uint16_t)topic, true); + } +} +//运动目标通知 +void MsgCenterNotifyGoalShowViewProc(const Topic topic, Request* req) +{ + unused(req); + if (CheckPriority(topic)) { - //电量过低,直接提醒关机 - if (display_api->get_screen_state() != SCREEN_ON) + uint8_t* data=(uint8_t*)req->data; + if(get_Is_show_flag(data[0])) { - display_api->turn_on_screen(); - } - display_api->set_screen_set_keepon_timeout(1000*10); - set_lowpower_falg(1); - if (NotificationManager::GetInstance()->HasNotifyShowing()) - NotificationManager::GetInstance()->StopNotify(); - if (CheckPriority(topic)) - { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); - NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); + set_goal_flag_view(data[0]); + set_Is_show_flag(0,data[0]); + + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + + uapi_set_screen_on_api(); + + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(ShowGoalNotify, static_cast(topic), true); } } } - //TODO: 亮屏弹窗倒计时5秒关机(不需要取消,强制关机) - // DialModelCharge::GetInstance()->UpdatechargeStatus(0); - // SaveEleModel::GetInstance()->SetChargeStatus(0); - - // testCHANINGView *t=testCHANINGView::GetInstance(); - // if(t!=NULL) - // { - // t->ChangeViewcolor(false); - // } - - #ifdef SUPPORT_CAT1_MODEM - void MsgCenterNotifyHfpIncomingProc(const Topic topic, Request* req) - { - hfp_hf_calls_info_t callData = {0}; - int32 ret = memcpy_s(&callData, sizeof(hfp_hf_calls_info_t), req->data, req->len); - if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify memcpy_s request data fail!"); - } else { - } - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyHfpIncomingProc"); - CallerLogModel::GetInstance()->SetoperateNumber(callData.number, callData.number_len); - CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourcePhone); - NotificationManager::GetInstance()->SetWatchCallStatus(true); - if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get())) - { - // ui_api_vibrate_once_func(); - } - } - void MsgCenterNotifyHfpPhoneProc(const Topic topic, Request* req) - { - unused(req); - // finish a single-channel call, or switch to phone, stop the notify - if (CallerLogModel::GetInstance()->GetNotifyFlag()) { - DisableWatingView(); - if ((topic == TOPIC_EVENT_HFP_FINISHED && GetCurrCallNum() == 0) || - topic == TOPIC_EVENT_HFP_PHONE_ACTIVE || topic == TOPIC_EVENT_HFP_WATCH_TO_PHONE) { - NotificationManager::GetInstance()->StopNotify(); - NotificationManager::GetInstance()->SetWatchCallStatus(false); - } - } - } - - void MsgCenterNotifyHfpWatchProc(const Topic topic, Request* req) - { - unused(req); - if (CallerLogModel::GetInstance()->GetNotifyFlag()) { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); - // default not mute - SetMicMute(false); - if (CallerLogModel::GetInstance()->IsMulitplePhoneStatus()) { - NotificationManager::GetInstance()->ShowNotify(ShowMultiPhoneCallNotify, - static_cast(topic), true); - } else { - NotificationManager::GetInstance()->ShowNotify(ShowCallingNotify, static_cast(topic), true); - } - NotificationManager::GetInstance()->SetWatchCallStatus(true); - } - } - - void MsgCenterNotifyHfpWatchHintProc(const Topic topic, Request* req) - { - unused(req); - - phone_VibratorFunc(); - - if(NotificationManager::GetInstance()->HasNotifyShowing()) - NotificationManager::GetInstance()->StopNotify(); - - NotificationManager::GetInstance()->ShowNotify(showcallhintNotify, - static_cast(topic), true); - } - - //来电处理函数 - void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) - { - unused(topic); - unused(topic); - if (req == NULL) return ; - char* call_data = (char*)malloc(req->len); - if(call_data==NULL) - { - return; - } - int32 ret = memcpy_s(call_data, req->len, req->data, req->len); - if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify memcpy_s request data fail!"); - } else { - // Prevent this from happening: - // When the incoming call view is displayed, the calling number is not set in CallerLogModel. - - if(NotificationManager::GetInstance()->GetWatchCallStatus() && - (CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourceCat1)) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OPERATE_WATCH_REJECT %s!=%s??",call_data,CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - CallerLogModel::GetInstance()->tempSetoperateNumberCAT1END(call_data,req->len); - cat1_phone_state_change_cb(OPERATE_WATCH_REJECT); - free(call_data); - return; - } - - if((NotificationManager::GetInstance()->GetWatchCallStatus() && - (CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourcePhone)) || uapi_dev_runtime_get_train_status() || transmittingISShow()) - { - - CallerLogModel::GetInstance()->tempSetoperateNumberCAT1(call_data,req->len); - cat1_phone_state_change_cb(OPERATE_WAITING); - free(call_data); - return; - } - - stopPlayingMusic(); - PlayersModel::GetInstance()->HandPausePhoneMusic(); // 暂停手机音乐 - uapi_set_screen_on_api(); - phone_paly_ring(); - - CallerLogModel::GetInstance()->SetoperateNumber(call_data,strlen(call_data)); - - cat1_phone_state_change_cb(OPERATE_INCOMING); +//喝水提醒通知 +void MsgCenterNotifyDrinkReminderProc(const Topic topic, Request *req) +{ +// unused(topic); + unused(req); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyDrinkReminderProc !"); + // DrinkReminderViewEventListener::GetInstance().set_screen_on_and_vibration(); + DrinkReminderViewEventListener::GetInstance().record_drink_reminder_log(); + if (CheckPriority(topic)) + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showDrinkReminderNotify, (uint16_t)topic, true); + } +} +//关机动画 +void MsgCenterNotifyShutDownAnimatorProc(const Topic topic, Request* req) +{ + unused(topic); + uint8_t* data=(uint8_t*)req->data; + set_shutDownAnimation_falg(data[0]); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyShutDownAnimatorProc,shutdown_flag = %d",*data); + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); + NotificationManager::GetInstance()->ShowNotify(showShutdownAnimatorNotify, (uint16_t)topic, true); +} +//消息通知 +void MsgCenterNotifyMessageProc(const Topic topic, Request* req) +{ + // unused(topic); + unused(req); + // WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyMessageProc !"); + if (CheckPriority(topic)) { + // do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_MESSAGE_DATA_NOTIFY, + // nullptr, 0); + OHOS::NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_THREE); + OHOS::NotificationManager::GetInstance()->ShowNotify(OHOS::CreateMessageView, TOPIC_EVENT_MESSAGENOTE, true); + //进行消息显示记录 + uapi_save_runtime_log(RUNTIME_LOG_MSG_SHOW); + } +} + +//睡眠提醒通知 +void MsgCenterNotifySleepProc(const Topic topic, Request* req) +{ + unused(req); +// unused(topic); + if (CheckPriority(topic)) + { - } - free(call_data); - - } - //开始通话处理函数 - void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req) - { - unused(topic); - unused(req); - - if (req == NULL) return ; - if(!NotificationManager::GetInstance()->GetWatchCallStatus()) - { - return; - } - AlarmClockModel::GetInstance()->AlarmPlayerStop(); - #ifdef SUPPORT_CAT1_HFP_AG_SERV - if(uapi_dev_runtime_get_earphone_connect_stat()) - { - - if(headset_Is_connect()) - { - if(headset_SCO_Is_connect()==false) - { - cat1_ag_send_call_event(TOPIC_EVENT_CAT1_INCOMMING,CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - } - else - { - if(cat1_api_get_cat1_volte_voice_state()==0) - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "headset_Is_connect is false"); - } - - } - else - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CONNECT_AG, nullptr, 0); - } - cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLCONNTED,NULL); - } - else - #endif - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0); - } - SetMicMutecat1(false); - cat1_phone_state_change_cb(OPERATE_WATCH_ACTIVE); - - } - #include "BluetoothModelC.h" - #include "audio_manager_c_wrapper.h" - #include "PhoneService.h" - //拨号处理函数 - void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify MsgCenterNotifyCat1dialProc"); - unused(topic); - unused(req); - if (req == NULL) return ; - char* call_data = (char*)malloc(req->len); - if(call_data==NULL) return; - int32 ret = memcpy_s(call_data, req->len, req->data, req->len); - if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify memcpy_s request data fail!"); - } else { - - // int ret = PlayersModel::GetInstance()->PlayerStop(); - stopPlayingMusic(); - - if(strcmp(call_data,"SOS")==0) - { - free(call_data); - NotificationManager::GetInstance()->ShowNotify(showSOSNotify, (uint16_t)topic, true); - return; - } - - #ifdef SUPPORT_CAT1_SERVICE - cat1_cmd_send(CMD_4G_MAKE_CALL,call_data,strlen(call_data)); - #endif - CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifySleepProc %d!",SleepModel::GetInstance().get_sleep_state()); - #ifdef SUPPORT_CAT1_SERVICE - cat1_phone_state_change_cb(OPERATE_DIALING); - #endif - - #ifdef SUPPORT_CAT1_HFP_AG_SERV - if(uapi_dev_runtime_get_earphone_connect_stat()) - { - if(headset_Is_connect()) - { - cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLDIAL,NULL); - - if(headset_SCO_Is_connect()) - { - if(cat1_api_get_cat1_volte_voice_state()==0) - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); - } - } - else - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CONNECT_AG, nullptr, 0); - } - } - else - #endif - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0); - } + /*早安闹钟*/ + if(SleepModel::GetInstance().get_sleep_state()==SLEEPSTATE::WAKE) + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + SleepViewEventListener::GetInstance().PopInterPlayMusic(); + } + else + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_THREE); + } + + NotificationManager::GetInstance()->ShowNotify(showSleepNotify, (uint16_t)topic, true); + } - } - free(call_data); - } - //电话结束处理函数 - void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req) - { - unused(topic); - unused(req); +} + +void MsgCenterNotifyInactivityAccumulateTimeProc(const Topic topic, Request* req) +{ + unused(topic); +#if 0 + if(uapi_dev_runtime_get_absolute_static_status()) + { + memset(&sleep_data,0,sizeof(SLEEP_T)); + state_num = 0; + //fall_asleep_state_num = 0; + uapi_dev_runtime_set_absolute_static_status(0); + return; + } + + cywee_inactivity_accumulate_time_t *cywee_Inactivity_Accumulate_Time_Info = (cywee_inactivity_accumulate_time_t *)malloc(req->len); + if (!cywee_Inactivity_Accumulate_Time_Info) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); + return; + } - // just stop the notify - AlarmClockModel::GetInstance()->AlarmPlayerStop(); - - - if(!NotificationManager::GetInstance()->GetWatchCallStatus()) - { - return; - } - - if (req == NULL) return ; - char* call_data = (char*)malloc(req->len); - - if(call_data==NULL) - { - return; - } - int32 ret = memcpy_s(call_data, req->len, req->data, req->len); - - if(strcmp("callfail",call_data)==0) - { - - // cat1_call_hungup(); - cat1_phone_state_change_cb(OPERATE_WATCH_FINISH); - CustomEventPublish(TOPIC_EVENT_CAT1_CALL_FAIL,NULL,0); - - free(call_data); - return; - } - - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s %s",call_data,CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - uint8_t offset_watch =0; - if(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()[0]=='+') - { - offset_watch++; - } - - uint8_t offset_call =0; - if(call_data[0]=='+') - { - offset_call++; - } - - if(strcmp(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()+offset_watch,call_data+offset_call)!=0 && - CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourceCat1) - { - - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "no OPERATE_WATCH_FINISH"); - #ifdef SUPPORT_CAT1_HFP_AG_SERV - cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLENDED,NULL); - #endif - } - else - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OPERATE_WATCH_FINISH"); - cat1_phone_state_change_cb(OPERATE_WATCH_FINISH); - #ifdef SUPPORT_CAT1_HFP_AG_SERV - - #endif - } - - free(call_data); - - } - - void MsgCenterNotifyCat1FailEProc(const Topic topic, Request* req) - { - unused(req); - - phone_VibratorFunc(); - - if(NotificationManager::GetInstance()->HasNotifyShowing()) - NotificationManager::GetInstance()->StopNotify(); - - NotificationManager::GetInstance()->ShowNotify(showcallfailNotify, - static_cast(topic), true); - } - #endif - - static uint8_t goal_type=0; - void MsgCenterNotifystepProc(const Topic topic, Request* req) - { - //unused(req); - if (req->msgId == TOPIC_EVENT_STEPDATA_UPDATE) - { - - #ifdef SUPPORT_CYWEE_SERVICE - if (req->data == nullptr) { - return; - } - // 计步数据累加 - - OHOS::GoalModel::GetInstance().show_data_step_refresh(); - OHOS::GoalModel::GetInstance().show_data_calories_refresh(); - OHOS::GoalModel::GetInstance().show_data_distance_refresh(); - - if(OHOS::GoalView::GetInstance()) - { - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(&OHOS::GoalView::GoalViewrefresh, OHOS::GoalView::GetInstance() )); - - // OHOS::GoalView::GetInstance()->GoalViewrefresh(); - } - if(OHOS::GoalotherView::GetInstance()) - { - //OHOS::GoalotherView::GetInstance()->GoalViewrefresh(); - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(&OHOS::GoalotherView::GoalViewrefresh, OHOS::GoalotherView::GetInstance() )); - } - - if(OHOS::GoalModel::GetInstance().getstepvalue()>=100) - { - - goal_type=GOAL_STEP; - if(get_Is_show_flag(goal_type)) - { - if(OHOS::GoalModel::GetInstance().get_step_goal_show()) - { - CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); - } - } - } - - if(OHOS::GoalModel::GetInstance().is_goal_DISTANCE_done()) - { - goal_type=GOAL_DISTANCE; - if(get_Is_show_flag(goal_type)) - { - if(OHOS::GoalModel::GetInstance().get_other_goal_show()) - { - CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); - } - - } - } - - if(OHOS::GoalModel::GetInstance().is_goal_fatburning_done()) - { - goal_type=GOAL_FAT; - if(get_Is_show_flag(goal_type)) - { - if(OHOS::GoalModel::GetInstance().get_other_goal_show()) - { - CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); - } - } - } - - if(OHOS::GoalModel::GetInstance().is_goal_stand_done()) - { - goal_type=GOAL_STAND; - if(get_Is_show_flag(goal_type)) - { - if(OHOS::GoalModel::GetInstance().get_other_goal_show()) - { - CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); - } - } - } - - if(OHOS::GoalModel::GetInstance().is_goal_calories_done()) - { - goal_type=GOAL_CALOREIE; - if(get_Is_show_flag(goal_type)) - { - if(OHOS::GoalModel::GetInstance().get_other_goal_show()) - { - CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); - } - } - } - #endif - } - - - - } - #ifdef SUPPORT_CYWEE_SERVICE - //每日训练数据刷新 - // void MsgCenterNotifyActivityProc(const Topic topic, Request* req) - // { - // unused(topic); - // cywee_activity_result_t* c_activity_result_t = (cywee_activity_result_t *) malloc(req->len); - // if(c_activity_result_t==NULL) - // { - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); - // return; - // } - - // int rets = memcpy_s(c_activity_result_t, req->len, (cywee_activity_result_t*)req->data, req->len); - // if (rets != EOK) - // { - // free(c_activity_result_t); - // c_activity_result_t = NULL; - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s c_activity_result_t failed, ret = %d", rets); - // return; - // } - // if(c_activity_result_t->activity_mode == SPORT_ACTIVE_MODE_NORMAL) - // { - // /*更新卡路里数据*/ - // //if(c_activity_result_t->calories!=0) - // { - // set_calories_data(c_activity_result_t->calories); - // #if DIALDATASET - // uint32_t calories= OHOS::GoalModel::GetInstance().show_data_calories_refresh(); - - // DialModelCalorie::GetInstance()->UpdateCalorie(calories); - // #endif - // } - // /*更新距离数据*/ - // //if(c_activity_result_t->distance != 0) - // { - // set_distance_data(c_activity_result_t->distance); - // #if DIALDATASET - // float distance= OHOS::GoalModel::GetInstance().show_data_distance_refresh(); - // DialModelDistance::GetInstance()->UpdateDistance(distance); - // #endif - // } - // } - // else if(c_activity_result_t->activity_mode == SPORT_ACTIVE_MODE_FREE_TRAINING && c_activity_result_t->MHR_zone >= 2) - // { - // /*更新燃脂时间数据*/ - // set_fat_time_data(1); - // } - - // free(c_activity_result_t); - // c_activity_result_t = NULL; - // } - // static int train_fat_time = 0; - // void MsgCenterNotifyActivityExtraInfoProc(const Topic topic, Request* req) - // { - // unused(topic); - // cywee_activity_result_extre_info_t* c_activity_result_extre_info_t = (cywee_activity_result_extre_info_t *) malloc(req->len); - // if(c_activity_result_extre_info_t==NULL) - // { - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); - // return; - // } - - // int rets = memcpy_s(c_activity_result_extre_info_t, req->len, (cywee_activity_result_extre_info_t*)req->data, req->len); - // if (rets != EOK) - // { - // free(c_activity_result_extre_info_t); - // c_activity_result_extre_info_t = NULL; - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s c_activity_result_extre_info_t failed, ret = %d", rets); - // return; - // } - - // if(uapi_dev_runtime_get_train_status() && c_activity_result_extre_info_t->ativity_zone_high_duration) - // { - // train_fat_time = c_activity_result_extre_info_t->ativity_zone_high_duration; - // } - // /*更新燃脂时间数据*/ - // else if(uapi_dev_runtime_get_train_status() == 0 && train_fat_time) - // { - // set_fat_time_data(train_fat_time); - // train_fat_time = 0; - // } - - // free(c_activity_result_extre_info_t); - // c_activity_result_extre_info_t = NULL; - // } - - /*运动识别*/ - void MsgCenterNotifyArAlertProc(const Topic topic, Request* req) - { - uint8_t* motionType=(uint8_t*)req->data; - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyArAlertProc,motionType = %d !",*motionType); - MotionRecognitionViewEventListener::GetInstance().record_motion_recognition_log(); - if(*motionType > 5 || *motionType <1) //未知运动不弹窗 - { - return; - } - if (CheckPriority(topic)) - { - MotionRecognitionViewEventListener::GetInstance().SetMotionTypeId(*motionType); - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showMotionRecognitionNotify, (uint16_t)topic, true); - } + int rets = memcpy_s(cywee_Inactivity_Accumulate_Time_Info, req->len, (cywee_inactivity_accumulate_time_t*)req->data, req->len); + if (rets != EOK) + { + free(cywee_Inactivity_Accumulate_Time_Info); + cywee_Inactivity_Accumulate_Time_Info = NULL; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s cywee_Inactivity_Accumulate_Time_Info failed, ret = %d", rets); + return; + } +#ifdef CUSTOM_ZHIHUI + if(cywee_Inactivity_Accumulate_Time_Info->output_number == INACTIVITY_MODE_NAP_ACCUMULATE_TIME_OUTPUT) + { + nap_data.total_time = cywee_Inactivity_Accumulate_Time_Info->total_time; + set_nap_data(&nap_data); + do_custom_fileoperate_service_check_msg( + CUSTOM_FILEOPERATE_MSG_TYPE_NAPDATA_SAVE, nullptr, 0); + memset(&nap_data,0,sizeof(NAP_T)); + } + else if(cywee_Inactivity_Accumulate_Time_Info->output_number == INACTIVITY_MODE_SLEEPING_ACCUMULATE_TIME_OUTPUT) + { + // if(sleep_data.fall_asleep_timestamp > sleep_data.wake_up_timestamp && sleep_data.wake_up_timestamp != 0) + // { + // sleep_data.fall_asleep_timestamp -= 24 * 60 * 60; + // sleep_data.sleep_status[fall_asleep_state_num].timestamp = sleep_data.fall_asleep_timestamp; + // } + + sleep_data.total_time = cywee_Inactivity_Accumulate_Time_Info->total_time; + sleep_data.total_deep_sleep_time = cywee_Inactivity_Accumulate_Time_Info->total_deep_sleep_time; + sleep_data.total_mild_sleep_time = cywee_Inactivity_Accumulate_Time_Info->total_mild_sleep_time; + sleep_data.total_wake_time = cywee_Inactivity_Accumulate_Time_Info->total_wake_time; + sleep_data.total_rem_sleep_time = cywee_Inactivity_Accumulate_Time_Info->total_rem_sleep_time; + sleep_data.status_num = state_num; + + set_sleep_data(&sleep_data); + do_custom_fileoperate_service_check_msg( + CUSTOM_FILEOPERATE_MSG_TYPE_SLEEPDATA_SAVE, nullptr, 0); + memset(&sleep_data,0,sizeof(SLEEP_T)); + state_num = 0; + //fall_asleep_state_num = 0; + } +#endif + free(cywee_Inactivity_Accumulate_Time_Info); + cywee_Inactivity_Accumulate_Time_Info = NULL; + //uapi_dev_runtime_set_sleep_status(0); +#endif +} + +//APP运动相关 +void MsgCenterNotifybleAPPtraining(const Topic topic, Request* req) +{ + unused(topic); + uint8_t* data=(uint8_t*)req->data; + if(data!=NULL && req->len>=2) + { + switch (data[1]) + { + case START://运动开始 + + break; + case STOP://运动暂停 + + break; + case RECOVER://运动恢复 + + break; + + case END://运动结束 + break; + } + } + + // unused(req); + +} + + +/* 订阅事件通知逻辑可定制 */ +static MsgCenterNotifyTable g_msgCenterNotifyTable[] = { + {TOPIC_EVENT_ALARM_RING, MsgCenterNotifyAlarmProc}, + {TOPIC_EVENT_ON_TIME, MsgCenterNotifyONtimeProc},//增加整点保存数据 + {TOPIC_EVENT_NEXTDAY_UPDATE, MsgCenterNotifyNextDayProc}, + {TOPIC_EVENT_STEPDATA_UPDATE, MsgCenterNotifystepProc}, + + {TOPIC_EVENT_HFP_INCOMMING, MsgCenterNotifyHfpIncomingProc}, + {TOPIC_EVENT_HFP_PHONE_ACTIVE, MsgCenterNotifyHfpPhoneProc}, + {TOPIC_EVENT_HFP_FINISHED, MsgCenterNotifyHfpPhoneProc}, + {TOPIC_EVENT_HFP_WATCH_TO_PHONE, MsgCenterNotifyHfpPhoneProc}, + {TOPIC_EVENT_HFP_WATCH_ACTIVE, MsgCenterNotifyHfpWatchProc}, + {TOPIC_EVENT_HFP_PHONE_TO_WATCH, MsgCenterNotifyHfpWatchProc}, + {TOPIC_EVENT_HFP_HINT, MsgCenterNotifyHfpWatchHintProc}, - } - - void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) - { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyInactivityProc !"); - inact_result_t *cywee_Inactivity_Info = (inact_result_t *)malloc(req->len); - if (!cywee_Inactivity_Info) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); - return; - } - - int rets = memcpy_s(cywee_Inactivity_Info, req->len, (inact_result_t*)req->data, req->len); - if (rets != EOK) - { - free(cywee_Inactivity_Info); - cywee_Inactivity_Info = NULL; - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s cywee_inactivity_result_t failed, ret = %d", rets); - return; - } - - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "cywee_Inactivity_Info->output_number = %d", cywee_Inactivity_Info->output_number); - - switch (cywee_Inactivity_Info->output_number) - { - case INACTIVITY_MODE_SEDENTARY_OUTPUT: - if(cywee_Inactivity_Info->status == 1) - { - SedentaryReminderViewEventListener::GetInstance().record_sedentary_reminder_log(); - if (CheckPriority(topic)) - { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true); - } - } - else if(cywee_Inactivity_Info->status==9) - { - cywee_set_stand_flag(); - } - break; - default: - break; - } - - free(cywee_Inactivity_Info); - cywee_Inactivity_Info = NULL; - } - - #endif - - //查找手表通知 - void MsgCenterNotifyFindWatchProc(const Topic topic, Request* req) - { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyFindWatchProc !"); - if (CheckPriority(topic)) - { - uint8_t* type=(uint8_t*)req->data; - if(*type == 1) - { - FindWatchViewEventListener::GetInstance().SetFindWatchNotifyFlag(true); - FindWatchViewEventListener::GetInstance().PopInterPlayMusic(nullptr);//播放铃声 - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showFindWatchNotify, (uint16_t)topic, true); - //如果查找手表铃声播放成功,记录该事件 - uapi_save_runtime_log(RUNTIME_LOG_RING_PLAY_START_FINDWATCH);//TOOD* - } else { - if (FindWatchViewEventListener::GetInstance().GetFindWatchNotifyFlag() == true) { - NotificationManager::GetInstance()->StopNotify(); - } - FindWatchViewEventListener::GetInstance().SetFindWatchNotifyFlag(false); - } - } else { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "NotifyPriority = %d ",NotificationManager::GetInstance()->GetNotifyPriority()); - } - } - - void MsgCenterNotifyDebugOutProc(const Topic topic, Request *req) - { - unused(req); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyDebugOutProc !"); - if (CheckPriority(topic)) - { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); - NotificationManager::GetInstance()->ShowNotify(showDebugOutputNotify, (uint16_t)topic, true); - } - } - //运动目标通知 - void MsgCenterNotifyGoalShowViewProc(const Topic topic, Request* req) - { - unused(req); - if (CheckPriority(topic)) - { - uint8_t* data=(uint8_t*)req->data; - if(get_Is_show_flag(data[0])) - { - set_goal_flag_view(data[0]); - set_Is_show_flag(0,data[0]); - - const power_display_svr_api_t *display_api = power_display_svr_get_api(); - - uapi_set_screen_on_api(); - - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(ShowGoalNotify, static_cast(topic), true); - } - } - } - //喝水提醒通知 - void MsgCenterNotifyDrinkReminderProc(const Topic topic, Request *req) - { - // unused(topic); - unused(req); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyDrinkReminderProc !"); - // DrinkReminderViewEventListener::GetInstance().set_screen_on_and_vibration(); - DrinkReminderViewEventListener::GetInstance().record_drink_reminder_log(); - if (CheckPriority(topic)) - { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showDrinkReminderNotify, (uint16_t)topic, true); - } - } - //关机动画 - void MsgCenterNotifyShutDownAnimatorProc(const Topic topic, Request* req) - { - unused(topic); - uint8_t* data=(uint8_t*)req->data; - set_shutDownAnimation_falg(data[0]); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyShutDownAnimatorProc,shutdown_flag = %d",*data); - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); - NotificationManager::GetInstance()->ShowNotify(showShutdownAnimatorNotify, (uint16_t)topic, true); - } - //消息通知 - void MsgCenterNotifyMessageProc(const Topic topic, Request* req) - { - // unused(topic); - unused(req); - // WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyMessageProc !"); - if (CheckPriority(topic)) { - // do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_MESSAGE_DATA_NOTIFY, - // nullptr, 0); - OHOS::NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_THREE); - OHOS::NotificationManager::GetInstance()->ShowNotify(OHOS::CreateMessageView, TOPIC_EVENT_MESSAGENOTE, true); - //进行消息显示记录 - uapi_save_runtime_log(RUNTIME_LOG_MSG_SHOW); - } - } - - //睡眠提醒通知 - void MsgCenterNotifySleepProc(const Topic topic, Request* req) - { - unused(req); - // unused(topic); - if (CheckPriority(topic)) - { - - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifySleepProc %d!",SleepModel::GetInstance().get_sleep_state()); - - /*早安闹钟*/ - if(SleepModel::GetInstance().get_sleep_state()==SLEEPSTATE::WAKE) - { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - SleepViewEventListener::GetInstance().PopInterPlayMusic(); - } - else - { - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_THREE); - } +#ifdef SUPPORT_CYWEE_SERVICE + // {TOPIC_EVENT_ACTIVITY_UPDATE, MsgCenterNotifyActivityProc}, + // {TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE, MsgCenterNotifyActivityExtraInfoProc}, + {TOPIC_EVENT_AR_ALERT_TYPE_UPDATE, MsgCenterNotifyArAlertProc}, + {TOPIC_EVENT_INACTIVITY_UPDATE, MsgCenterNotifyInactivityProc}, + // {TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE, MsgCenterNotifyInactivityAccumulateTimeProc}, +#endif + {TOPIC_EVENT_GOAL_SHOW_VIEW, MsgCenterNotifyGoalShowViewProc}, + {TOPIC_EVENT_BLE_TRANSMIT, MsgCenterNotifybleTransmit}, + + {TOPIC_EVENT_CHARGE_PLUG, MsgCenterNotifyChargePlugProc}, + {TOPIC_EVENT_CHARGE_UNPLUG, MsgCenterNotifyChargeUnPlugProc}, + {TOPIC_EVENT_LOWPOWER_ALARM, MsgCenterNotifyLowPowerAlarmProc}, - NotificationManager::GetInstance()->ShowNotify(showSleepNotify, (uint16_t)topic, true); - } - - } - - void MsgCenterNotifyInactivityAccumulateTimeProc(const Topic topic, Request* req) - { - unused(topic); - #if 0 - if(uapi_dev_runtime_get_absolute_static_status()) - { - memset(&sleep_data,0,sizeof(SLEEP_T)); - state_num = 0; - //fall_asleep_state_num = 0; - uapi_dev_runtime_set_absolute_static_status(0); - return; - } - - cywee_inactivity_accumulate_time_t *cywee_Inactivity_Accumulate_Time_Info = (cywee_inactivity_accumulate_time_t *)malloc(req->len); - if (!cywee_Inactivity_Accumulate_Time_Info) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); - return; - } - - int rets = memcpy_s(cywee_Inactivity_Accumulate_Time_Info, req->len, (cywee_inactivity_accumulate_time_t*)req->data, req->len); - if (rets != EOK) - { - free(cywee_Inactivity_Accumulate_Time_Info); - cywee_Inactivity_Accumulate_Time_Info = NULL; - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s cywee_Inactivity_Accumulate_Time_Info failed, ret = %d", rets); - return; - } - #ifdef CUSTOM_ZHIHUI - if(cywee_Inactivity_Accumulate_Time_Info->output_number == INACTIVITY_MODE_NAP_ACCUMULATE_TIME_OUTPUT) - { - nap_data.total_time = cywee_Inactivity_Accumulate_Time_Info->total_time; - set_nap_data(&nap_data); - do_custom_fileoperate_service_check_msg( - CUSTOM_FILEOPERATE_MSG_TYPE_NAPDATA_SAVE, nullptr, 0); - memset(&nap_data,0,sizeof(NAP_T)); - } - else if(cywee_Inactivity_Accumulate_Time_Info->output_number == INACTIVITY_MODE_SLEEPING_ACCUMULATE_TIME_OUTPUT) - { - // if(sleep_data.fall_asleep_timestamp > sleep_data.wake_up_timestamp && sleep_data.wake_up_timestamp != 0) - // { - // sleep_data.fall_asleep_timestamp -= 24 * 60 * 60; - // sleep_data.sleep_status[fall_asleep_state_num].timestamp = sleep_data.fall_asleep_timestamp; - // } - - sleep_data.total_time = cywee_Inactivity_Accumulate_Time_Info->total_time; - sleep_data.total_deep_sleep_time = cywee_Inactivity_Accumulate_Time_Info->total_deep_sleep_time; - sleep_data.total_mild_sleep_time = cywee_Inactivity_Accumulate_Time_Info->total_mild_sleep_time; - sleep_data.total_wake_time = cywee_Inactivity_Accumulate_Time_Info->total_wake_time; - sleep_data.total_rem_sleep_time = cywee_Inactivity_Accumulate_Time_Info->total_rem_sleep_time; - sleep_data.status_num = state_num; - - set_sleep_data(&sleep_data); - do_custom_fileoperate_service_check_msg( - CUSTOM_FILEOPERATE_MSG_TYPE_SLEEPDATA_SAVE, nullptr, 0); - memset(&sleep_data,0,sizeof(SLEEP_T)); - state_num = 0; - //fall_asleep_state_num = 0; - } - #endif - free(cywee_Inactivity_Accumulate_Time_Info); - cywee_Inactivity_Accumulate_Time_Info = NULL; - //uapi_dev_runtime_set_sleep_status(0); - #endif - } - - //APP运动相关 - void MsgCenterNotifybleAPPtraining(const Topic topic, Request* req) - { - unused(topic); - uint8_t* data=(uint8_t*)req->data; - if(data!=NULL && req->len>=2) - { - switch (data[1]) - { - case START://运动开始 - - break; - case STOP://运动暂停 - - break; - case RECOVER://运动恢复 - - break; - - case END://运动结束 - break; - } - } - - // unused(req); - - } - - - /* 订阅事件通知逻辑可定制 */ - static MsgCenterNotifyTable g_msgCenterNotifyTable[] = { - {TOPIC_EVENT_ALARM_RING, MsgCenterNotifyAlarmProc}, - {TOPIC_EVENT_ON_TIME, MsgCenterNotifyONtimeProc},//增加整点保存数据 - {TOPIC_EVENT_NEXTDAY_UPDATE, MsgCenterNotifyNextDayProc}, - {TOPIC_EVENT_STEPDATA_UPDATE, MsgCenterNotifystepProc}, - - {TOPIC_EVENT_HFP_INCOMMING, MsgCenterNotifyHfpIncomingProc}, - {TOPIC_EVENT_HFP_PHONE_ACTIVE, MsgCenterNotifyHfpPhoneProc}, - {TOPIC_EVENT_HFP_FINISHED, MsgCenterNotifyHfpPhoneProc}, - {TOPIC_EVENT_HFP_WATCH_TO_PHONE, MsgCenterNotifyHfpPhoneProc}, - {TOPIC_EVENT_HFP_WATCH_ACTIVE, MsgCenterNotifyHfpWatchProc}, - {TOPIC_EVENT_HFP_PHONE_TO_WATCH, MsgCenterNotifyHfpWatchProc}, - {TOPIC_EVENT_HFP_HINT, MsgCenterNotifyHfpWatchHintProc}, - - #ifdef SUPPORT_CYWEE_SERVICE - // {TOPIC_EVENT_ACTIVITY_UPDATE, MsgCenterNotifyActivityProc}, - // {TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE, MsgCenterNotifyActivityExtraInfoProc}, - {TOPIC_EVENT_AR_ALERT_TYPE_UPDATE, MsgCenterNotifyArAlertProc}, - {TOPIC_EVENT_INACTIVITY_UPDATE, MsgCenterNotifyInactivityProc}, - // {TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE, MsgCenterNotifyInactivityAccumulateTimeProc}, - #endif - {TOPIC_EVENT_GOAL_SHOW_VIEW, MsgCenterNotifyGoalShowViewProc}, - {TOPIC_EVENT_BLE_TRANSMIT, MsgCenterNotifybleTransmit}, - - {TOPIC_EVENT_CHARGE_PLUG, MsgCenterNotifyChargePlugProc}, - {TOPIC_EVENT_CHARGE_UNPLUG, MsgCenterNotifyChargeUnPlugProc}, - {TOPIC_EVENT_LOWPOWER_ALARM, MsgCenterNotifyLowPowerAlarmProc}, - - #ifdef SUPPORT_CAT1_MODEM - {TOPIC_EVENT_CAT1_INCOMMING, MsgCenterNotifyCatIncomingCallProc}, - {TOPIC_EVENT_CAT1_CALLCONNTED, MsgCenterNotifyCat1CallConnectedProc}, - {TOPIC_EVENT_CAT1_CALLENDED, MsgCenterNotifyCat1CallEndedProc}, - {TOPIC_EVENT_CAT1_CALLDIAL, MsgCenterNotifyCat1dialProc}, - - // {TOPIC_EVENT_CAT1_SIGNAL_UPDATE, MsgCenterNotifyCat1SignalUpdateProc}, - // {TOPIC_EVENT_CAT1_POWER_ON, MsgCenterNotifyCat1PowerOnProc}, - // {TOPIC_EVENT_CAT1_POWER_OFF, MsgCenterNotifyCat1PowerOffProc}, - {TOPIC_EVENT_CAT1_CALL_FAIL, MsgCenterNotifyCat1FailEProc}, - #endif - {TOPIC_EVENT_DEVICE_BIND, MsgCenterNotifyDeviceBindProc}, - {TOPIC_EVENT_FIND_WATCH,MsgCenterNotifyFindWatchProc}, - {TOPIC_EVENT_DRINKREMINDER,MsgCenterNotifyDrinkReminderProc}, - {TOPIC_EVENT_MESSAGENOTE,MsgCenterNotifyMessageProc}, - {TOPIC_EVENT_SLEEPNOTE,MsgCenterNotifySleepProc}, - {TOPIC_EVENT_DEBUGOUTPUT,MsgCenterNotifyDebugOutProc}, - {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,MsgCenterNotifyShutDownAnimatorProc}, - }; - - static MsgCenterNotifyTable *MsgCenterGetNotifyTblCb(uint8_t idx) - { - return &g_msgCenterNotifyTable[idx]; - } - - static uint8_t MsgCenterGetNotifyTblSize(void) - { - return sizeof(g_msgCenterNotifyTable) / sizeof(g_msgCenterNotifyTable[0]); - } - - static void CallVolumeDipSwitchControl(uint16_t notifyId, uint8_t states) - { - VolumeSliderEventListener *volumeSliderEventListener = nullptr; - if (notifyId == TOPIC_EVENT_HFP_WATCH_ACTIVE || - notifyId == TOPIC_EVENT_HFP_PHONE_TO_WATCH) { - if (NotificationManager::GetInstance()->GetVolumeScreenStatus()) { - VolumeSettingView *settingView = GetvolumeSetting(); - if (settingView == nullptr) { - return; - } - volumeSliderEventListener = settingView->GetVolumeEventListener(); - if (volumeSliderEventListener == nullptr) { - return; - } - volumeSliderEventListener->ChangeVolume(static_cast(states)); - } else { - HonrsViewChange(); - NotificationManager::GetInstance()->SetVolumeScreenStatus(true); - } - } - return; - } - - static void OnKeyLongPress(uint16_t keyID) - { - g_longPressFlag = true; // Long press the logo - if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) { // Power button - // After StopNotify, a restart card will pop up first - uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); - if(notifyId == TOPIC_EVENT_ALARM_RING) { - NativeAbility::GetInstance().ChangeSlice(VIEW_REBOOT); - NotificationManager::GetInstance()->SetNativeUIRunning(true); - NotificationManager::GetInstance()->StopNotify(); - } - } else if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_FUNC)) { // Function buttons - // Switch to user configured shortcut card - } - return; - } - - static void HandleKeyPress(uint16_t notifyId) - { - if (notifyId == TOPIC_EVENT_ALARM_RING) { - AlarmClockModel::GetInstance()->AlarmGetClockNum(); - AlarmPopUpPresenter::GetInstance()->DelayAlarmRing(); - NotificationManager::GetInstance()->StopNotify(); - } - } - - static bool PressKeyEvent(uint16_t keyID, uint8_t state) - { - switch (state) { - case InputDevice::STATE_PRESS: - g_pressFlag = true; - return true; - case InputDevice::STATE_LONG_PRESS: - OnKeyLongPress(keyID); - return true; - case InputDevice::STATE_RELEASE: - if (g_longPressFlag) { - g_pressFlag = false; - g_longPressFlag = false; - return true; - } - break; - default: - break; - } - return false; - } - - static bool KeyNotifyCallback(uint16_t keyID, uint8_t state) - { - if (!OHOS::NotificationManager::GetInstance()->HasNotifyShowing()) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Notify does not exist!"); - OHOS::ACELite::KeyInputModule::SetNotifyKeyListener(nullptr); - g_pressFlag = false; - g_longPressFlag = false; - return false; - } - if (PressKeyEvent(keyID, state)) { - return true; - } - uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); - if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) { // Power button - if (NotificationManager::GetInstance()->GetWatchCallStatus()) { // Volume card - // volume+ - CallVolumeDipSwitchControl(notifyId, VOLUMEUP); - } else { - HandleKeyPress(notifyId); - } - } - else if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_FUNC)) { // Function buttons - if (NotificationManager::GetInstance()->GetWatchCallStatus()) { // Volume card - // volume- - CallVolumeDipSwitchControl(notifyId, VOLUMEDOWN); - } else { - // Switch to user configured shortcut card - } - } - g_pressFlag = false; - g_longPressFlag = false; - return true; - } - - bool MsgCenterNotifyProc(const Topic topic, Request* req) - { - uint8_t i; - uint8_t tblSize = MsgCenterGetNotifyTblSize(); - OHOS::ACELite::KeyInputModule::SetNotifyKeyListener(KeyNotifyCallback); - for (i = 0; i < tblSize; i++) { - MsgCenterNotifyTable *item = MsgCenterGetNotifyTblCb(i); - if (item != nullptr && item->topic == topic && item->cb != nullptr) { - item->cb(topic, req); - return true; - } - } - - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: Can not find the cb!"); - 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); - FreeElement(topAbility); - return; - } - FreeElement(topAbility); - // 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); - ClearWant(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); - FreeElement(topAbility); - return; - } - FreeElement(topAbility); - 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"); - FreeElement(elementName); - return; - } - FreeElement(elementName); - 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 - } \ No newline at end of file +#ifdef SUPPORT_CAT1_MODEM + {TOPIC_EVENT_CAT1_INCOMMING, MsgCenterNotifyCatIncomingCallProc}, + {TOPIC_EVENT_CAT1_CALLCONNTED, MsgCenterNotifyCat1CallConnectedProc}, + {TOPIC_EVENT_CAT1_CALLENDED, MsgCenterNotifyCat1CallEndedProc}, + {TOPIC_EVENT_CAT1_CALLDIAL, MsgCenterNotifyCat1dialProc}, + + // {TOPIC_EVENT_CAT1_SIGNAL_UPDATE, MsgCenterNotifyCat1SignalUpdateProc}, + // {TOPIC_EVENT_CAT1_POWER_ON, MsgCenterNotifyCat1PowerOnProc}, + // {TOPIC_EVENT_CAT1_POWER_OFF, MsgCenterNotifyCat1PowerOffProc}, + {TOPIC_EVENT_CAT1_CALL_FAIL, MsgCenterNotifyCat1FailEProc}, +#endif + {TOPIC_EVENT_DEVICE_BIND, MsgCenterNotifyDeviceBindProc}, + {TOPIC_EVENT_FIND_WATCH,MsgCenterNotifyFindWatchProc}, + {TOPIC_EVENT_DRINKREMINDER,MsgCenterNotifyDrinkReminderProc}, + {TOPIC_EVENT_MESSAGENOTE,MsgCenterNotifyMessageProc}, + {TOPIC_EVENT_SLEEPNOTE,MsgCenterNotifySleepProc}, + {TOPIC_EVENT_DEBUGOUTPUT,MsgCenterNotifyDebugOutProc}, + {TOPIC_EVENT_SHUTDOWN_ANIMATIOR,MsgCenterNotifyShutDownAnimatorProc}, +}; + +static MsgCenterNotifyTable *MsgCenterGetNotifyTblCb(uint8_t idx) +{ + return &g_msgCenterNotifyTable[idx]; +} + +static uint8_t MsgCenterGetNotifyTblSize(void) +{ + return sizeof(g_msgCenterNotifyTable) / sizeof(g_msgCenterNotifyTable[0]); +} + +static void CallVolumeDipSwitchControl(uint16_t notifyId, uint8_t states) +{ + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "1201patch合并为编译过屏蔽下方代码"); + #if 0 // 1201patch 为编译过屏蔽 + VolumeSliderEventListener *volumeSliderEventListener = nullptr; + if (notifyId == TOPIC_EVENT_HFP_WATCH_ACTIVE || + notifyId == TOPIC_EVENT_HFP_PHONE_TO_WATCH) { + if (NotificationManager::GetInstance()->GetVolumeScreenStatus()) { + VolumeSettingView *settingView = GetvolumeSetting(); + if (settingView == nullptr) { + return; + } + volumeSliderEventListener = settingView->GetVolumeEventListener(); + if (volumeSliderEventListener == nullptr) { + return; + } + volumeSliderEventListener->ChangeVolume(static_cast(states)); + } else { + HonrsViewChange(); + NotificationManager::GetInstance()->SetVolumeScreenStatus(true); + } + } + return; + #endif +} + +static void OnKeyLongPress(uint16_t keyID) +{ + g_longPressFlag = true; // Long press the logo + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) { // Power button + // After StopNotify, a restart card will pop up first + uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); + if(notifyId == TOPIC_EVENT_ALARM_RING) { + NativeAbility::GetInstance().ChangeSlice(VIEW_REBOOT); + NotificationManager::GetInstance()->SetNativeUIRunning(true); + NotificationManager::GetInstance()->StopNotify(); + } + } else if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_FUNC)) { // Function buttons + // Switch to user configured shortcut card + } + return; +} + +static void HandleKeyPress(uint16_t notifyId) +{ + if (notifyId == TOPIC_EVENT_ALARM_RING) { + AlarmClockModel::GetInstance()->AlarmGetClockNum(); + AlarmPopUpPresenter::GetInstance()->DelayAlarmRing(); + NotificationManager::GetInstance()->StopNotify(); + } +} + +static bool PressKeyEvent(uint16_t keyID, uint8_t state) +{ + switch (state) { + case InputDevice::STATE_PRESS: + g_pressFlag = true; + return true; + case InputDevice::STATE_LONG_PRESS: + OnKeyLongPress(keyID); + return true; + case InputDevice::STATE_RELEASE: + if (g_longPressFlag) { + g_pressFlag = false; + g_longPressFlag = false; + return true; + } + break; + default: + break; + } + return false; +} + +static bool KeyNotifyCallback(uint16_t keyID, uint8_t state) +{ + if (!OHOS::NotificationManager::GetInstance()->HasNotifyShowing()) { + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "Notify does not exist!"); + OHOS::ACELite::KeyInputModule::SetNotifyKeyListener(nullptr); + g_pressFlag = false; + g_longPressFlag = false; + return false; + } + if (PressKeyEvent(keyID, state)) { + return true; + } + uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) { // Power button + if (NotificationManager::GetInstance()->GetWatchCallStatus()) { // Volume card + // volume+ + CallVolumeDipSwitchControl(notifyId, VOLUMEUP); + } else { + HandleKeyPress(notifyId); + } + } + else if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_FUNC)) { // Function buttons + if (NotificationManager::GetInstance()->GetWatchCallStatus()) { // Volume card + // volume- + CallVolumeDipSwitchControl(notifyId, VOLUMEDOWN); + } else { + // Switch to user configured shortcut card + } + } + g_pressFlag = false; + g_longPressFlag = false; + return true; +} + +bool MsgCenterNotifyProc(const Topic topic, Request* req) +{ + uint8_t i; + uint8_t tblSize = MsgCenterGetNotifyTblSize(); + OHOS::ACELite::KeyInputModule::SetNotifyKeyListener(KeyNotifyCallback); + for (i = 0; i < tblSize; i++) { + MsgCenterNotifyTable *item = MsgCenterGetNotifyTblCb(i); + if (item != nullptr && item->topic == topic && item->cb != nullptr) { + item->cb(topic, req); + return true; + } + } + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: Can not find the cb!"); + 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); + FreeElement(topAbility); + return; + } + FreeElement(topAbility); + // 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); + ClearWant(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); + FreeElement(topAbility); + return; + } + FreeElement(topAbility); + 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"); + FreeElement(elementName); + return; + } + FreeElement(elementName); + 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 +} \ No newline at end of file diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/notify/charge_notification.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/notify/charge_notification.cpp index 55b885a82..e7ca83a0f 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/src/notify/charge_notification.cpp +++ b/code/sdk/application/wearable/n9/service/msg_center/src/notify/charge_notification.cpp @@ -607,12 +607,12 @@ namespace OHOS lowppowrViewEventListener::lowppowrViewEventListener() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallViewEventListener :%p", this); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "lowppowrViewEventListener :%p", this); } lowppowrViewEventListener::~lowppowrViewEventListener() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "~CallViewEventListener"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "~lowppowrViewEventListener"); } lowppowrViewEventListener *lowppowrViewEventListener::GetInstance(void) diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/notify/goal_notification.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/notify/goal_notification.cpp index 00436dab8..fdb4aed36 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/src/notify/goal_notification.cpp +++ b/code/sdk/application/wearable/n9/service/msg_center/src/notify/goal_notification.cpp @@ -440,12 +440,12 @@ namespace OHOS GoalViewEventListener::GoalViewEventListener() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallViewEventListener :%p", this); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GoalViewEventListener :%p", this); } GoalViewEventListener::~GoalViewEventListener() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "~CallViewEventListener"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "~GoalViewEventListener"); } GoalViewEventListener *GoalViewEventListener::GetInstance(void) diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/notify/ketinput/src/NotifyOnKeyListener.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/notify/ketinput/src/NotifyOnKeyListener.cpp index 740582bf1..f7661adbb 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/src/notify/ketinput/src/NotifyOnKeyListener.cpp +++ b/code/sdk/application/wearable/n9/service/msg_center/src/notify/ketinput/src/NotifyOnKeyListener.cpp @@ -67,6 +67,7 @@ void NotifyOnKeyListener::OnKeyLongPress(const KeyEvent &event) void NotifyOnKeyListener::CallVolumeDipSwitchControl(uint8_t status) { + #if 0 // 1201patch 为编译过屏蔽 VolumeSliderEventListener *volumeSliderEventListener = nullptr; if (NotificationManager::GetInstance()->GetVolumeScreenStatus()) { VolumeSettingView *settingView = GetvolumeSetting(); @@ -79,10 +80,11 @@ void NotifyOnKeyListener::CallVolumeDipSwitchControl(uint8_t status) } volumeSliderEventListener->ChangeVolume(static_cast(status)); } else { - HonrsViewChange(); + // HonrsViewChange(); NotificationManager::GetInstance()->SetVolumeScreenStatus(true); } return; + #endif } void NotifyOnKeyListener::OnKeyRelease(const KeyEvent &event) diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/notify/makephone_notification.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/notify/makephone_notification.cpp deleted file mode 100644 index 8d3b49283..000000000 --- a/code/sdk/application/wearable/n9/service/msg_center/src/notify/makephone_notification.cpp +++ /dev/null @@ -1,782 +0,0 @@ -/* - * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. - * Description: makephone notification implement - * Author: CompanyName - * Create: 2023-08-11 - */ - -#include "notification_manager.h" -#include "wearable_log.h" -#include "CallerLogModel.h" -#include "PhoneService.h" -#include "cmsis_os.h" -#include "UiConfig.h" -#include "components/ui_image_view.h" -#include "components/ui_label.h" -#include "common/image_cache_manager.h" -#include "VolumeSettingView.h" -#include "VolumeSettingPresenter.h" -#include "ui_resource_image.h" -#include "audio_manager.h" - -namespace OHOS { - -using namespace Audio; -using Audio::AudioManager; - -constexpr int32_t NOTIFY_THREE_SECONDS = 3000; -constexpr int32_t NOTIFY_ONE_SECOND = 1000; -constexpr int32_t NOTIFY_THIRTY_SECONDS = 30000; -constexpr int32_t NOTIFY_ONE_MINUTE = 60000; -constexpr int32_t NOTOFY_NO_OPERATE_TIME = 35000; -int g_changeImage = 0; -osTimerId_t g_callDurationTimer = nullptr; // timer of call duration -osTimerId_t g_callCurrentTime = nullptr; // timer of current time - -static constexpr uint16 MATH_ZERO = 0; - -// 来电显示 -static constexpr uint16 LABEL_PERCENT_POSITION_X = 0; -static constexpr uint16 LABEL_PERCENT_POSITION_Y = 100; -static constexpr uint16 LABEL_COMINGVIEW_POSITION_X = 0; -static constexpr uint16 LABEL_COMINGVIEW_POSITION_Y = 80; -static constexpr uint16 TITLE_LABEL_DEFAULT_HEIGHT = 80; - -// 当前时间 -static constexpr uint16 LABEL_CURREMTTIME_POSITION_X = 0; -static constexpr uint16 LABEL_CURREMTTIME_POSITION_Y = 360; -static constexpr uint16 LABEL_COMINGTIME_POSITION_X = 0; -static constexpr uint16 LABEL_COMINGTIME_POSITION_Y = 340; - -// 图片坐标 -static constexpr uint16 LABEL_CALLERD_POSITION_X = 0; -static constexpr uint16 LABEL_CALLERD_POSITION_Y = 160; -static constexpr uint16 LABEL_NEWCALLERD_POSITION_X = 0; -static constexpr uint16 LABEL_NEWCALLERD_POSITION_Y = 160; -static constexpr uint16 IMAGE_HONRS_POSITION_X = 185; -static constexpr uint16 IMAGE_HONRS_POSITION_Y = 10; -static constexpr uint16 IMAGE_HANDUP_POSITION_X = 70; -static constexpr uint16 IMAGE_MIC_POSITION_X = 280; -static constexpr uint16 IMAGE_DISSGREE_POSITION_X = 80; -static constexpr uint16 IMAGE_AGREEING_POSITION_X = 270; -static constexpr uint16 IMAGE_ALL_POSITION_Y = 240; -static constexpr uint16 IMAGE_HANDUP2_POSITION_X = 177; -static constexpr uint16 IMAGE_HANDUP2_POSITION_Y = 270; - -// 字体大小 -static constexpr uint16 FONT_CURRENT_SIZE = 25; -static constexpr uint16 FONT_CALLER_SIZE = 40; -UIViewGroup* g_phoneView = nullptr; -UIViewGroup* g_multiPhoneView = nullptr; -UIViewGroup* g_callingView = nullptr; -UIViewGroup* g_waitingHintsView = nullptr; -VolumeSettingView *g_volumeSetting = nullptr; -UIImageView* g_imageAgree = nullptr; -UIImageView* g_imageDissgree = nullptr; -UIImageView* g_imageMicrophone = nullptr; -UIImageView* g_imageHandUp = nullptr; -UIImageView* g_imageHorns = nullptr; -UIImageView* g_imageDissgreeNew = nullptr; -UILabel* g_callerNum = nullptr; -UILabel* g_callerDisplay = nullptr; -UILabel* g_callDuration = nullptr; -UILabel* g_currentTimes = nullptr; -UILabel* g_comingTimes = nullptr; -UILabel* g_newCallHints = nullptr; -UILabel* g_newCallNum = nullptr; - -void CallTimerCallBack(int data) -{ - GraphicService::GetInstance()->PostGraphicEvent(std::bind(CallTimerCallBackProc, data)); -} - -void CallTimerCallBackProc(int data) -{ - if (g_callDuration != nullptr) { - g_callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str()); - } -} - -void CallCurTimerCallBack(int data) -{ - if (g_currentTimes != nullptr) { - g_currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); - } -} - -void StartCallTimer(CallTimerType type, int32_t interval) -{ - uint32_t tick; - osStatus_t retTimer; - if (type >= CallTimerType::NOTIFY_PHONE_UNKNOWN) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartCallTimer type:%d invalid!!", type); - return; - } - switch (type) { - case CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY: - g_callDurationTimer = osTimerNew((osTimerFunc_t)CallTimerCallBack, osTimerPeriodic, nullptr, nullptr); - tick = osMs2Tick(interval); - retTimer = osTimerStart(g_callDurationTimer, tick); - if (retTimer != osOK && g_callDurationTimer != nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, - "StartCallTimer osTimerStart failed, type = %d ret = %lx!!", type, retTimer); - osTimerDelete(g_callDurationTimer); - g_callDurationTimer = nullptr; - return; - } - break; - case CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY: - g_callCurrentTime = osTimerNew((osTimerFunc_t)CallCurTimerCallBack, osTimerPeriodic, nullptr, nullptr); - tick = osMs2Tick(interval); - retTimer = osTimerStart(g_callCurrentTime, tick); - if (retTimer != osOK && g_callCurrentTime != nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, - "StartCallTimer osTimerStart failed, type = %d ret = %lx!!", type, retTimer); - osTimerDelete(g_callCurrentTime); - g_callCurrentTime = nullptr; - return; - } - break; - default: - break; - } -} - -void DisableCallTimer(CallTimerType type) -{ - if (type >= CallTimerType::NOTIFY_PHONE_UNKNOWN) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableCallTimer type:%d invalid!!", type); - return; - } - osStatus_t ret; - switch (type) { - case CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY: - if (g_callDurationTimer != nullptr) { - ret = osTimerDelete(g_callDurationTimer); - if (ret != osOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableCallTimer failed, type= %d ret = %lx!", type, ret); - return; - } - g_callDurationTimer = nullptr; - } - break; - case CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY: - if (g_callCurrentTime != nullptr) { - ret = osTimerDelete(g_callCurrentTime); - if (ret != osOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableCallTimer failed, type= %d ret = %lx!", type, ret); - return; - } - g_callCurrentTime = nullptr; - } - break; - default: - break; - } -} - -void HonrsViewChange(void) -{ - if (g_volumeSetting == nullptr) { - g_volumeSetting = new VolumeSettingView(); - if (g_volumeSetting == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makephone_notification::g_volumeSetting nullptr err"); - return; - } - if (!g_volumeSetting->SetUpVolume()) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makephone_notification::g_volumeSetting SetUpVolume fail"); - return; - } - g_volumeSetting->GetProgress()->SetValue( - AudioManager::GetInstance().GetVolume(AUDIO_STREAM_VOICE_CALL_BT_SCO)); - if (AudioManager::GetInstance().GetVolume(AUDIO_STREAM_VOICE_CALL_BT_SCO) == 0) { - ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES); - g_volumeSetting->GetDecreaseButton()->SetImageSrc(image, image); - } - NotificationManager::GetInstance()->screenContainer_->Add(g_volumeSetting); - } - VolumeSliderEventListener *volumeSliderEventListener = g_volumeSetting->GetVolumeEventListener(); - if (volumeSliderEventListener == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makephone_notification::volumeSliderEventListener nullptr err"); - return; - } - - volumeSliderEventListener->SetPlayerCoefficients(VOLUMEPHONENOTIFY); // 进度条系数 - g_volumeSetting->SetVisible(true); - // 刷新UI - RootView::GetInstance()->Invalidate(); -} -VolumeSettingView *GetvolumeSetting(void) -{ - return g_volumeSetting; -} - -static void FreeCallingViewImage(void) -{ - if (g_imageMicrophone != nullptr) { - delete g_imageMicrophone; - g_imageMicrophone = nullptr; - } - if (g_imageHandUp != nullptr) { - delete g_imageHandUp; - g_imageHandUp = nullptr; - } - if (g_imageHorns != nullptr) { - delete g_imageHorns; - g_imageHorns = nullptr; - } -} - -static bool DrawCallingViewImage(void) -{ - g_imageMicrophone = new UIImageView(); - if (g_imageMicrophone == nullptr) { - return false; - } - g_imageMicrophone->SetPosition(IMAGE_MIC_POSITION_X, IMAGE_ALL_POSITION_Y); - g_imageMicrophone->SetSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH); - g_imageMicrophone->SetTouchable(true); - g_imageMicrophone->SetViewId("microphoneChange"); - - g_imageHandUp = new UIImageView(); - if (g_imageHandUp == nullptr) { - FreeCallingViewImage(); - return false; - } - g_imageHandUp->SetPosition(IMAGE_HANDUP_POSITION_X, IMAGE_ALL_POSITION_Y); - g_imageHandUp->SetSrc(PNG_DISSGREE_IMAGE_PATH); - g_imageHandUp->SetTouchable(true); - g_imageHandUp->SetViewId("callingHandUp"); - - g_imageHorns = new UIImageView(); - if (g_imageHorns == nullptr) { - FreeCallingViewImage(); - return false; - } - g_imageHorns->SetPosition(IMAGE_HONRS_POSITION_X, IMAGE_HONRS_POSITION_Y); - g_imageHorns->SetSrc(PNG_SOUNDBUTTON2); - g_imageHorns->SetTouchable(true); - g_imageHorns->SetViewId("volumeSwitch"); - - return true; -} - -static void FreeCallingViewUILabel(void) -{ - if (g_callerDisplay != nullptr) { - delete g_callerDisplay; - g_callerDisplay = nullptr; - } - if (g_callDuration != nullptr) { - delete g_callDuration; - g_callDuration = nullptr; - } - if (g_currentTimes != nullptr) { - delete g_currentTimes; - g_currentTimes = nullptr; - } -} - -static bool DrawCallingViewUILabel(void) -{ - g_callerDisplay = new UILabel(); - if (g_callerDisplay == nullptr) { - return false; - } - g_callerDisplay->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y, - Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - g_callerDisplay->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - g_callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - g_callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER); - g_callerDisplay->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); - g_callerDisplay->SetTextColor(Color::White()); - - g_callDuration = new UILabel(); - if (g_callDuration == nullptr) { - FreeCallingViewUILabel(); - return false; - } - g_callDuration->SetPosition(LABEL_CALLERD_POSITION_X, LABEL_CALLERD_POSITION_Y, - Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - g_callDuration->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - g_callDuration->SetAlign(TEXT_ALIGNMENT_CENTER); - g_callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str()); - g_callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); - g_callDuration->SetTextColor(Color::White()); - - g_currentTimes = new UILabel(); - if (g_currentTimes == nullptr) { - FreeCallingViewUILabel(); - return false; - } - g_currentTimes->SetPosition(LABEL_CURREMTTIME_POSITION_X, LABEL_CURREMTTIME_POSITION_Y, - Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - g_currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - g_currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER); - g_currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); - g_currentTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); - g_currentTimes->SetTextColor(Color::White()); - - return true; -} - -static bool DrawWaitingHintsViewImage(void) -{ - g_imageDissgreeNew = new UIImageView(); - if (g_imageDissgreeNew == nullptr) { - FreeCallingViewImage(); - return false; - } - g_imageDissgreeNew->SetPosition(IMAGE_HANDUP2_POSITION_X, IMAGE_HANDUP2_POSITION_Y); - g_imageDissgreeNew->SetSrc(PNG_DISSGREE_IMAGE_PATH); - g_imageDissgreeNew->SetTouchable(true); - g_imageDissgreeNew->SetViewId("newCallHandUp"); - return true; -} - -static void FreeWaitingHintsViewImage(void) -{ - if (g_imageDissgreeNew != nullptr) { - delete g_imageDissgreeNew; - g_imageDissgreeNew = nullptr; - } -} - -static void FreeWaitingHintsViewLabel(void) -{ - if (g_newCallNum != nullptr) { - delete g_newCallNum; - g_newCallNum = nullptr; - } - if (g_newCallHints != nullptr) { - delete g_newCallHints; - g_newCallHints = nullptr; - } -} - -static bool DrawWaitingHintsViewLabel(void) -{ - g_newCallNum = new UILabel(); - if (g_newCallNum == nullptr) { - return false; - } - g_newCallNum->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y, - Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - g_newCallNum->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - g_newCallNum->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - g_newCallNum->SetAlign(TEXT_ALIGNMENT_CENTER); - g_newCallNum->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); - g_newCallNum->SetTextColor(Color::White()); - - g_newCallHints = new UILabel(); - if (g_newCallHints == nullptr) { - FreeWaitingHintsViewLabel(); - return false; - } - g_newCallHints->SetPosition(LABEL_NEWCALLERD_POSITION_X, LABEL_NEWCALLERD_POSITION_Y, - Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - g_newCallHints->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - g_newCallHints->SetText("新来电"); - g_newCallHints->SetAlign(TEXT_ALIGNMENT_CENTER); - g_newCallHints->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); - g_newCallHints->SetTextColor(Color::White()); - return true; -} - -static void FreePhoneCallViewImage(void) -{ - if (g_imageAgree != nullptr) { - delete g_imageAgree; - g_imageAgree = nullptr; - } - if (g_imageDissgree != nullptr) { - delete g_imageDissgree; - g_imageDissgree = nullptr; - } -} - -static bool DrawPhoneCallViewImage(void) -{ - g_imageAgree = new UIImageView(); - if (g_imageAgree == nullptr) { - return false; - } - g_imageAgree->SetPosition(IMAGE_AGREEING_POSITION_X, IMAGE_ALL_POSITION_Y); - g_imageAgree->SetSrc(PNG_AGREEING_IMAGE_PATH); - g_imageAgree->SetTouchable(true); - g_imageAgree->SetViewId("answer"); - UIView::OnClickListener *clickListener = static_cast\ - (OHOS::CallViewEventListener::GetInstance()); - g_imageAgree->SetOnClickListener(clickListener); - g_imageDissgree = new UIImageView(); - if (g_imageDissgree == nullptr) { - FreePhoneCallViewImage(); - return false; - } - g_imageDissgree->SetPosition(IMAGE_DISSGREE_POSITION_X, IMAGE_ALL_POSITION_Y); - g_imageDissgree->SetSrc(PNG_DISSGREE_IMAGE_PATH); - g_imageDissgree->SetTouchable(true); - g_imageDissgree->SetViewId("displayHandUp"); - g_imageDissgree->SetOnClickListener(clickListener); - return true; -} - -static void FreePhoneCallViewLabel(void) -{ - if (g_callerNum != nullptr) { - delete g_callerNum; - g_callerNum = nullptr; - } - if (g_comingTimes != nullptr) { - delete g_comingTimes; - g_comingTimes = nullptr; - } -} - -static bool DrawPhoneCallViewLabel(void) -{ - g_callerNum = new UILabel(); - if (g_callerNum == nullptr) { - return false; - } - g_callerNum->SetPosition(LABEL_COMINGVIEW_POSITION_X, LABEL_COMINGVIEW_POSITION_Y, - Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - g_callerNum->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "CreatePhoneCallView phonenum:%s!", - CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - g_callerNum->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - g_callerNum->SetAlign(TEXT_ALIGNMENT_CENTER); - g_callerNum->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); - g_callerNum->SetTextColor(Color::White()); - - g_comingTimes = new UILabel(); - if (g_comingTimes == nullptr) { - FreePhoneCallViewLabel(); - return false; - } - g_comingTimes->SetPosition(LABEL_COMINGTIME_POSITION_X, LABEL_COMINGTIME_POSITION_Y, - Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - g_comingTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - g_comingTimes->SetAlign(TEXT_ALIGNMENT_CENTER); - g_comingTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); - g_comingTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); - g_comingTimes->SetTextColor(Color::White()); - return true; -} - -UIViewGroup* CreatePhoneCallView(void) -{ - g_phoneView = new UIViewGroup(); - if (g_phoneView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreatePhoneCallView g_phoneView null!"); - return nullptr; - } - g_phoneView->SetPosition(MATH_ZERO, MATH_ZERO); - g_phoneView->SetWidth(Screen::GetInstance().GetWidth()); - g_phoneView->SetHeight(Screen::GetInstance().GetHeight()); - if (!DrawPhoneCallViewImage()) { - delete g_phoneView; - g_phoneView = nullptr; - return nullptr; - } - if (!DrawPhoneCallViewLabel()) { - FreePhoneCallViewImage(); - delete g_phoneView; - g_phoneView = nullptr; - return nullptr; - } - g_phoneView->Add(g_imageAgree); - g_phoneView->Add(g_imageDissgree); - g_phoneView->Add(g_callerNum); - g_phoneView->Add(g_comingTimes); - g_phoneView->SetDraggable(true); - g_phoneView->SetTouchable(true); - NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreePhoneCallView); - return g_phoneView; -} - -void FreePhoneCallView(void) -{ - if (g_phoneView != nullptr) { - g_phoneView->RemoveAll(); - FreePhoneCallViewImage(); - FreePhoneCallViewLabel(); - RootView::GetInstance()->Remove(g_phoneView); - delete g_phoneView; - g_phoneView = nullptr; - } -} - -UIViewGroup* CreateMultiplePhoneView(void) -{ - g_multiPhoneView = new UIViewGroup(); - if (g_multiPhoneView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateMultiplePhoneView g_multiPhoneView null!"); - return nullptr; - } - g_multiPhoneView->SetPosition(MATH_ZERO, MATH_ZERO); - g_multiPhoneView->SetWidth(Screen::GetInstance().GetWidth()); - g_multiPhoneView->SetHeight(Screen::GetInstance().GetHeight()); - if (!DrawCallingViewImage()) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateMultiplePhoneView create image error!"); - delete g_multiPhoneView; - g_multiPhoneView = nullptr; - return nullptr; - } - if (!DrawCallingViewUILabel()) { - FreeCallingViewImage(); - delete g_multiPhoneView; - g_multiPhoneView = nullptr; - return nullptr; - } - g_callerDisplay->SetText("正在通话"); - g_callDuration->SetText(""); - g_multiPhoneView->Add(g_imageMicrophone); - g_multiPhoneView->Add(g_imageHandUp); - g_multiPhoneView->Add(g_imageHorns); - g_multiPhoneView->Add(g_callerDisplay); - g_multiPhoneView->Add(g_callDuration); - g_multiPhoneView->Add(g_currentTimes); - g_multiPhoneView->SetDraggable(true); - g_multiPhoneView->SetTouchable(true); - UIView::OnClickListener *clickListener = static_cast\ - (OHOS::CallViewEventListener::GetInstance()); - g_imageMicrophone->SetOnClickListener(clickListener); - g_imageHandUp->SetOnClickListener(clickListener); - g_imageHorns->SetOnClickListener(clickListener); - StartCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY, NOTIFY_THIRTY_SECONDS); - NotificationManager::GetInstance()->SetVolumeScreenStatus(false); - NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeMultiplePhoneCallView); - return g_multiPhoneView; -} - -void FreeMultiplePhoneCallView(void) -{ - if (g_multiPhoneView != nullptr) { - DisableCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY); - g_multiPhoneView->RemoveAll(); - FreeCallingViewImage(); - FreeCallingViewUILabel(); - RootView::GetInstance()->Remove(g_multiPhoneView); - delete g_multiPhoneView; - g_multiPhoneView = nullptr; - } - if (g_volumeSetting != nullptr) { - delete g_volumeSetting; - g_volumeSetting = nullptr; - } -} - -UIViewGroup* CreateCallingView(void) -{ - g_callingView = new UIViewGroup(); - if (g_callingView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateCallingView g_callingView null!"); - return nullptr; - } - g_callingView->SetPosition(MATH_ZERO, MATH_ZERO); - g_callingView->SetWidth(Screen::GetInstance().GetWidth()); - g_callingView->SetHeight(Screen::GetInstance().GetHeight()); - if (!DrawCallingViewImage()) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateCallingView create image error!"); - delete g_callingView; - g_callingView = nullptr; - return nullptr; - } - if (!DrawCallingViewUILabel()) { - FreeCallingViewImage(); - delete g_callingView; - g_callingView = nullptr; - return nullptr; - } - g_callingView->Add(g_imageMicrophone); - g_callingView->Add(g_imageHandUp); - g_callingView->Add(g_imageHorns); - g_callingView->Add(g_callerDisplay); - g_callingView->Add(g_callDuration); - g_callingView->Add(g_currentTimes); - g_callingView->SetDraggable(true); - g_callingView->SetTouchable(true); - UIView::OnClickListener *clickListener = static_cast\ - (OHOS::CallViewEventListener::GetInstance()); - g_imageMicrophone->SetOnClickListener(clickListener); - g_imageHandUp->SetOnClickListener(clickListener); - g_imageHorns->SetOnClickListener(clickListener); - StartCallTimer(CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY, NOTIFY_ONE_SECOND); - StartCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY, NOTIFY_THIRTY_SECONDS); - NotificationManager::GetInstance()->SetVolumeScreenStatus(false); - NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeCallingView); - return g_callingView; -} - -void FreeCallingView(void) -{ - if (g_callingView != nullptr) { - DisableCallTimer(CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY); - DisableCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY); - g_callingView->RemoveAll(); - FreeCallingViewImage(); - FreeCallingViewUILabel(); - RootView::GetInstance()->Remove(g_callingView); - delete g_callingView; - g_callingView = nullptr; - } - if (g_volumeSetting != nullptr) { - delete g_volumeSetting; - g_volumeSetting = nullptr; - } -} - -UIViewGroup* CreateWaitingHintsView(void) -{ - g_waitingHintsView = new UIViewGroup(); - if (g_waitingHintsView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateWaitingHintsView g_waitingHintsView null!"); - return nullptr; - } - g_waitingHintsView->SetPosition(MATH_ZERO, MATH_ZERO); - g_waitingHintsView->SetWidth(Screen::GetInstance().GetWidth()); - g_waitingHintsView->SetHeight(Screen::GetInstance().GetHeight()); - if (!DrawWaitingHintsViewImage()) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateWaitingHintsView create image error!"); - delete g_waitingHintsView; - g_waitingHintsView = nullptr; - return nullptr; - } - if (!DrawWaitingHintsViewLabel()) { - FreeWaitingHintsViewImage(); - delete g_waitingHintsView; - g_waitingHintsView = nullptr; - return nullptr; - } - g_waitingHintsView->Add(g_imageDissgreeNew); - g_waitingHintsView->Add(g_newCallNum); - g_waitingHintsView->Add(g_newCallHints); - g_waitingHintsView->SetDraggable(true); - g_waitingHintsView->SetTouchable(true); - UIView::OnClickListener *clickListener = static_cast\ - (OHOS::CallViewEventListener::GetInstance()); - g_imageDissgreeNew->SetOnClickListener(clickListener); - NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeWaitingHintsView); - return g_waitingHintsView; -} - -void FreeWaitingHintsView(void) -{ - if (g_waitingHintsView != nullptr) { - g_waitingHintsView->RemoveAll(); - FreeWaitingHintsViewImage(); - FreeWaitingHintsViewLabel(); - RootView::GetInstance()->Remove(g_waitingHintsView); - delete g_waitingHintsView; - g_waitingHintsView = nullptr; - } -} - -void RefreshMicrophoneImageSrc(const char* src) -{ - g_imageMicrophone->SetSrc(src); -} - -void EnableWaitingView(void) -{ - if (g_waitingHintsView == nullptr) { - CreateWaitingHintsView(); - } - if (NotificationManager::GetInstance()->screenContainer_ != nullptr) { - NotificationManager::GetInstance()->screenContainer_->SetVisible(false); - } - RootView::GetInstance()->Add(g_waitingHintsView); - g_waitingHintsView->SetVisible(true); - RootView::GetInstance()->Invalidate(); -} - -void DisableWatingView(void) -{ - if (g_waitingHintsView != nullptr) { - g_waitingHintsView->SetVisible(false); - FreeWaitingHintsView(); - if (NotificationManager::GetInstance()->screenContainer_ != nullptr) { - NotificationManager::GetInstance()->screenContainer_->SetVisible(true); - } - RootView::GetInstance()->Invalidate(); - } -} - -bool HintsHandupClick(void) -{ - if (RejectIncomingCall() != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[HintsHandupClick] RejectIncomingCall error"); - return false; - } - CallerLogModel::GetInstance()->SetWaitingStatus(false); - CallerLogModel::GetInstance()->SetCallStatus(true); - - return true; -} - -CallViewEventListener::CallViewEventListener() -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallViewEventListener :%p", this); -} - -CallViewEventListener::~CallViewEventListener() -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "~CallViewEventListener"); -} - -CallViewEventListener *CallViewEventListener::GetInstance(void) -{ - static CallViewEventListener callViewEventListener; - return &callViewEventListener; -} - -bool CallViewEventListener::OnClick(UIView& view, const ClickEvent& event) -{ - UNUSED(event); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MakephoneNotify ClickListener %s", view.GetViewId()); - if (strcmp(view.GetViewId(), "answer") == 0) { - // watch answer the call - if (AcceptIncomingCall() != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AcceptIncomingCall() fail"); - return false; - } - return true; - } else if (strcmp(view.GetViewId(), "displayHandUp") == 0 || - strcmp(view.GetViewId(), "callingHandUp") == 0) { - if (strcmp(view.GetViewId(), "displayHandUp") == 0) { - // The watch rejects the call - if (RejectIncomingCall() != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RejectIncomingCall() fail"); - return false; - } - } - if (FinishCall() != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FinishCall() fail"); - return false; - } - return true; - } else if (strcmp(view.GetViewId(), "microphoneChange") == 0) { - if (g_changeImage == 0) { - g_changeImage = 1; - RefreshMicrophoneImageSrc(PNG_MICROPHONE_CLOSE_IMAGE_PATH); - SetMicMute(true); - } else { - g_changeImage = 0; - RefreshMicrophoneImageSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH); - SetMicMute(false); - } - return true; - } else if (strcmp(view.GetViewId(), "volumeSwitch") == 0) { - HonrsViewChange(); - } else if (strcmp(view.GetViewId(), "newCallHandUp") == 0) { - if (!HintsHandupClick()) { - return false; - } - } - if (strcmp(view.GetViewId(), "SOS_FAIL") == 0) { - NotificationManager::GetInstance()->StopNotify(); - } - return true; -} -} // namespace OHOS diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp index 27a529f34..ddc3e8fea 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp +++ b/code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp @@ -495,8 +495,8 @@ UIViewGroup* SOS_cant_dial(void) alarm_labelbutton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 44); alarm_labelbutton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - UIView::OnClickListener *button1Click = static_cast(CallViewEventListener::GetInstance()); - alarm_labelbutton->SetOnClickListener(button1Click); + // UIView::OnClickListener *button1Click = static_cast(CallViewEventListener::GetInstance()); + // alarm_labelbutton->SetOnClickListener(button1Click); SOSView->Add(alarm_labelbutton); alarm_labelbutton->SetVisible(true); diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/notify/transmitting.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/notify/transmitting.cpp index e83fa686c..99d7af5fc 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/src/notify/transmitting.cpp +++ b/code/sdk/application/wearable/n9/service/msg_center/src/notify/transmitting.cpp @@ -1557,12 +1557,12 @@ namespace OHOS transmittingViewEventListener::transmittingViewEventListener() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallViewEventListener :%p", this); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "transmittingViewEventListener :%p", this); } transmittingViewEventListener::~transmittingViewEventListener() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "~CallViewEventListener"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "~transmittingViewEventListener"); } transmittingViewEventListener *transmittingViewEventListener::GetInstance(void) diff --git a/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_recorder.a b/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_recorder.a index 65bfe53bb..514c229d8 100644 Binary files a/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_recorder.a and b/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_recorder.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230-r/libgfx_rm.a deleted file mode 100644 index a73130193..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230-r/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230/libgfx_rm.a deleted file mode 100644 index 7337ef01e..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230_user-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230_user-r/libgfx_rm.a deleted file mode 100644 index a73130193..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230_user-r/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230_user/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230_user/libgfx_rm.a deleted file mode 100644 index 7337ef01e..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd230_user/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd272-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd272-r/libgfx_rm.a deleted file mode 100644 index a73130193..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd272-r/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd272/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd272/libgfx_rm.a deleted file mode 100644 index 7337ef01e..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-fd272/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ln-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ln-r/libgfx_rm.a deleted file mode 100644 index a73130193..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ln-r/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ln/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ln/libgfx_rm.a deleted file mode 100644 index 7337ef01e..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-ln/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-lnppp-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-lnppp-r/libgfx_rm.a deleted file mode 100644 index a73130193..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-lnppp-r/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-lnppp/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-lnppp/libgfx_rm.a deleted file mode 100644 index 7337ef01e..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-lnppp/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9-r/libgfx_rm.a index a73130193..6977fba9c 100644 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9-r/libgfx_rm.a and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9-r/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9ln-r/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9ln-r/libgfx_rm.a deleted file mode 100644 index a73130193..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9ln-r/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9ln/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9ln/libgfx_rm.a deleted file mode 100644 index 7337ef01e..000000000 Binary files a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-n9ln/libgfx_rm.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace.a deleted file mode 100644 index e807091dc..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace_http.a deleted file mode 100644 index cdfdb3135..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libace_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libnetstack_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libnetstack_http.a deleted file mode 100644 index b9c1bb00b..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libnetstack_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libwebsocket.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libwebsocket.a deleted file mode 100644 index 8dfa5e251..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230/libwebsocket.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libace.a deleted file mode 100644 index e807091dc..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libace.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libace_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libace_http.a deleted file mode 100644 index cdfdb3135..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libace_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libnetstack_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libnetstack_http.a deleted file mode 100644 index b9c1bb00b..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libnetstack_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libwebsocket.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libwebsocket.a deleted file mode 100644 index 8dfa5e251..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd230_user/libwebsocket.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libace.a deleted file mode 100644 index e807091dc..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libace.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libace_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libace_http.a deleted file mode 100644 index cdfdb3135..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libace_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libnetstack_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libnetstack_http.a deleted file mode 100644 index b9c1bb00b..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libnetstack_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libwebsocket.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libwebsocket.a deleted file mode 100644 index 8dfa5e251..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-fd272/libwebsocket.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libace.a deleted file mode 100644 index e807091dc..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libace.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libace_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libace_http.a deleted file mode 100644 index cdfdb3135..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libace_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libnetstack_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libnetstack_http.a deleted file mode 100644 index b9c1bb00b..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libnetstack_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libwebsocket.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libwebsocket.a deleted file mode 100644 index 8dfa5e251..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-ln/libwebsocket.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libace.a deleted file mode 100644 index e807091dc..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libace.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libace_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libace_http.a deleted file mode 100644 index cdfdb3135..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libace_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libnetstack_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libnetstack_http.a deleted file mode 100644 index b9c1bb00b..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libnetstack_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libwebsocket.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libwebsocket.a deleted file mode 100644 index 8dfa5e251..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-lnppp/libwebsocket.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libace.a deleted file mode 100644 index e807091dc..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libace.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libace_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libace_http.a deleted file mode 100644 index cdfdb3135..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libace_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libnetstack_http.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libnetstack_http.a deleted file mode 100644 index b9c1bb00b..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libnetstack_http.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libwebsocket.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libwebsocket.a deleted file mode 100644 index 8dfa5e251..000000000 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-n9ln/libwebsocket.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230/libjerryscript.a deleted file mode 100644 index bafd4fc5f..000000000 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230/libjerryscript.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230_user/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230_user/libjerryscript.a deleted file mode 100644 index bafd4fc5f..000000000 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd230_user/libjerryscript.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd272/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd272/libjerryscript.a deleted file mode 100644 index bafd4fc5f..000000000 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-fd272/libjerryscript.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-ln/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-ln/libjerryscript.a deleted file mode 100644 index bafd4fc5f..000000000 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-ln/libjerryscript.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-lnppp/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-lnppp/libjerryscript.a deleted file mode 100644 index bafd4fc5f..000000000 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-lnppp/libjerryscript.a and /dev/null differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-n9/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-n9/libjerryscript.a index bafd4fc5f..82e598eb4 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-n9/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-n9/libjerryscript.a differ