42
42
public class UnityNotificationManager extends BroadcastReceiver {
43
43
protected static NotificationCallback mNotificationCallback ;
44
44
protected static UnityNotificationManager mUnityNotificationManager ;
45
- private static ConcurrentHashMap <Integer , Notification .Builder > mScheduledNotifications = new ConcurrentHashMap ();
46
45
47
46
private Context mContext = null ;
48
47
private Activity mActivity = null ;
49
48
private Class mOpenActivity = null ;
50
49
private UnityNotificationBackgroundThread mBackgroundThread ;
51
50
private Random mRandom ;
52
51
private HashSet <Integer > mVisibleNotifications ;
52
+ private ConcurrentHashMap <Integer , Notification .Builder > mScheduledNotifications ;
53
53
54
54
static final String TAG_UNITY = "UnityNotifications" ;
55
55
@@ -74,6 +74,8 @@ private void initialize(Activity activity, NotificationCallback notificationCall
74
74
if (mContext == null )
75
75
mContext = activity .getApplicationContext ();
76
76
mActivity = activity ;
77
+ if (mScheduledNotifications == null )
78
+ mScheduledNotifications = new ConcurrentHashMap ();
77
79
if (mBackgroundThread == null )
78
80
mBackgroundThread = new UnityNotificationBackgroundThread (this , mScheduledNotifications );
79
81
if (mRandom == null )
@@ -114,6 +116,7 @@ static synchronized UnityNotificationManager getNotificationManagerImpl(Context
114
116
mUnityNotificationManager = new UnityNotificationManager ();
115
117
mUnityNotificationManager .mContext = context .getApplicationContext ();
116
118
mUnityNotificationManager .mVisibleNotifications = new HashSet <>();
119
+ mUnityNotificationManager .mScheduledNotifications = new ConcurrentHashMap ();
117
120
}
118
121
119
122
return mUnityNotificationManager ;
0 commit comments