Use launcher icon as notification icon on pre-3.0 devices
This commit is contained in:
parent
85b633750e
commit
651f40ea25
@ -32,6 +32,7 @@ import android.content.SharedPreferences.Editor;
|
|||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.ResultReceiver;
|
import android.os.ResultReceiver;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
@ -277,12 +278,17 @@ public class UpdateService extends IntentService implements ProgressListener {
|
|||||||
|
|
||||||
if (success && changes && notify && updates > 0) {
|
if (success && changes && notify && updates > 0) {
|
||||||
Log.d("FDroid", "Notifying "+updates+" updates.");
|
Log.d("FDroid", "Notifying "+updates+" updates.");
|
||||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
|
NotificationCompat.Builder mBuilder =
|
||||||
|
new NotificationCompat.Builder(
|
||||||
this)
|
this)
|
||||||
.setSmallIcon(R.drawable.ic_stat_notify_updates)
|
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setContentTitle(
|
.setContentTitle(
|
||||||
getString(R.string.fdroid_updates_available));
|
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)
|
Intent notifyIntent = new Intent(this, FDroid.class)
|
||||||
.putExtra(FDroid.EXTRA_TAB_UPDATE, true);
|
.putExtra(FDroid.EXTRA_TAB_UPDATE, true);
|
||||||
if (updates > 1) {
|
if (updates > 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user