OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 boolean developmentBuild, String pref
erenceName) | 141 boolean developmentBuild, String pref
erenceName) |
142 { | 142 { |
143 initProvider(context, basePath, developmentBuild); | 143 initProvider(context, basePath, developmentBuild); |
144 initStorage(context, preferenceName); | 144 initStorage(context, preferenceName); |
145 return provider; | 145 return provider; |
146 } | 146 } |
147 | 147 |
148 private void initProvider(Context context, String basePath, boolean developmen
tBuild) | 148 private void initProvider(Context context, String basePath, boolean developmen
tBuild) |
149 { | 149 { |
150 provider = new SingleInstanceEngineProvider(context, basePath, developmentBu
ild); | 150 provider = new SingleInstanceEngineProvider(context, basePath, developmentBu
ild); |
151 provider.setEngineCreatedCallback(engineCreatedCallback); | 151 provider.addEngineCreatedCallback(engineCreatedCallback); |
152 provider.setEngineDisposedCallback(engineDisposedCallback); | 152 provider.addEngineDisposedCallback(engineDisposedCallback); |
153 } | 153 } |
154 | 154 |
155 private void initStorage(Context context, String settingsPreferenceName) | 155 private void initStorage(Context context, String settingsPreferenceName) |
156 { | 156 { |
157 // read and apply current settings | 157 // read and apply current settings |
158 SharedPreferences settingsPrefs = context.getSharedPreferences( | 158 SharedPreferences settingsPrefs = context.getSharedPreferences( |
159 settingsPreferenceName, | 159 settingsPreferenceName, |
160 Context.MODE_PRIVATE); | 160 Context.MODE_PRIVATE); |
161 | 161 |
162 storage = new SharedPrefsStorage(settingsPrefs); | 162 storage = new SharedPrefsStorage(settingsPrefs); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 /** | 201 /** |
202 * @deprecated The method is deprecated: use .getProvider().getCounter() inste
ad | 202 * @deprecated The method is deprecated: use .getProvider().getCounter() inste
ad |
203 */ | 203 */ |
204 @Deprecated | 204 @Deprecated |
205 public int getCounter() | 205 public int getCounter() |
206 { | 206 { |
207 return provider.getCounter(); | 207 return provider.getCounter(); |
208 } | 208 } |
209 } | 209 } |
OLD | NEW |