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

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

Issue 5431458994847744: Automatically enable acceptable ads and notify the user about it (Closed)
Patch Set: Fix prefs and url encode issues Created Nov. 26, 2013, 1:58 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 | « no previous file | src/org/adblockplus/android/Preferences.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
===================================================================
--- a/src/org/adblockplus/android/AdblockPlus.java
+++ b/src/org/adblockplus/android/AdblockPlus.java
@@ -36,6 +36,8 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -43,6 +45,7 @@
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
+import android.preference.PreferenceManager;
import android.provider.Settings;
import android.util.Log;
@@ -291,6 +294,20 @@
return documentationLink.replace("%LINK%", "acceptable_ads").replace("%LANG%", locale);
}
+ public void setNotifiedAboutAcceptableAds(boolean notified)
+ {
+ final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+ final Editor editor = preferences.edit();
+ editor.putBoolean("notified_about_acceptable_ads", notified);
+ editor.commit();
+ }
+
+ public boolean isNotifiedAboutAcceptableAds()
+ {
+ final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+ return preferences.getBoolean("notified_about_acceptable_ads", false);
+ }
+
/**
* Returns ElemHide selectors for domain.
*
« no previous file with comments | « no previous file | src/org/adblockplus/android/Preferences.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld