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: Even more renaming, ignore INVALID/QUESTION Created Feb. 18, 2015, 3 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
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..2b51644b9412c3307a7deb5c34cdd76fd1ac74a5 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,12 @@ 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;
+ // Insert new NOTIFICATION_IDs in between here
+ public static final int GROUPED_NOTIFICATION_ID = R.string.app_name + 32;
+ // Do not add NOTIFICATION_IDs here
+
private static final String TAG = Utils.getTag(AdblockPlus.class);
private static final Pattern RE_JS = Pattern.compile("\\.js$", Pattern.CASE_INSENSITIVE);
@@ -387,6 +394,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()

Powered by Google App Engine
This is Rietveld