Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/android/AdblockPlus.java

Issue 5327480814567424: Issue 1108 - Support notifications (Closed)
Patch Set: Only one Notification displayed now Created Feb. 18, 2015, 3:42 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/org/adblockplus/android/ABPEngine.java ('k') | src/org/adblockplus/android/CrashHandler.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/android/AdblockPlus.java
diff --git a/src/org/adblockplus/android/AdblockPlus.java b/src/org/adblockplus/android/AdblockPlus.java
index 8ca82bdf77783aab5f819d96010c5017134270d7..7a5d3dbe62b4aef74f32b4281c5d14eb51ec170b 100755
--- a/src/org/adblockplus/android/AdblockPlus.java
+++ b/src/org/adblockplus/android/AdblockPlus.java
@@ -25,6 +25,7 @@ import java.util.List;
import java.util.regex.Pattern;
import org.adblockplus.libadblockplus.FilterEngine.ContentType;
+import org.adblockplus.libadblockplus.Notification;
import org.apache.commons.lang.StringUtils;
import android.app.ActivityManager;
@@ -47,6 +48,10 @@ import android.util.Log;
public class AdblockPlus extends Application
{
+ public static final int ONGOING_NOTIFICATION_ID = R.string.app_name;
+ public static final int UPDATE_NOTIFICATION_ID = R.string.app_name + 1;
+ public static final int SERVER_NOTIFICATION_ID = R.string.app_name + 2;
+
private static final String TAG = Utils.getTag(AdblockPlus.class);
private static final Pattern RE_JS = Pattern.compile("\\.js$", Pattern.CASE_INSENSITIVE);
@@ -387,6 +392,23 @@ public class AdblockPlus extends Application
}
/**
+ * @return Notification to show for the given URL, {@code null} if none
+ * available
+ */
+ public Notification getNextNotificationToShow(String url)
+ {
+ return this.abpEngine.getNextNotificationToShow(url);
+ }
+
+ /**
+ * @return Notification to show, {@code null} if none available
+ */
+ public Notification getNextNotificationToShow()
+ {
+ return this.abpEngine.getNextNotificationToShow();
+ }
+
+ /**
* Initiates immediate interactive check for available update.
*/
public void checkUpdates()
« no previous file with comments | « src/org/adblockplus/android/ABPEngine.java ('k') | src/org/adblockplus/android/CrashHandler.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld