From aa945367c93375389dd9865fe3b1aec0f851f279 Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Fri, 24 Feb 2017 15:21:49 +1100 Subject: [PATCH] Pass potentially nullable argument instead of guarding. It seems that `setContentIntent()` will do fine if we pass it a null argument. The default value is `null` anyway, and it doesn't mandate a non-null argument. --- .../org/fdroid/fdroid/NotificationHelper.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/NotificationHelper.java b/app/src/main/java/org/fdroid/fdroid/NotificationHelper.java index 6fedc9d95..445688ddc 100644 --- a/app/src/main/java/org/fdroid/fdroid/NotificationHelper.java +++ b/app/src/main/java/org/fdroid/fdroid/NotificationHelper.java @@ -333,13 +333,9 @@ class NotificationHelper { .setLargeIcon(iconLarge) .setLocalOnly(true) .setVisibility(NotificationCompat.VISIBILITY_SECRET) - .setGroup(GROUP_UPDATES); + .setGroup(GROUP_UPDATES) + .setContentIntent(entry.intent); - // Handle intents - // - if (entry.intent != null) { - builder.setContentIntent(entry.intent); - } // Handle actions // @@ -434,11 +430,8 @@ class NotificationHelper { .setContentText(context.getString(R.string.notification_content_single_installed)) .setLocalOnly(true) .setVisibility(NotificationCompat.VISIBILITY_SECRET) - .setGroup(GROUP_INSTALLED); - - if (entry.intent != null) { - builder.setContentIntent(entry.intent); - } + .setGroup(GROUP_INSTALLED) + .setContentIntent(entry.intent); Intent intentDeleted = new Intent(BROADCAST_NOTIFICATIONS_INSTALLED_CLEARED); intentDeleted.putExtra(EXTRA_NOTIFICATION_KEY, entry.getUniqueKey());