Merge pull request #7495 from osmandapp/NotificationRefreshBugFix
Fix refresh notification bug
This commit is contained in:
commit
1d71154096
1 changed files with 4 additions and 4 deletions
|
@ -126,7 +126,7 @@ public abstract class OsmandNotification {
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
Builder notificationBuilder = buildNotification(false);
|
Builder notificationBuilder = buildNotification(false);
|
||||||
if (notificationBuilder != null) {
|
if (notificationBuilder != null) {
|
||||||
Notification notification = getNotification(notificationBuilder);
|
Notification notification = getNotification(notificationBuilder, false);
|
||||||
setupNotification(notification);
|
setupNotification(notification);
|
||||||
notificationManager.notify(top ? TOP_NOTIFICATION_SERVICE_ID : getOsmandNotificationId(), notification);
|
notificationManager.notify(top ? TOP_NOTIFICATION_SERVICE_ID : getOsmandNotificationId(), notification);
|
||||||
notifyWearable(notificationManager);
|
notifyWearable(notificationManager);
|
||||||
|
@ -141,7 +141,7 @@ public abstract class OsmandNotification {
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
Builder notificationBuilder = buildNotification(false);
|
Builder notificationBuilder = buildNotification(false);
|
||||||
if (notificationBuilder != null) {
|
if (notificationBuilder != null) {
|
||||||
Notification notification = getNotification(notificationBuilder);
|
Notification notification = getNotification(notificationBuilder, true);
|
||||||
setupNotification(notification);
|
setupNotification(notification);
|
||||||
if (top) {
|
if (top) {
|
||||||
//notificationManager.cancel(getOsmandNotificationId());
|
//notificationManager.cancel(getOsmandNotificationId());
|
||||||
|
@ -160,9 +160,9 @@ public abstract class OsmandNotification {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Notification getNotification(Builder notificationBuilder) {
|
private Notification getNotification(Builder notificationBuilder, boolean forceBuild) {
|
||||||
Notification notification = currentNotification;
|
Notification notification = currentNotification;
|
||||||
if (notification == null) {
|
if (forceBuild || notification == null) {
|
||||||
notification = notificationBuilder.build();
|
notification = notificationBuilder.build();
|
||||||
currentNotification = notification;
|
currentNotification = notification;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue