@@ -0,0 +1,2008 @@
+package com.novoda.downloadmanager;%0A%0Aimport android.app.Notification;%0Aimport android.app.Service;%0Aimport android.support.v4.app.NotificationManagerCompat;%0A%0Aclass ServiceNotificationDisplayer%3CT%3E %7B%0A%0A    private static final String NOTIFICATION_TAG = %22download-manager%22;%0A%0A    private final NotificationManagerCompat notificationManager;%0A    private Service service;%0A%0A    ServiceNotificationDisplayer(NotificationManagerCompat notificationManager) %7B%0A        this.notificationManager = notificationManager;%0A    %7D%0A%0A    void updateNotification(NotificationInformation notificationInformation) %7B%0A        service.startForeground(notificationInformation.getId(), notificationInformation.getNotification());%0A    %7D%0A%0A    void stackNotification(NotificationInformation notificationInformation) %7B%0A        service.stopForeground(true);%0A        Notification notification = notificationInformation.getNotification();%0A        notificationManager.notify(NOTIFICATION_TAG, notificationInformation.getId(), notification);%0A    %7D%0A%0A    void stackNotificationNotDismissible(NotificationInformation notificationInformation) %7B%0A        service.stopForeground(true);%0A        Notification notification = notificationInformation.getNotification();%0A        notification.flags %7C= Notification.FLAG_ONGOING_EVENT;%0A        notificationManager.notify(NOTIFICATION_TAG, notificationInformation.getId(), notification);%0A    %7D%0A%0A    void dismissStackedNotification(NotificationInformation notificationInformation) %7B%0A        notificationManager.cancel(NOTIFICATION_TAG, notificationInformation.getId());%0A    %7D%0A%0A    void setService(T service) %7B%0A        if (service instanceof Service) %7B%0A            this.service = (Service) service;%0A        %7D else %7B%0A            String message = String.format(%0A                    %22Parameter: %25s is not an instance of %25s%22,%0A                    service.getClass().getSimpleName(),%0A                    Service.class.getSimpleName()%0A            );%0A            throw new IllegalArgumentException(message);%0A        %7D%0A    %7D%0A%7D%0A

Create Service dedicated notification displayer.