BearND has uploaded a new change for review. https://gerrit.wikimedia.org/r/175588
Change subject: Updated squareup libraries ...................................................................... Updated squareup libraries The big change is in OkHttp from 1.3 to 2.1. A few API changes regarding caches required code changes. See https://github.com/square/okhttp/blob/master/CHANGELOG.md for full list. Also remove explicit entry for support-v4 since it's transitively included through the appcompat-v7 dependency. That way we don't accidentally have incompatible versions of those two. Change-Id: I0b2532276c72757e5941aef63cfc2f2dea8445ad --- M wikipedia/build.gradle M wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java 2 files changed, 9 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/88/175588/1 diff --git a/wikipedia/build.gradle b/wikipedia/build.gradle index d6506f4..b4d44ae 100644 --- a/wikipedia/build.gradle +++ b/wikipedia/build.gradle @@ -97,21 +97,17 @@ compile('org.mediawiki.api:json:1.3-SNAPSHOT') { exclude group: 'org.json', module: 'json' } - compile 'com.squareup.okhttp:okhttp:1.3.0' -// compile 'com.squareup.okhttp:okhttp:1.6.0' - // maybe even 2.0.0 - compile 'com.squareup:otto:1.3.4' -// compile 'com.squareup:otto:1.3.5' - compile 'com.squareup.picasso:picasso:2.1.1' -// compile 'com.squareup.picasso:picasso:2.3.2' + compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0' + compile 'com.squareup.okhttp:okhttp:2.1.0' + compile 'com.squareup:otto:1.3.5' + compile 'com.squareup.picasso:picasso:2.4.0' compile 'com.mobsandgeeks:android-saripaar:1.0.3' compile 'com.nineoldandroids:library:2.4.0' compile('ch.acra:acra:4.5.0') { exclude group: 'org.json', module: 'json' } compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@aar' - compile 'com.android.support:support-v4:21.0.2' - compile 'com.android.support:appcompat-v7:21.0.2' + compile 'com.android.support:appcompat-v7:21.0.2' // includes support-v4 } // The next block is for setting the release signing config from a file outside the git repo diff --git a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java index e7bfb04..245062d 100644 --- a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java +++ b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java @@ -2,8 +2,9 @@ import android.content.Context; import com.github.kevinsawicki.http.HttpRequest; -import com.squareup.okhttp.HttpResponseCache; +import com.squareup.okhttp.Cache; import com.squareup.okhttp.OkHttpClient; +import com.squareup.okhttp.OkUrlFactory; import java.io.IOException; import java.net.HttpURLConnection; @@ -20,7 +21,7 @@ client.setCookieHandler(((WikipediaApp)context.getApplicationContext()).getCookieManager()); try { - client.setResponseCache(new HttpResponseCache(context.getCacheDir(), HTTP_CACHE_SIZE)); + client.setCache(new Cache(context.getCacheDir(), HTTP_CACHE_SIZE)); } catch (IOException e) { // Shouldn't happen... throw new RuntimeException(e); @@ -28,7 +29,7 @@ } public HttpURLConnection create(URL url) throws IOException { - return client.open(url); + return new OkUrlFactory(client).open(url); } @Override -- To view, visit https://gerrit.wikimedia.org/r/175588 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b2532276c72757e5941aef63cfc2f2dea8445ad Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: BearND <bsitzm...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits