Skip to content

Commit db5a2f9

Browse files
committed
Join sends & other for scheduling housekeeping decision
1 parent c185dd3 commit db5a2f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void run(Context context) {
7878

7979
private LinkedTransferQueue<Task> mTasks = new LinkedTransferQueue();
8080
private int mSentNotificationsSinceHousekeeping = 0;
81-
private int mOtherTasksSinceHousekeeping = 0;
81+
private int mOtherTasksSinceHousekeeping;
8282

8383
public UnityNotificationBackgroundThread() {
8484
// force housekeeping
@@ -128,8 +128,9 @@ private void executeTask(Context context, Task task) {
128128
++mSentNotificationsSinceHousekeeping;
129129
else
130130
++mOtherTasksSinceHousekeeping;
131-
if (mSentNotificationsSinceHousekeeping >= 50)
131+
if ((mSentNotificationsSinceHousekeeping + mOtherTasksSinceHousekeeping) >= 50) {
132132
enqueueHousekeeping();
133+
}
133134
} catch (Exception e) {
134135
Log.e(TAG_UNITY, "Exception executing notification task", e);
135136
}

0 commit comments

Comments
 (0)