@@ -428,7 +428,7 @@ private Set<String> findInvalidNotificationIds(Set<String> ids) {
428
428
invalid .remove (id );
429
429
}
430
430
}
431
- else synchronized (UnityNotificationManager . class ) {
431
+ else synchronized (this ) {
432
432
for (Integer visibleId : mVisibleNotifications ) {
433
433
String id = String .valueOf (visibleId );
434
434
invalid .remove (id );
@@ -548,7 +548,7 @@ public int checkNotificationStatus(int id) {
548
548
if (id == n .getId ())
549
549
return 2 ;
550
550
}
551
- } else synchronized (UnityNotificationManager . class ) {
551
+ } else synchronized (this ) {
552
552
for (Integer notificationId : mVisibleNotifications ) {
553
553
if (notificationId .intValue () == id )
554
554
return 2 ;
@@ -631,7 +631,7 @@ public void onReceive(Intent intent) {
631
631
if (Build .VERSION .SDK_INT < Build .VERSION_CODES .M ) {
632
632
if (KEY_NOTIFICATION_DISMISSED .equals (intent .getAction ())) {
633
633
int removedId = intent .getIntExtra (KEY_NOTIFICATION_DISMISSED , -1 );
634
- if (removedId > 0 ) synchronized (UnityNotificationManager . class ) {
634
+ if (removedId > 0 ) synchronized (this ) {
635
635
mVisibleNotifications .remove (removedId );
636
636
}
637
637
return ;
@@ -676,7 +676,7 @@ private void notify(int id, Notification notification) {
676
676
boolean showInForeground = notification .extras .getBoolean (KEY_SHOW_IN_FOREGROUND , true );
677
677
if (!isInForeground () || showInForeground ) {
678
678
getNotificationManager ().notify (id , notification );
679
- if (Build .VERSION .SDK_INT < Build .VERSION_CODES .M ) synchronized (UnityNotificationManager . class ) {
679
+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .M ) synchronized (this ) {
680
680
mVisibleNotifications .add (Integer .valueOf (id ));
681
681
}
682
682
}
0 commit comments