From: luozheng <1732036298@qq.com> Date: Wed, 29 May 2024 06:56:57 +0000 (+0800) Subject: key 文件夹优化更新 X-Git-Tag: release_V1.2.70_20241020_135402~1078 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=978497ffe4ef5d8351ae1da151c4377688b3d9f3;p=mirrors%2FFD230.git key 文件夹优化更新 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/key/src/KeyInputListener.cpp b/code/sdk/application/wearable/fd230app/nativeui/key/src/KeyInputListener.cpp index 726f17111..8ea443029 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/key/src/KeyInputListener.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/key/src/KeyInputListener.cpp @@ -23,22 +23,6 @@ #include "DialViewGroup.h" namespace OHOS { - static bool IsCallingNotify() - { - uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); - if (NotificationManager::GetInstance()->HasNotifyShowing() == true && - (notifyId == TOPIC_EVENT_HFP_INCOMMING || - notifyId == TOPIC_EVENT_HFP_WATCH_ACTIVE || - notifyId == TOPIC_EVENT_HFP_PHONE_TO_WATCH)) - { - return true; - } - else - { - return false; - } - } - static bool IsNotifyCallStatus() { uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); @@ -91,8 +75,12 @@ namespace OHOS void KeyInputListener::CallVolumeDipSwitchControl(VolumeChangeStatus status) { if (MainCallingPresenter::GetInstance() != nullptr && CallerLogModel::GetInstance()->GetCallStatus()) { - if (CallerLogModel::GetInstance()->GetVolumeScreenStatus() == true) { - volumeSliderEventListener = VolumeSliderEventListener::GetInstance(); + if (CallerLogModel::GetInstance()->GetVolumeScreenStatus()) { + VolumeSettingView *settingView = MainCallingPresenter::GetInstance()->GetvolumeSetting(); + if (settingView == nullptr) { + return; + } + volumeSliderEventListener = settingView->GetVolumeEventListener(); if (volumeSliderEventListener == nullptr) { return; } @@ -102,9 +90,13 @@ void KeyInputListener::CallVolumeDipSwitchControl(VolumeChangeStatus status) CallerLogModel::GetInstance()->SetVolumeScreenStatus(true); } } - if (IsNotifyCallStatus() == true) { - if (NotificationManager::GetInstance()->GetVolumeScreenStatus() == true) { - volumeSliderEventListener = VolumeSliderEventListener::GetInstance(); + if (IsNotifyCallStatus()) { + if (NotificationManager::GetInstance()->GetVolumeScreenStatus()) { + VolumeSettingView *settingView = GetvolumeSetting(); + if (settingView == nullptr) { + return; + } + volumeSliderEventListener = settingView->GetVolumeEventListener(); if (volumeSliderEventListener == nullptr) { return; } @@ -116,6 +108,7 @@ void KeyInputListener::CallVolumeDipSwitchControl(VolumeChangeStatus status) } } + extern "C" { uint32_t mcu_pm_lcd_on(uint8_t *para, uint32_t para_len); @@ -132,9 +125,10 @@ void KeyInputListener::CallVolumeDipSwitchControl(VolumeChangeStatus status) if (longPressFlag == 0 && pressFlag == 1) { // 如果当前页面是音量卡片或正在通话中,则执行音量+操作 - if (currentViewId == VIEW_INCOMING_CALL || IsCallingNotify() == true) // 音量卡片 - { - CallVolumeDipSwitchControl(VOLUMEUP); // 音量+ + if (currentViewId == VIEW_INCOMING_CALL || + NotificationManager::GetInstance()->GetWatchCallStatus()) { // 音量卡片 + // 音量+ + CallVolumeDipSwitchControl(VOLUMEUP); } else if (currentViewId != VIEW_MAIN) // 如果当前页面不是主表盘,如果屏幕亮起,则先处理闹钟通知再切换到主表盘页面 { @@ -167,9 +161,10 @@ void KeyInputListener::CallVolumeDipSwitchControl(VolumeChangeStatus status) if (longPressFlag == 0 && pressFlag == 1) { // 如果当前页面是音量卡片或正在通话中,则执行音量减操作 - if (currentViewId == VIEW_INCOMING_CALL || IsCallingNotify() == true) // 音量卡片 - { - CallVolumeDipSwitchControl(VOLUMEDOWN); // 音量- + if (currentViewId == VIEW_INCOMING_CALL || + NotificationManager::GetInstance()->GetWatchCallStatus()) { // 音量卡片 + // 音量- + CallVolumeDipSwitchControl(VOLUMEDOWN); } else if (currentViewId != VIEW_MAIN) // 如果当前页面不是主表盘,如果屏幕亮起,则先处理闹钟通知再切换到主表盘页面。 {