From 651f40ea25d08ed16f16e88b86f879d6d779eef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 2 Nov 2013 10:57:49 +0100 Subject: [PATCH] Use launcher icon as notification icon on pre-3.0 devices --- src/org/fdroid/fdroid/UpdateService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/org/fdroid/fdroid/UpdateService.java b/src/org/fdroid/fdroid/UpdateService.java index 0ceda5841..edbb9a904 100644 --- a/src/org/fdroid/fdroid/UpdateService.java +++ b/src/org/fdroid/fdroid/UpdateService.java @@ -32,6 +32,7 @@ import android.content.SharedPreferences.Editor; import android.graphics.BitmapFactory; import android.net.ConnectivityManager; import android.net.NetworkInfo; +import android.os.Build; import android.os.Bundle; import android.os.ResultReceiver; import android.os.SystemClock; @@ -277,12 +278,17 @@ public class UpdateService extends IntentService implements ProgressListener { if (success && changes && notify && updates > 0) { Log.d("FDroid", "Notifying "+updates+" updates."); - NotificationCompat.Builder mBuilder = new NotificationCompat.Builder( + NotificationCompat.Builder mBuilder = + new NotificationCompat.Builder( this) - .setSmallIcon(R.drawable.ic_stat_notify_updates) .setAutoCancel(true) .setContentTitle( getString(R.string.fdroid_updates_available)); + if (Build.VERSION.SDK_INT >= 11) { + mBuilder.setSmallIcon(R.drawable.ic_stat_notify_updates); + } else { + mBuilder.setSmallIcon(R.drawable.ic_launcher); + } Intent notifyIntent = new Intent(this, FDroid.class) .putExtra(FDroid.EXTRA_TAB_UPDATE, true); if (updates > 1) {