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: 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/AndroidUpdateCheckDoneCallback.java
===================================================================
--- a/src/org/adblockplus/android/AndroidUpdateCheckDoneCallback.java
+++ b/src/org/adblockplus/android/AndroidUpdateCheckDoneCallback.java
@@ -20,12 +20,13 @@
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
{
+ private static final String TAG = Utils.getTag(AndroidUpdateCheckDoneCallback.class);
+
private final Context context;
public AndroidUpdateCheckDoneCallback(final Context context)
@@ -36,22 +37,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(TAG, "Update check failed: " + error);
+ 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