Loading android/app/src/com/android/bluetooth/notification/NotificationHelperService.java +22 −17 Original line number Diff line number Diff line Loading @@ -160,16 +160,19 @@ public class NotificationHelperService extends Service { } private boolean shouldDisplayNotification(String countKey) { final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault()); final String dateKey = countKey + "_date"; final String date = Settings.Secure.getString(getContentResolver(), dateKey); final int countShown = Settings.Secure.getInt(getContentResolver(), countKey, 0); final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault()); LocalDateTime savedDate = null; if (countShown != 0) { // Check the saved date only if there is a count of notification. // This will detect manual override of the count setting. final String date = Settings.Secure.getString(getContentResolver(), dateKey); // 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) LocalDateTime savedDate = null; if (date != null) { savedDate = LocalDateTime.parse(date); if ((countShown == 1 && now.isBefore(savedDate.plusWeeks(1))) Loading @@ -183,6 +186,8 @@ public class NotificationHelperService extends Service { } } } Settings.Secure.putInt(getContentResolver(), countKey, Math.min(3, countShown + 1)); Settings.Secure.putString(getContentResolver(), dateKey, now.toString()); Log.i( Loading Loading
android/app/src/com/android/bluetooth/notification/NotificationHelperService.java +22 −17 Original line number Diff line number Diff line Loading @@ -160,16 +160,19 @@ public class NotificationHelperService extends Service { } private boolean shouldDisplayNotification(String countKey) { final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault()); final String dateKey = countKey + "_date"; final String date = Settings.Secure.getString(getContentResolver(), dateKey); final int countShown = Settings.Secure.getInt(getContentResolver(), countKey, 0); final LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault()); LocalDateTime savedDate = null; if (countShown != 0) { // Check the saved date only if there is a count of notification. // This will detect manual override of the count setting. final String date = Settings.Secure.getString(getContentResolver(), dateKey); // 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) LocalDateTime savedDate = null; if (date != null) { savedDate = LocalDateTime.parse(date); if ((countShown == 1 && now.isBefore(savedDate.plusWeeks(1))) Loading @@ -183,6 +186,8 @@ public class NotificationHelperService extends Service { } } } Settings.Secure.putInt(getContentResolver(), countKey, Math.min(3, countShown + 1)); Settings.Secure.putString(getContentResolver(), dateKey, now.toString()); Log.i( Loading