Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc60c860 authored by Joe Steele's avatar Joe Steele
Browse files

Remove com.fsck.k9.helper.NotificationBuilder

Only useful on pre-Honeycomb devices.
parent 786511ed
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ import com.fsck.k9.activity.setup.AccountSetupIncoming;
import com.fsck.k9.activity.setup.AccountSetupOutgoing;
import com.fsck.k9.cache.EmailProviderCache;
import com.fsck.k9.helper.Contacts;
import com.fsck.k9.helper.NotificationBuilder;
import com.fsck.k9.helper.power.TracingPowerManager;
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
import com.fsck.k9.mail.Address;
@@ -2650,7 +2649,7 @@ public class MessagingController implements Runnable {
        final String title = context.getString(
                R.string.notification_certificate_error_title, account.getDescription());

        final NotificationCompat.Builder builder = new NotificationBuilder(context);
        final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
        builder.setSmallIcon(R.drawable.ic_notify_new_mail);
        builder.setWhen(System.currentTimeMillis());
        builder.setAutoCancel(true);
@@ -3348,7 +3347,7 @@ public class MessagingController implements Runnable {
        NotificationManager notifMgr =
            (NotificationManager) mApplication.getSystemService(Context.NOTIFICATION_SERVICE);

        NotificationCompat.Builder builder = new NotificationBuilder(mApplication);
        NotificationCompat.Builder builder = new NotificationCompat.Builder(mApplication);
        builder.setSmallIcon(R.drawable.ic_notify_check_mail);
        builder.setWhen(System.currentTimeMillis());
        builder.setOngoing(true);
@@ -3399,7 +3398,7 @@ public class MessagingController implements Runnable {
        NotificationManager notifMgr =
                (NotificationManager) mApplication.getSystemService(Context.NOTIFICATION_SERVICE);

        NotificationCompat.Builder builder = new NotificationBuilder(mApplication);
        NotificationCompat.Builder builder = new NotificationCompat.Builder(mApplication);
        builder.setSmallIcon(R.drawable.ic_notify_new_mail);
        builder.setWhen(System.currentTimeMillis());
        builder.setAutoCancel(true);
@@ -3433,7 +3432,7 @@ public class MessagingController implements Runnable {
        final NotificationManager notifMgr =
                (NotificationManager) mApplication.getSystemService(Context.NOTIFICATION_SERVICE);

        NotificationCompat.Builder builder = new NotificationBuilder(mApplication);
        NotificationCompat.Builder builder = new NotificationCompat.Builder(mApplication);
        builder.setSmallIcon(R.drawable.ic_notify_check_mail);
        builder.setWhen(System.currentTimeMillis());
        builder.setOngoing(true);
@@ -4835,7 +4834,7 @@ public class MessagingController implements Runnable {
        NotificationManager notifMgr =
                (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

        NotificationCompat.Builder builder = new NotificationBuilder(context);
        NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
        builder.setSmallIcon(R.drawable.ic_notify_new_mail);
        builder.setWhen(System.currentTimeMillis());
        if (!updateSilently) {
+0 −38
Original line number Diff line number Diff line
package com.fsck.k9.helper;

import android.app.Notification;
import android.content.Context;
import android.os.Build;
import android.support.v4.app.NotificationCompat;

/**
 * Notification builder that will set {@link Notification#number} on pre-Honeycomb devices.
 *
 * @see <a href="http://code.google.com/p/android/issues/detail?id=38028">android - Issue 38028</a>
 */
public class NotificationBuilder extends NotificationCompat.Builder {
    protected int mNumber;


    public NotificationBuilder(Context context) {
        super(context);
    }

    @Override
    public NotificationCompat.Builder setNumber(int number) {
        super.setNumber(number);
        mNumber = number;
        return this;
    }

    @Override
    public Notification build() {
        Notification notification = super.build();

        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
            notification.number = mNumber;
        }

        return notification;
    }
}