From d0af343dfd07ad19be8fa49bb3cd65ac89668180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 24 Sep 2015 16:37:37 -0700 Subject: [PATCH] Backport repo update notification 2.X crash fix Fixed by @pserwylo in master, backporting for 0.96.1. Fixes #421. --- F-Droid/src/org/fdroid/fdroid/UpdateService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/F-Droid/src/org/fdroid/fdroid/UpdateService.java b/F-Droid/src/org/fdroid/fdroid/UpdateService.java index a29535023..eaf3ac58c 100644 --- a/F-Droid/src/org/fdroid/fdroid/UpdateService.java +++ b/F-Droid/src/org/fdroid/fdroid/UpdateService.java @@ -160,6 +160,13 @@ public class UpdateService extends IntentService implements ProgressListener { .setOngoing(true) .setCategory(NotificationCompat.CATEGORY_SERVICE) .setContentTitle(getString(R.string.update_notification_title)); + + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + Intent intent = new Intent(this, FDroid.class); + // TODO: Is this the correct FLAG? + notificationBuilder.setContentIntent(PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); + } + notificationManager.notify(NOTIFY_ID_UPDATING, notificationBuilder.build()); }