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

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

Issue 5153282527854592: Issue 98 - Use the libadblockplus update mechanism (Closed)
Patch Set: Reduce scope of UPDATE_NOTIFICATION_ID and move network error logging to AndroidUpdateCheckDoneCall… Created Sept. 26, 2014, 1:03 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/AndroidUpdateCheckDoneCallback.java
===================================================================
--- a/src/org/adblockplus/android/AndroidUpdateCheckDoneCallback.java
+++ b/src/org/adblockplus/android/AndroidUpdateCheckDoneCallback.java
@@ -20,9 +20,8 @@
import org.adblockplus.libadblockplus.UpdateCheckDoneCallback;
import org.apache.commons.lang.StringUtils;
-import android.app.Notification;
-import android.app.NotificationManager;
import android.content.Context;
+import android.util.Log;
public class AndroidUpdateCheckDoneCallback extends UpdateCheckDoneCallback
{
@@ -36,22 +35,9 @@
@Override
public void updateCheckDoneCallback(final String error)
{
- // TODO: Check if we need this 'manualUpdate' mechanism (initiated by 'checkForUpdates()')
- // if (!error.empty())
- // {
- // jstring jError = jniEnv->NewStringUTF(error.c_str());
- // if (mid)
- // jniEnv->CallVoidMethod(jniObject, mid, NULL, jError);
- // jniEnv->DeleteLocalRef(jError);
- // }
- // else if (manualUpdate)
- // {
- // if (mid)
- // jniEnv->CallVoidMethod(jniObject, mid, NULL, NULL);
- // }
-
- final Notification notification = Utils.createUpdateNotification(this.context, null, StringUtils.isEmpty(error) ? null : error);
- final NotificationManager notificationManager = (NotificationManager)this.context.getSystemService(Context.NOTIFICATION_SERVICE);
- notificationManager.notify(AdblockPlus.UPDATE_NOTIFICATION_ID, notification);
+ if (StringUtils.isEmpty(error))
+ return;
+ Log.e(Utils.getTag(AndroidUpdateCheckDoneCallback.class), "Update check failed: " + error);
René Jeschke 2014/09/26 13:10:52 Could you please extract the 'tag' into a private/
Felix Dahlke 2014/09/26 13:15:31 Done.
+ Utils.showUpdateNotification(this.context, null, error);
}
}
« no previous file with comments | « src/org/adblockplus/android/AndroidUpdateAvailableCallback.java ('k') | src/org/adblockplus/android/Preferences.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld