Skip to content

Commit ba7512a

Browse files
committed
Method is redundant
1 parent 3b864a6 commit ba7512a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ void scheduleAlarmWithNotification(Notification.Builder notificationBuilder) {
365365

366366
private Notification buildNotificationForSending(Class openActivity, Notification.Builder builder) {
367367
int id = builder.getExtras().getInt(KEY_ID, -1);
368-
Intent openAppIntent = buildOpenAppIntent(openActivity);
368+
Intent openAppIntent = new Intent(mContext, openActivity);
369+
openAppIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
369370
openAppIntent.putExtra(KEY_NOTIFICATION_ID, id);
370371
PendingIntent pendingIntent = getActivityPendingIntent(id, openAppIntent, 0);
371372
builder.setContentIntent(pendingIntent);
@@ -383,14 +384,6 @@ private Notification buildNotificationForSending(Class openActivity, Notificatio
383384
return builder.build();
384385
}
385386

386-
// Build an Intent to open the given activity with the data from input Intent.
387-
private Intent buildOpenAppIntent(Class className) {
388-
Intent openAppIntent = new Intent(mContext, className);
389-
openAppIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
390-
391-
return openAppIntent;
392-
}
393-
394387
void performNotificationHousekeeping(Set<String> ids) {
395388
Log.d(TAG_UNITY, "Checking for invalid notification IDs still hanging around");
396389

0 commit comments

Comments
 (0)