Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2ae3a8e authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "MediaHTTPConnection: set connect time out"

parents 61044cfd 90b59750
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
    private static final String TAG = "MediaHTTPConnection";
    private static final boolean VERBOSE = false;

    // connection timeout - 30 sec
    private static final int CONNECT_TIMEOUT_MS = 30 * 1000;

    private long mCurrentOffset = -1;
    private URL mURL = null;
    private Map<String, String> mHeaders = null;
@@ -182,6 +185,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
                } else {
                    mConnection = (HttpURLConnection)url.openConnection();
                }
                mConnection.setConnectTimeout(CONNECT_TIMEOUT_MS);

                // handle redirects ourselves if we do not allow cross-domain redirect
                mConnection.setInstanceFollowRedirects(mAllowCrossDomainRedirect);