#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();
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;
}
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;
}
}
}
+
extern "C"
{
uint32_t mcu_pm_lcd_on(uint8_t *para, uint32_t para_len);
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) // 如果当前页面不是主表盘,如果屏幕亮起,则先处理闹钟通知再切换到主表盘页面
{
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) // 如果当前页面不是主表盘,如果屏幕亮起,则先处理闹钟通知再切换到主表盘页面。
{