Skip to content

Commit 7ce9f31

Browse files
committed
Make mVisibleNotifications instance member
1 parent db34578 commit 7ce9f31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

com.unity.mobile.notifications/Runtime/Android/Plugins/com/unity/androidnotifications/UnityNotificationManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public class UnityNotificationManager extends BroadcastReceiver {
4343
protected static NotificationCallback mNotificationCallback;
4444
protected static UnityNotificationManager mUnityNotificationManager;
4545
private static ConcurrentHashMap<Integer, Notification.Builder> mScheduledNotifications = new ConcurrentHashMap();
46-
private static HashSet<Integer> mVisibleNotifications = new HashSet<>();
4746

4847
private Context mContext = null;
4948
private Activity mActivity = null;
5049
private Class mOpenActivity = null;
5150
private UnityNotificationBackgroundThread mBackgroundThread;
5251
private Random mRandom;
52+
private HashSet<Integer> mVisibleNotifications;
5353

5454
static final String TAG_UNITY = "UnityNotifications";
5555

@@ -78,6 +78,8 @@ private void initialize(Activity activity, NotificationCallback notificationCall
7878
mBackgroundThread = new UnityNotificationBackgroundThread(this, mScheduledNotifications);
7979
if (mRandom == null)
8080
mRandom = new Random();
81+
if (mVisibleNotifications == null)
82+
mVisibleNotifications = new HashSet<>();
8183
mNotificationCallback = notificationCallback;
8284

8385
try {
@@ -113,6 +115,7 @@ static synchronized UnityNotificationManager getNotificationManagerImpl(Context
113115
}
114116

115117
mUnityNotificationManager.mContext = context.getApplicationContext();
118+
mUnityNotificationManager.mVisibleNotifications = new HashSet<>();
116119
return mUnityNotificationManager;
117120
}
118121

0 commit comments

Comments
 (0)