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

Unified Diff: src/org/adblockplus/android/updater/AlarmReceiver.java

Issue 9752046: Add automatic updates for release builds (Closed)
Patch Set: Request WRITE_EXTERNAL_STORAGE permission for release builds as well Created March 15, 2013, 7:27 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
« no previous file with comments | « src/org/adblockplus/android/AdblockPlus.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/android/updater/AlarmReceiver.java
===================================================================
--- a/src/org/adblockplus/android/updater/AlarmReceiver.java
+++ b/src/org/adblockplus/android/updater/AlarmReceiver.java
@@ -107,7 +107,9 @@
String locale = Locale.getDefault().toString().toLowerCase();
String device = AdblockPlus.getDeviceName();
- URL updateUrl = new URL(String.format(context.getString(R.string.update_url), Build.VERSION.SDK_INT, AdblockPlus.getApplication().getBuildNumber(), locale, device));
+ boolean releaseBuild = context.getResources().getBoolean(R.bool.def_release);
+ String updateUrlTemplate = context.getString(releaseBuild ? R.string.update_url : R.string.devbuild_update_url);
+ URL updateUrl = new URL(String.format(updateUrlTemplate, Build.VERSION.SDK_INT, AdblockPlus.getApplication().getBuildNumber(), locale, device));
// The following line correctly url-encodes query string parameters
URI uri = new URI(updateUrl.getProtocol(), updateUrl.getUserInfo(), updateUrl.getHost(), updateUrl.getPort(), updateUrl.getPath(), updateUrl.getQuery(), updateUrl.getRef());
HttpGet httpGet = new HttpGet(uri);
« no previous file with comments | « src/org/adblockplus/android/AdblockPlus.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld