mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
Java
50 lines
1.1 KiB
Java
15 years ago
|
/**
|
||
|
* See the file "LICENSE" for the full license governing this code.
|
||
|
*/
|
||
|
package com.todoroo.andlib.service;
|
||
|
|
||
|
import android.app.Notification;
|
||
|
import android.content.Context;
|
||
|
|
||
|
/**
|
||
|
* Notification Manager stub
|
||
|
*
|
||
|
* @author timsu
|
||
|
*
|
||
|
*/
|
||
|
public interface NotificationManager {
|
||
|
|
||
|
public void cancel(int id);
|
||
|
|
||
|
public void cancelAll();
|
||
|
|
||
|
public void notify(int id, Notification notification);
|
||
|
|
||
|
/**
|
||
|
* Instantiation of notification manager that passes through to
|
||
|
* Android's notification manager
|
||
|
*
|
||
|
* @author timsu
|
||
|
*
|
||
|
*/
|
||
|
public static class AndroidNotificationManager implements NotificationManager {
|
||
|
final android.app.NotificationManager nm;
|
||
|
public AndroidNotificationManager(Context context) {
|
||
|
nm = (android.app.NotificationManager)
|
||
|
context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||
|
}
|
||
|
|
||
|
public void cancel(int id) {
|
||
|
nm.cancel(id);
|
||
|
}
|
||
|
|
||
|
public void cancelAll() {
|
||
|
nm.cancelAll();
|
||
|
}
|
||
|
|
||
|
public void notify(int id, Notification notification) {
|
||
|
nm.notify(id, notification);
|
||
|
}
|
||
|
}
|
||
|
}
|