\r
void UpdateAlarmInfoByAppSet(void);\r
void CancelAlarmRing();\r
+ void DelayAlarmRing();\r
\r
private:\r
void SetAlarmId(uint8_t id);\r
}
}
+void AlarmClockModel::DelayAlarmRing()
+{
+ uint8_t alarmId = 0;
+ bool alarmStatus;
+ alarmStatus = AlarmClockModel::GetInstance()->GetListenClockId(&alarmId);
+ if (!alarmStatus) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::DelayAlarmRing get alarm Id false!");
+ return;
+ }
+ AlarmClockModel::GetInstance()->SetDelayAlarm(alarmId);
+}
+
bool AlarmPlayerListener::IsPaused()
{
return isPaused_;
uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId();
if (NotificationManager::GetInstance()->HasNotifyShowing() && notifyId == TOPIC_EVENT_ALARM_RING)
{
- AlarmClockModel::GetInstance()->AlarmGetClockNum();
- AlarmPopUpPresenter::GetInstance()->DelayAlarmRing();
- NotificationManager::GetInstance()->StopNotify();
+ // AlarmClockModel::GetInstance()->AlarmGetClockNum();
+ // AlarmPopUpPresenter::GetInstance()->DelayAlarmRing();
+ // NotificationManager::GetInstance()->StopNotify();
+ return;
}
}
AlarmViewEventListener();
virtual ~AlarmViewEventListener();
static AlarmViewEventListener *GetInstance(void);
+ void PopAlarmRing();
+ void CancelAlarmRing();
+ void DelayAlarmRing();
bool OnDrag(UIView& view, const DragEvent& event) override;
bool OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) override;
bool OnClick(OHOS::UIView& view, const OHOS::ClickEvent& event) override;
// The alarm notification is not displayed if the incoming call notification is already being processed
if (CheckPriority(topic)) {
// AlarmClockModel::GetInstance()->PopInterPlayMusic();
- FindWatchViewEventListener::GetInstance().PopInterPlayMusic("/music/ring/alarm.mp3");//播放铃声
+ AlarmViewEventListener::GetInstance()->PopAlarmRing();
NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
NotificationManager::GetInstance()->ShowNotify(ShowAlarmNotify, static_cast<uint16_t>(topic), true);
} else {
// just delay the alarm
WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "just delay the alarm");
- AlarmClockModel::GetInstance()->AlarmGetClockNum();
- AlarmPopUpPresenter::GetInstance()->DelayAlarmRing();
+ // AlarmClockModel::GetInstance()->AlarmGetClockNum();
+ // AlarmPopUpPresenter::GetInstance()->DelayAlarmRing();
+ AlarmViewEventListener::GetInstance()->DelayAlarmRing();
}
}
return;
}
SetMicMute(false);
- AlarmClockModel::GetInstance()->AlarmPlayerStop();
+ // AlarmClockModel::GetInstance()->AlarmPlayerStop()
+ AlarmViewEventListener::GetInstance()->CancelAlarmRing();
NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE);
cat1_phone_state_change_cb(OPERATE_WATCH_ACTIVE);
CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1);
unused(topic);
unused(req);
// just stop the notify
- AlarmClockModel::GetInstance()->AlarmPlayerStop();
+ // AlarmClockModel::GetInstance()->AlarmPlayerStop();
+ AlarmViewEventListener::GetInstance()->CancelAlarmRing();
if(!NotificationManager::GetInstance()->GetWatchCallStatus())
{
return;
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NoOperateCallback popalarm_time = %d",popalarm_time);
if (popalarm_time <= 0)
{
- DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING);
- // AlarmPopUpPresenter::GetInstance()->CancelAlarmRing();
- AlarmClockModel::GetInstance()->CancelAlarmRing();
- FindWatchViewEventListener::GetInstance().PopInterCancelMusic();
- NotificationManager::GetInstance()->StopNotify();
+ AlarmViewEventListener::GetInstance()->CancelAlarmRing();
}
else
{
if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT)
{
if (strcmp(view.GetViewId(), ALARM_VIEW_POPUP) == 0)
- {
- DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING);
- AlarmClockModel::GetInstance()->CancelAlarmRing();
- FindWatchViewEventListener::GetInstance().PopInterCancelMusic();
- NotificationManager::GetInstance()->StopNotify();
+ {
+ CancelAlarmRing();
}
}
return true;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlamNotify ClickListener %s", view.GetViewId());
if (strcmp(view.GetViewId(), ALARM_IMAGE_STOP) == 0) // 点击停止闹钟响铃
{
- DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING);
// AlarmPopUpPresenter::GetInstance()->CancelAlarmRing();
- AlarmClockModel::GetInstance()->CancelAlarmRing();
- FindWatchViewEventListener::GetInstance().PopInterCancelMusic();
- NotificationManager::GetInstance()->StopNotify();
+ CancelAlarmRing();
}
return true;
}
+
+ void AlarmViewEventListener::PopAlarmRing()
+ {
+ FindWatchViewEventListener::GetInstance().PopInterPlayMusic("/music/ring/alarm.mp3");//播放铃声
+ }
+
+ void AlarmViewEventListener::CancelAlarmRing()
+ {
+ DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING);
+ FindWatchViewEventListener::GetInstance().PopInterCancelMusic();
+ AlarmClockModel::GetInstance()->CancelAlarmRing();
+ NotificationManager::GetInstance()->StopNotify();
+ }
+
+ void AlarmViewEventListener::DelayAlarmRing()
+ {
+ CancelAlarmRing();//先取消闹铃
+ AlarmClockModel::GetInstance()->AlarmGetClockNum();
+ AlarmClockModel::GetInstance()->DelayAlarmRing();
+ }
} // namespace OHOS