Skip to content

Commit 72612d9

Browse files
committed
Do not expose scheduling task from background thread
1 parent 7ec035d commit 72612d9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.util.Set;
1111

1212
public class UnityNotificationBackgroundThread extends Thread {
13-
public static class ScheduleNotificationTask implements Runnable {
13+
private static class ScheduleNotificationTask implements Runnable {
1414
private Notification.Builder notificationBuilder;
1515

1616
public ScheduleNotificationTask(Notification.Builder builder) {
@@ -33,8 +33,8 @@ public UnityNotificationBackgroundThread() {
3333
enqueueHousekeeping();
3434
}
3535

36-
public void enqueueNotification(ScheduleNotificationTask task) {
37-
mTasks.add(task);
36+
public void enqueueNotification(Notification.Builder notificationBuilder) {
37+
mTasks.add(new UnityNotificationBackgroundThread.ScheduleNotificationTask(notificationBuilder));
3838
}
3939

4040
public void enqueueCancelNotification(int id) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public Object[] getNotificationChannels() {
260260
public void scheduleNotification(Notification.Builder notificationBuilder) {
261261
int id = notificationBuilder.getExtras().getInt(KEY_ID, -1);
262262
putScheduledNotification(id);
263-
mBackgroundThread.enqueueNotification(new UnityNotificationBackgroundThread.ScheduleNotificationTask(notificationBuilder));
263+
mBackgroundThread.enqueueNotification(notificationBuilder);
264264
}
265265

266266
protected void performNotificationScheduling(Notification.Builder notificationBuilder) {

0 commit comments

Comments
 (0)