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

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

Issue 5153282527854592: Issue 98 - Use the libadblockplus update mechanism (Closed)
Patch Set: Only append the revision to the version for devbuilds Created Sept. 26, 2014, 2:54 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/AndroidUpdateAvailableCallback.java
===================================================================
--- a/src/org/adblockplus/android/AndroidUpdateAvailableCallback.java
+++ b/src/org/adblockplus/android/AndroidUpdateAvailableCallback.java
@@ -17,17 +17,11 @@
package org.adblockplus.android;
-import java.util.List;
+import org.adblockplus.libadblockplus.UpdateAvailableCallback;
-import org.adblockplus.libadblockplus.EventCallback;
-import org.adblockplus.libadblockplus.JsValue;
-import org.apache.commons.lang.StringUtils;
-
-import android.app.Notification;
-import android.app.NotificationManager;
import android.content.Context;
-public class AndroidUpdateAvailableCallback extends EventCallback
+public class AndroidUpdateAvailableCallback extends UpdateAvailableCallback
{
private final Context context;
@@ -37,14 +31,8 @@
}
@Override
- public void eventCallback(final List<JsValue> params)
+ public void updateAvailableCallback(String url)
{
- final String updateUrl = params.size() > 0 && !params.get(0).isNull() ? params.get(0).toString() : "";
- if (StringUtils.isNotEmpty(updateUrl))
- {
- final Notification notification = Utils.createUpdateNotification(this.context, updateUrl, null);
- final NotificationManager notificationManager = (NotificationManager)this.context.getSystemService(Context.NOTIFICATION_SERVICE);
- notificationManager.notify(AdblockPlus.UPDATE_NOTIFICATION_ID, notification);
- }
+ Utils.showUpdateNotification(this.context, url, null);
}
}
« no previous file with comments | « src/org/adblockplus/android/AdblockPlus.java ('k') | src/org/adblockplus/android/AndroidUpdateCheckDoneCallback.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld