Skip to content

Commit

Permalink
[MOSYNC-2188] fixed the ICS networking issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Sarrafi committed May 23, 2012
1 parent e5f115c commit 18767eb
Showing 1 changed file with 16 additions and 4 deletions.
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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 =
Expand Down

0 comments on commit 18767eb

Please sign in to comment.