Skip to content

Commit

Permalink
#7 clear notification on reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Oct 19, 2015
1 parent dc32423 commit 952009e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/android/notification/Notification.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ public void schedule() {
context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);

if (isRepeating()) {
if (wasInThePast()) {
triggerTime = System.currentTimeMillis();
}

getAlarmMgr().setRepeating(AlarmManager.RTC_WAKEUP,
triggerTime, options.getRepeatInterval(), pi);
} else {
Expand Down
9 changes: 5 additions & 4 deletions src/android/notification/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,11 @@ public Date getTriggerDate() {
* Trigger date in milliseconds.
*/
public long getTriggerTime() {
return Math.max(
System.currentTimeMillis(),
options.optLong("at", 0) * 1000
);
// return Math.max(
// System.currentTimeMillis(),
// options.optLong("at", 0) * 1000
// );
return options.optLong("at", 0) * 1000;
}

/**
Expand Down

0 comments on commit 952009e

Please sign in to comment.