From 8794611b2679c7612ccacf152e4681462c6f4147 Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Thu, 21 Apr 2016 13:30:33 +1000 Subject: [PATCH] DownloadCompleteService uses same notification code as DownloadService. Both classes required the same type of notification intent to be created, so they now both use the same static function to create the relevant intent. --- .../fdroid/fdroid/net/DownloadCompleteService.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/net/DownloadCompleteService.java b/app/src/main/java/org/fdroid/fdroid/net/DownloadCompleteService.java index 6574a76fd..e64ef3e20 100644 --- a/app/src/main/java/org/fdroid/fdroid/net/DownloadCompleteService.java +++ b/app/src/main/java/org/fdroid/fdroid/net/DownloadCompleteService.java @@ -64,22 +64,13 @@ public class DownloadCompleteService extends IntentService { title = String.format(getString(R.string.tap_to_install_format), app.name); } - Intent notifyIntent = new Intent(this, AppDetails.class); - notifyIntent.putExtra(AppDetails.EXTRA_APPID, packageName); - TaskStackBuilder stackBuilder = TaskStackBuilder - .create(this) - .addParentStack(AppDetails.class) - .addNextIntent(notifyIntent); int requestCode = Utils.getApkUrlNotificationId(intent.getDataString()); - PendingIntent pendingIntent = stackBuilder.getPendingIntent(requestCode, - PendingIntent.FLAG_UPDATE_CURRENT); - NotificationCompat.Builder builder = new NotificationCompat.Builder(this) .setAutoCancel(true) .setContentTitle(title) .setSmallIcon(android.R.drawable.stat_sys_download_done) - .setContentIntent(pendingIntent) + .setContentIntent(DownloaderService.createAppDetailsIntent(this, requestCode, packageName)) .setContentText(getString(R.string.tap_to_install)); NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); nm.notify(Utils.getApkUrlNotificationId(intent.getDataString()), builder.build());