content: package okhttp3.internal.platform.android;
  
  import java.util.List;
  import javax.net.ssl.SSLSocket;
  import javax.net.ssl.SSLSocketFactory;
  import javax.net.ssl.X509TrustManager;
  import kotlin.Metadata;
  import kotlin.jvm.internal.Intrinsics;
  import okhttp3.Protocol;
  import okhttp3.internal.platform.android.SocketAdapter;
  
  @Metadata(bv = {1, 0, 3}, d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0003\u0018\u00002\u00020\u0001:\u0001\u0014B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J(\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\t2\b\u0010\n\u001a\u0004\u0018\u00010\u000b2\f\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u000e0\rH\u0016J\u0012\u0010\u000f\u001a\u0004\u0018\u00010\u00012\u0006\u0010\b\u001a\u00020\tH\u0002J\u0012\u0010\u0010\u001a\u0004\u0018\u00010\u000b2\u0006\u0010\b\u001a\u00020\tH\u0016J\b\u0010\u0011\u001a\u00020\u0012H\u0016J\u0010\u0010\u0013\u001a\u00020\u00122\u0006\u0010\b\u001a\u00020\tH\u0016R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0001X\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0004¢\u0006\u0002\n\u0000¨\u0006\u0015"}, d2 = {"Lokhttp3/internal/platform/android/DeferredSocketAdapter;", "Lokhttp3/internal/platform/android/SocketAdapter;", "socketAdapterFactory", "Lokhttp3/internal/platform/android/DeferredSocketAdapter$Factory;", "(Lokhttp3/internal/platform/android/DeferredSocketAdapter$Factory;)V", "delegate", "configureTlsExtensions", "", "sslSocket", "Ljavax/net/ssl/SSLSocket;", "hostname", "", "protocols", "", "Lokhttp3/Protocol;", "getDelegate", "getSelectedProtocol", "isSupported", "", "matchesSocket", "Factory", "okhttp"}, k = 1, mv = {1, 4, 0})
  /* compiled from: DeferredSocketAdapter.kt */
  public final class DeferredSocketAdapter implements SocketAdapter {
      private SocketAdapter delegate;
      private final Factory socketAdapterFactory;
  
      @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\bf\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H&J\u0010\u0010\u0006\u001a\u00020\u00072\u0006\u0010\u0004\u001a\u00020\u0005H&¨\u0006\b"}, d2 = {"Lokhttp3/internal/platform/android/DeferredSocketAdapter$Factory;", "", "create", "Lokhttp3/internal/platform/android/SocketAdapter;", "sslSocket", "Ljavax/net/ssl/SSLSocket;", "matchesSocket", "", "okhttp"}, k = 1, mv = {1, 4, 0})
      /* compiled from: DeferredSocketAdapter.kt */
      public interface Factory {
          SocketAdapter create(SSLSocket sSLSocket);
  
          boolean matchesSocket(SSLSocket sSLSocket);
      }
  
      public DeferredSocketAdapter(Factory socketAdapterFactory2) {
          Intrinsics.checkNotNullParameter(socketAdapterFactory2, "socketAdapterFactory");
          this.socketAdapterFactory = socketAdapterFactory2;
      }
  
      private final synchronized SocketAdapter getDelegate(SSLSocket sslSocket) {
          if (this.delegate == null && this.socketAdapterFactory.matchesSocket(sslSocket)) {
              this.delegate = this.socketAdapterFactory.create(sslSocket);
          }
          return this.delegate;
      }
  
      public void configureTlsExtensions(SSLSocket sslSocket, String hostname, List<? extends Protocol> protocols) {
          Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
          Intrinsics.checkNotNullParameter(protocols, "protocols");
          SocketAdapter delegate2 = getDelegate(sslSocket);
          if (delegate2 != null) {
              delegate2.configureTlsExtensions(sslSocket, hostname, protocols);
          }
      }
  
      public String getSelectedProtocol(SSLSocket sslSocket) {
          Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
          SocketAdapter delegate2 = getDelegate(sslSocket);
          if (delegate2 != null) {
              return delegate2.getSelectedProtocol(sslSocket);
          }
          return null;
      }
  
      public boolean isSupported() {
          return true;
      }
  
      public boolean matchesSocket(SSLSocket sslSocket) {
          Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
          return this.socketAdapterFactory.matchesSocket(sslSocket);
      }
  
      public boolean matchesSocketFactory(SSLSocketFactory sslSocketFactory) {
          Intrinsics.checkNotNullParameter(sslSocketFactory, "sslSocketFactory");
          return SocketAdapter.DefaultImpls.matchesSocketFactory(this, sslSocketFactory);
      }
  
      public X509TrustManager trustManager(SSLSocketFactory sslSocketFactory) {
          Intrinsics.checkNotNullParameter(sslSocketFactory, "sslSocketFactory");
          return SocketAdapter.DefaultImpls.trustManager(this, sslSocketFactory);
      }
  }
  