Merge "Replace interal okhttp APIs" am: 4fe7ff8d1f am: 7bd3aa2a13 am: 542786989d

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622669

Change-Id: Ida687a8987385ef4525e41e609d7c8fedda9f1da
This commit is contained in:
Paul Hu
2021-03-17 16:07:31 +00:00
committed by Automerger Merge Worker

View File

@@ -30,10 +30,10 @@ import android.system.OsConstants;
import android.util.proto.ProtoOutputStream;
import com.android.internal.annotations.GuardedBy;
import com.android.okhttp.internalandroidapi.Dns;
import com.android.okhttp.internalandroidapi.HttpURLConnectionFactory;
import libcore.io.IoUtils;
import libcore.net.http.Dns;
import libcore.net.http.HttpURLConnectionFactory;
import java.io.FileDescriptor;
import java.io.IOException;
@@ -299,7 +299,7 @@ public class Network implements Parcelable {
// Set configuration on the HttpURLConnectionFactory that will be good for all
// connections created by this Network. Configuration that might vary is left
// until openConnection() and passed as arguments.
HttpURLConnectionFactory urlConnectionFactory = new HttpURLConnectionFactory();
HttpURLConnectionFactory urlConnectionFactory = HttpURLConnectionFactory.createInstance();
urlConnectionFactory.setDns(dnsLookup); // Let traffic go via dnsLookup
// A private connection pool just for this Network.
urlConnectionFactory.setNewConnectionPool(httpMaxConnections,