Loading android/app/src/com/android/bluetooth/notification/NotificationHelperService.java +6 −2 Original line number Diff line number Diff line Loading @@ -172,15 +172,18 @@ public class NotificationHelperService extends Service { // The notification is always displayed the first time and if it has been at least…: // * … 1 week since the first display (aka recurring only once) // * … 6 months since the last display (aka recurring forever) // // Comparison is +/- 1 hour, allowing for both battery optimisation and consistency if (date != null) { savedDate = LocalDateTime.parse(date); if ((countShown == 1 && now.isBefore(savedDate.plusWeeks(1))) || now.isBefore(savedDate.plusMonths(6))) { if ((countShown != 1 && now.isBefore(savedDate.plusMonths(6).minusHours(1))) || now.isBefore(savedDate.plusWeeks(1).minusHours(1))) { Log.i( TAG, ("shouldDisplayNotification(" + countKey + "): Notification discarded.") + (" countShown=" + countShown) + (" now=" + now) + (" savedDate=" + savedDate)); return false; } Loading @@ -193,6 +196,7 @@ public class NotificationHelperService extends Service { TAG, ("shouldDisplayNotification(" + countKey + "): Notification is being shown.") + (" countShown=" + countShown) + (" now=" + now) + (" savedDate=" + savedDate)); return true; } Loading Loading
android/app/src/com/android/bluetooth/notification/NotificationHelperService.java +6 −2 Original line number Diff line number Diff line Loading @@ -172,15 +172,18 @@ public class NotificationHelperService extends Service { // The notification is always displayed the first time and if it has been at least…: // * … 1 week since the first display (aka recurring only once) // * … 6 months since the last display (aka recurring forever) // // Comparison is +/- 1 hour, allowing for both battery optimisation and consistency if (date != null) { savedDate = LocalDateTime.parse(date); if ((countShown == 1 && now.isBefore(savedDate.plusWeeks(1))) || now.isBefore(savedDate.plusMonths(6))) { if ((countShown != 1 && now.isBefore(savedDate.plusMonths(6).minusHours(1))) || now.isBefore(savedDate.plusWeeks(1).minusHours(1))) { Log.i( TAG, ("shouldDisplayNotification(" + countKey + "): Notification discarded.") + (" countShown=" + countShown) + (" now=" + now) + (" savedDate=" + savedDate)); return false; } Loading @@ -193,6 +196,7 @@ public class NotificationHelperService extends Service { TAG, ("shouldDisplayNotification(" + countKey + "): Notification is being shown.") + (" countShown=" + countShown) + (" now=" + now) + (" savedDate=" + savedDate)); return true; } Loading