for (int i = 0; i < count; i++) {
std::shared_ptr<CalAlertNotificationItem> alertItem = __alertData->getAt(i);
if (alertItem) {
+ if (alertItem->isSnoozed()) {
+ __unscheduleEvent(alertItem);
+ }
+ __scheduleEvent(alertItem);
alertItem->setSnoozed(true);
- __snooze(alertItem);
}
}
CalStatusBarManager::getInstance().update(__alertData);
return;
}
- __snooze(alertItem);
+ if (alertItem->isSnoozed()) {
+ __unscheduleEvent(alertItem);
+ }
+ __scheduleEvent(alertItem);
alertItem->setSnoozed(true);
CalStatusBarManager::getInstance().update(__alertData);
}
for (int i = 0; i < count; i++) {
std::shared_ptr<CalAlertNotificationItem> alertItem = __alertData->getAt(i);
if (alertItem->isSnoozed()) {
- __dismiss(alertItem);
+ __unscheduleEvent(alertItem);
}
}
__alertData->clear();
}
if (alertItem->isSnoozed()) {
- __dismiss(alertItem);
+ __unscheduleEvent(alertItem);
}
__alertData->remove(nth);
{
WENTER();
for (auto nth : nths) {
+ std::shared_ptr<CalAlertNotificationItem> alertItem = __alertData->getAt(nth);
+ if (alertItem->isSnoozed()) {
+ __unscheduleEvent(alertItem);
+ }
+
__alertData->remove(nth);
}
CalStatusBarManager::getInstance().update(__alertData);
return min;
}
-void CalAlertModel::__snooze(std::shared_ptr<CalAlertNotificationItem> &item)
+void CalAlertModel::__scheduleEvent(std::shared_ptr<CalAlertNotificationItem> &item)
{
WENTER();
WDEBUG("index[%d]", item->getScheduleId());
app_control_destroy(service);
}
-void CalAlertModel::__dismiss(std::shared_ptr<CalAlertNotificationItem> &item)
+void CalAlertModel::__unscheduleEvent(std::shared_ptr<CalAlertNotificationItem> &item)
{
WENTER();
int alarmId = item->getAlarmId();
private:
WDISABLE_COPY_AND_ASSIGN(CalAlertModel);
- void __snooze(std::shared_ptr<CalAlertNotificationItem> &item);
- void __dismiss(std::shared_ptr<CalAlertNotificationItem> &item);
+ void __scheduleEvent(std::shared_ptr<CalAlertNotificationItem> &item);
+ void __unscheduleEvent(std::shared_ptr<CalAlertNotificationItem> &item);
std::shared_ptr<CalAlertData> __alertData;
};