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

Delta Between Two Patch Sets: src/org/adblockplus/android/ABPEngine.java

Issue 5153282527854592: Issue 98 - Use the libadblockplus update mechanism (Closed)
Left Patch Set: Created Sept. 25, 2014, 3:57 p.m.
Right Patch Set: Only append the revision to the version for devbuilds Created Sept. 26, 2014, 2:54 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « res/values/strings.xml ('k') | src/org/adblockplus/android/AdblockPlus.java » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 private volatile UpdateCheckDoneCallback updateCheckDoneCallback; 63 private volatile UpdateCheckDoneCallback updateCheckDoneCallback;
64 private volatile FilterChangeCallback filterChangeCallback; 64 private volatile FilterChangeCallback filterChangeCallback;
65 65
66 private ABPEngine(final Context context) 66 private ABPEngine(final Context context)
67 { 67 {
68 this.context = context; 68 this.context = context;
69 } 69 }
70 70
71 public static AppInfo generateAppInfo(final Context context) 71 public static AppInfo generateAppInfo(final Context context)
72 { 72 {
73 final boolean developmentBuild = !context.getResources().getBoolean(R.bool.d ef_release);
73 String version = "0"; 74 String version = "0";
74 try 75 try
75 { 76 {
76 final PackageInfo info = context.getPackageManager().getPackageInfo(contex t.getPackageName(), 0); 77 final PackageInfo info = context.getPackageManager().getPackageInfo(contex t.getPackageName(), 0);
77 version = info.versionName + "." + info.versionCode; 78 version = info.versionName;
79 if (developmentBuild)
80 version += "." + info.versionCode;
78 } 81 }
79 catch (final NameNotFoundException e) 82 catch (final NameNotFoundException e)
80 { 83 {
81 Log.e(TAG, "Failed to get the application version number", e); 84 Log.e(TAG, "Failed to get the application version number", e);
82 } 85 }
83 final String sdkVersion = String.valueOf(VERSION.SDK_INT); 86 final String sdkVersion = String.valueOf(VERSION.SDK_INT);
84 final String locale = Locale.getDefault().toString().replace('_', '-'); 87 final String locale = Locale.getDefault().toString().replace('_', '-');
85 final boolean developmentBuild = !context.getResources().getBoolean(R.bool.d ef_release);
86 88
87 return AppInfo.builder() 89 return AppInfo.builder()
88 .setVersion(version) 90 .setVersion(version)
89 .setApplicationVersion(sdkVersion) 91 .setApplicationVersion(sdkVersion)
90 .setLocale(locale) 92 .setLocale(locale)
91 .setDevelopmentBuild(developmentBuild) 93 .setDevelopmentBuild(developmentBuild)
92 .build(); 94 .build();
93 } 95 }
94 96
95 public static ABPEngine create(final Context context, final AppInfo appInfo, f inal String basePath) 97 public static ABPEngine create(final Context context, final AppInfo appInfo, f inal String basePath)
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 272
271 public void updateSubscriptionStatus(final String url) 273 public void updateSubscriptionStatus(final String url)
272 { 274 {
273 final Subscription sub = this.filterEngine.getSubscription(url); 275 final Subscription sub = this.filterEngine.getSubscription(url);
274 if (sub != null) 276 if (sub != null)
275 { 277 {
276 Utils.updateSubscriptionStatus(this.context, sub); 278 Utils.updateSubscriptionStatus(this.context, sub);
277 } 279 }
278 } 280 }
279 } 281 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld