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

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

Issue 11172036: ABP/Android libadblockplus integration (Closed)
Patch Set: Created July 22, 2013, 8:52 a.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/AdvancedPreferences.java
===================================================================
--- a/src/org/adblockplus/android/AdvancedPreferences.java
+++ b/src/org/adblockplus/android/AdvancedPreferences.java
@@ -127,9 +127,10 @@
AdblockPlus application = AdblockPlus.getApplication();
boolean enabled = sharedPreferences.getBoolean(key, false);
boolean serviceRunning = application.isServiceRunning();
- if (enabled && !serviceRunning)
+ if (enabled)
{
- startService(new Intent(this, ProxyService.class));
+ if (!serviceRunning)
+ startService(new Intent(this, ProxyService.class));
}
else
{
@@ -137,10 +138,9 @@
stopService(new Intent(this, ProxyService.class));
// If disabled, disable filtering as well
SharedPreferences.Editor editor = sharedPreferences.edit();
- editor.putBoolean(getString(R.string.pref_enabled), enabled);
+ editor.putBoolean(getString(R.string.pref_enabled), false);
editor.commit();
application.setFilteringEnabled(false);
- application.stopEngine(false);
}
}
if (getString(R.string.pref_refresh).equals(key))

Powered by Google App Engine
This is Rietveld