Backport repo update notification 2.X crash fix

Fixed by @pserwylo in master, backporting for 0.96.1. Fixes #421.
This commit is contained in:
Daniel Martí 2015-09-24 16:37:37 -07:00
parent 1ebe9df9a2
commit d0af343dfd

View File

@ -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());
}