Permalink
Browse files

Merge pull request #153 from asarrafi/ThreeZeroTwo

[MOSYNC-2188] fixed the ICS networking issue.
  • Loading branch information...
2 parents e5f115c + 18767eb commit 1c893e769a4ed99920ea883b574f4097d55e9cb0 Ali Sarrafi committed May 23, 2012
@@ -72,6 +72,7 @@
import android.bluetooth.BluetoothServerSocket;
import android.bluetooth.BluetoothSocket;
import android.net.SSLCertificateSocketFactory;
+import android.os.Build;
import android.os.Looper;
import android.util.Log;
@@ -1128,8 +1129,14 @@ public ConnectionObject create(String url, int handle)
mUrlConnection = new URL(url).openConnection();
mUrlConnection.setAllowUserInteraction(true);
- mUrlConnection.setDoInput(true);
- mUrlConnection.setDoOutput(true);
+ // The number is hardcoded here for ICS but we have to change it to
+ // its actual constant after upgrading the our Android SDK
+ if(Build.VERSION.SDK_INT < 14)
+ {
+ mUrlConnection.setDoInput(true);
+ mUrlConnection.setDoOutput(true);
+ }
+
mUrlConnection.setUseCaches(false);
return this;
@@ -1146,8 +1153,13 @@ public ConnectionObject createHttp(String url, int method, int handle)
mUrlConnection = new URL(url).openConnection();
mUrlConnection.setAllowUserInteraction(true);
- mUrlConnection.setDoInput(true);
- mUrlConnection.setDoOutput(true);
+ // The number is hardcoded here for ICS but we have to change it to
+ // its actual constant after upgrading the our Android SDK
+ if(Build.VERSION.SDK_INT < 14)
+ {
+ mUrlConnection.setDoInput(true);
+ mUrlConnection.setDoOutput(true);
+ }
mUrlConnection.setUseCaches(false);
HttpURLConnection httpConnection =

0 comments on commit 1c893e7

Please sign in to comment.