@@ -338,7 +338,7 @@ protected void performNotificationScheduling(int id, Notification.Builder notifi
338
338
fireTime += repeatInterval ;
339
339
}
340
340
341
- Intent intent = buildNotificationIntent (mContext );
341
+ Intent intent = buildNotificationIntent ();
342
342
343
343
if (intent != null ) {
344
344
UnityNotificationManager .saveNotification (mContext , notificationBuilder .build ());
@@ -370,19 +370,19 @@ static void scheduleAlarmWithNotification(Context context, Class activityClass,
370
370
UnityNotificationManager .scheduleNotificationIntentAlarm (context , repeatInterval , fireTime , broadcast );
371
371
}
372
372
373
- static void scheduleAlarmWithNotification (Notification .Builder notificationBuilder , Context context ) {
373
+ void scheduleAlarmWithNotification (Notification .Builder notificationBuilder ) {
374
374
long fireTime = notificationBuilder .getExtras ().getLong (KEY_FIRE_TIME , 0L );
375
- Intent intent = buildNotificationIntent (context );
375
+ Intent intent = buildNotificationIntent ();
376
376
377
377
Class openActivity ;
378
- if (mUnityNotificationManager == null || mUnityNotificationManager . mOpenActivity == null ) {
379
- openActivity = UnityNotificationUtilities .getOpenAppActivity (context , true );
378
+ if (mOpenActivity == null ) {
379
+ openActivity = UnityNotificationUtilities .getOpenAppActivity (mContext , true );
380
380
}
381
381
else {
382
382
openActivity = mUnityNotificationManager .mOpenActivity ;
383
383
}
384
384
385
- scheduleAlarmWithNotification (context , openActivity , notificationBuilder , intent , fireTime );
385
+ scheduleAlarmWithNotification (mContext , openActivity , notificationBuilder , intent , fireTime );
386
386
}
387
387
388
388
private Notification buildNotificationForSending (Class openActivity , Notification .Builder builder ) {
@@ -431,7 +431,7 @@ void performNotificationHousekeeping(Set<String> ids) {
431
431
}
432
432
433
433
private Set <String > findInvalidNotificationIds (Set <String > ids ) {
434
- Intent intent = buildNotificationIntent (mContext );
434
+ Intent intent = buildNotificationIntent ();
435
435
HashSet <String > invalid = new HashSet <String >();
436
436
for (String id : ids ) {
437
437
// Get the given broadcast PendingIntent by id as request code.
@@ -469,8 +469,8 @@ else synchronized (UnityNotificationManager.class) {
469
469
return invalid ;
470
470
}
471
471
472
- protected static Intent buildNotificationIntent (Context context ) {
473
- Intent intent = new Intent (context , UnityNotificationManager .class );
472
+ private Intent buildNotificationIntent () {
473
+ Intent intent = new Intent (mContext , UnityNotificationManager .class );
474
474
intent .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK | Intent .FLAG_ACTIVITY_CLEAR_TASK );
475
475
return intent ;
476
476
}
0 commit comments