From 0214e9e447c70fdb73549b79b750a1899d693e33 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 4 May 2016 21:01:37 +0200 Subject: [PATCH] remove pointless method: DownloaderService.getPackageNameFromIntent() This method provides the exact same results as the underlying method it uses, intent.getStringExtra() This was added in 0163d6efa6013181c2e6554760e5fa6e67a6daf9 --- .../java/org/fdroid/fdroid/net/DownloaderService.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/net/DownloaderService.java b/app/src/main/java/org/fdroid/fdroid/net/DownloaderService.java index d2186582d..14b7432e5 100644 --- a/app/src/main/java/org/fdroid/fdroid/net/DownloaderService.java +++ b/app/src/main/java/org/fdroid/fdroid/net/DownloaderService.java @@ -154,11 +154,6 @@ public class DownloaderService extends Service { } } - @Nullable - private static String getPackageNameFromIntent(@NonNull Intent intent) { - return intent.hasExtra(EXTRA_PACKAGE_NAME) ? intent.getStringExtra(EXTRA_PACKAGE_NAME) : null; - } - private NotificationCompat.Builder createNotification(String urlString, @Nullable String packageName) { return new NotificationCompat.Builder(this) .setAutoCancel(true) @@ -262,11 +257,11 @@ public class DownloaderService extends Service { File downloadDir = new File(Utils.getApkCacheDir(this), uri.getHost() + "-" + uri.getPort()); downloadDir.mkdirs(); final SanitizedFile localFile = new SanitizedFile(downloadDir, uri.getLastPathSegment()); - final String packageName = getPackageNameFromIntent(intent); + final String packageName = intent.getStringExtra(EXTRA_PACKAGE_NAME); sendBroadcast(uri, Downloader.ACTION_STARTED, localFile); if (Preferences.get().isUpdateNotificationEnabled()) { - Notification notification = createNotification(intent.getDataString(), getPackageNameFromIntent(intent)).build(); + Notification notification = createNotification(intent.getDataString(), intent.getStringExtra(EXTRA_PACKAGE_NAME)).build(); startForeground(NOTIFY_DOWNLOADING, notification); }