Skip to content

Commit 1c43c45

Browse files
committed
Refactor scheduleAlarmWithNotification to not be static
1 parent c990978 commit 1c43c45

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ protected void performNotificationScheduling(int id, Notification.Builder notifi
349349
}
350350

351351
void scheduleAlarmWithNotification(Notification.Builder notificationBuilder, Intent intent, long fireTime) {
352-
scheduleAlarmWithNotification(mContext, mOpenActivity, notificationBuilder, intent, fireTime);
352+
scheduleAlarmWithNotification(mOpenActivity, notificationBuilder, intent, fireTime);
353353
}
354354

355-
static void scheduleAlarmWithNotification(Context context, Class activityClass, Notification.Builder notificationBuilder, Intent intent, long fireTime) {
355+
private void scheduleAlarmWithNotification(Class activityClass, Notification.Builder notificationBuilder, Intent intent, long fireTime) {
356356
Bundle extras = notificationBuilder.getExtras();
357357
int id = extras.getInt(KEY_ID, -1);
358358
long repeatInterval = extras.getLong(KEY_REPEAT_INTERVAL, -1);
@@ -362,8 +362,8 @@ static void scheduleAlarmWithNotification(Context context, Class activityClass,
362362
mScheduledNotifications.putIfAbsent(Integer.valueOf(id), notificationBuilder);
363363
intent.putExtra(KEY_NOTIFICATION_ID, id);
364364

365-
PendingIntent broadcast = getBroadcastPendingIntent(context, id, intent, PendingIntent.FLAG_UPDATE_CURRENT);
366-
UnityNotificationManager.scheduleNotificationIntentAlarm(context, repeatInterval, fireTime, broadcast);
365+
PendingIntent broadcast = getBroadcastPendingIntent(mContext, id, intent, PendingIntent.FLAG_UPDATE_CURRENT);
366+
UnityNotificationManager.scheduleNotificationIntentAlarm(mContext, repeatInterval, fireTime, broadcast);
367367
}
368368

369369
void scheduleAlarmWithNotification(Notification.Builder notificationBuilder) {
@@ -378,7 +378,7 @@ void scheduleAlarmWithNotification(Notification.Builder notificationBuilder) {
378378
openActivity = mUnityNotificationManager.mOpenActivity;
379379
}
380380

381-
scheduleAlarmWithNotification(mContext, openActivity, notificationBuilder, intent, fireTime);
381+
scheduleAlarmWithNotification(openActivity, notificationBuilder, intent, fireTime);
382382
}
383383

384384
private Notification buildNotificationForSending(Class openActivity, Notification.Builder builder) {

0 commit comments

Comments
 (0)