| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 package org.adblockplus.android; | 18 package org.adblockplus.android; |
| 19 | 19 |
| 20 import java.util.List; | 20 import java.util.List; |
| 21 import java.util.Locale; |
| 21 | 22 |
| 22 import org.adblockplus.libadblockplus.AppInfo; | 23 import org.adblockplus.libadblockplus.AppInfo; |
| 23 import org.adblockplus.libadblockplus.EventCallback; | 24 import org.adblockplus.libadblockplus.EventCallback; |
| 24 import org.adblockplus.libadblockplus.Filter; | 25 import org.adblockplus.libadblockplus.Filter; |
| 25 import org.adblockplus.libadblockplus.FilterChangeCallback; | 26 import org.adblockplus.libadblockplus.FilterChangeCallback; |
| 26 import org.adblockplus.libadblockplus.FilterEngine; | 27 import org.adblockplus.libadblockplus.FilterEngine; |
| 27 import org.adblockplus.libadblockplus.JsEngine; | 28 import org.adblockplus.libadblockplus.JsEngine; |
| 28 import org.adblockplus.libadblockplus.LogSystem; | 29 import org.adblockplus.libadblockplus.LogSystem; |
| 29 import org.adblockplus.libadblockplus.Subscription; | 30 import org.adblockplus.libadblockplus.Subscription; |
| 30 import org.adblockplus.libadblockplus.UpdaterCallback; | 31 import org.adblockplus.libadblockplus.UpdaterCallback; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 try | 73 try |
| 73 { | 74 { |
| 74 final PackageInfo info = context.getPackageManager().getPackageInfo(contex
t.getPackageName(), 0); | 75 final PackageInfo info = context.getPackageManager().getPackageInfo(contex
t.getPackageName(), 0); |
| 75 version = info.versionName + "." + info.versionCode; | 76 version = info.versionName + "." + info.versionCode; |
| 76 } | 77 } |
| 77 catch (final NameNotFoundException e) | 78 catch (final NameNotFoundException e) |
| 78 { | 79 { |
| 79 Log.e(TAG, "Failed to get the application version number", e); | 80 Log.e(TAG, "Failed to get the application version number", e); |
| 80 } | 81 } |
| 81 final String sdkVersion = String.valueOf(VERSION.SDK_INT); | 82 final String sdkVersion = String.valueOf(VERSION.SDK_INT); |
| 82 final String locale = context.getResources().getConfiguration().locale.toStr
ing(); | 83 final String locale = Locale.getDefault().toString().replace('_', '-'); |
| 83 final boolean developmentBuild = !context.getResources().getBoolean(R.bool.d
ef_release); | 84 final boolean developmentBuild = !context.getResources().getBoolean(R.bool.d
ef_release); |
| 84 | 85 |
| 85 return AppInfo.builder() | 86 return AppInfo.builder() |
| 86 .setVersion(version) | 87 .setVersion(version) |
| 87 .setApplicationVersion(sdkVersion) | 88 .setApplicationVersion(sdkVersion) |
| 88 .setLocale(locale) | 89 .setLocale(locale) |
| 89 .setDevelopmentBuild(developmentBuild) | 90 .setDevelopmentBuild(developmentBuild) |
| 90 .build(); | 91 .build(); |
| 91 } | 92 } |
| 92 | 93 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 270 |
| 270 public void updateSubscriptionStatus(final String url) | 271 public void updateSubscriptionStatus(final String url) |
| 271 { | 272 { |
| 272 final Subscription sub = this.filterEngine.getSubscription(url); | 273 final Subscription sub = this.filterEngine.getSubscription(url); |
| 273 if (sub != null) | 274 if (sub != null) |
| 274 { | 275 { |
| 275 Utils.updateSubscriptionStatus(this.context, sub); | 276 Utils.updateSubscriptionStatus(this.context, sub); |
| 276 } | 277 } |
| 277 } | 278 } |
| 278 } | 279 } |
| OLD | NEW |