2021-06-27 20:44:35 +00:00
package defpackage ;
2021-06-27 20:53:42 +00:00
import c.a.r.j0.c.e ;
2021-06-27 20:44:35 +00:00
import com.discord.rtcconnection.mediaengine.MediaEngineConnection ;
import d0.g0.w ;
import d0.z.d.m ;
import d0.z.d.o ;
import java.util.Objects ;
import kotlin.Unit ;
import kotlin.jvm.functions.Function1 ;
/* compiled from: kotlin-style lambda group */
/* renamed from: l reason: default package */
public final class l extends o implements Function1 < MediaEngineConnection . c , Unit > {
public final /* synthetic */ int i ;
public final /* synthetic */ Object j ;
public final /* synthetic */ Object k ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public l ( int i , Object obj , Object obj2 ) {
super ( 1 ) ;
this . i = i ;
this . j = obj ;
this . k = obj2 ;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public final Unit invoke ( MediaEngineConnection . c cVar ) {
MediaEngineConnection . FailedConnectionException . FailureType failureType ;
int i = this . i ;
if ( i = = 0 ) {
MediaEngineConnection . c cVar2 = cVar ;
m . checkNotNullParameter ( cVar2 , " it " ) ;
e eVar = ( e ) this . j ;
cVar2 . onConnected ( eVar , ( MediaEngineConnection . TransportInfo ) this . k , eVar . j ) ;
return Unit . a ;
} else if ( i = = 1 ) {
MediaEngineConnection . c cVar3 = cVar ;
m . checkNotNullParameter ( cVar3 , " it " ) ;
cVar3 . onError ( ( e ) this . j , new MediaEngineConnection . FailedConnectionException ( " No connection info. Error message from media engine: " + ( ( String ) this . k ) , MediaEngineConnection . FailedConnectionException . FailureType . NO_CONNECTION_INFO ) ) ;
return Unit . a ;
} else if ( i = = 2 ) {
MediaEngineConnection . c cVar4 = cVar ;
m . checkNotNullParameter ( cVar4 , " it " ) ;
e eVar2 = ( e ) this . j ;
String str = ( String ) this . k ;
Objects . requireNonNull ( MediaEngineConnection . FailedConnectionException . FailureType . Companion ) ;
boolean z2 = false ;
if ( str ! = null ? w . contains ( ( CharSequence ) str , ( CharSequence ) " Disconnected before we managed to connect " , true ) : false ) {
failureType = MediaEngineConnection . FailedConnectionException . FailureType . DISCONNECTED_BEFORE_CONNECTION_ESTABLISHED ;
} else {
if ( str ! = null ? w . contains ( ( CharSequence ) str , ( CharSequence ) " OnConnectAttemptTimedOut " , true ) : false ) {
failureType = MediaEngineConnection . FailedConnectionException . FailureType . TIMEOUT ;
} else {
if ( str ! = null ) {
z2 = w . contains ( ( CharSequence ) str , ( CharSequence ) " OnAddressIPResolved " , true ) ;
}
failureType = z2 ? MediaEngineConnection . FailedConnectionException . FailureType . ADDRESS_IP_RESOLVED : MediaEngineConnection . FailedConnectionException . FailureType . UNKNOWN ;
}
}
cVar4 . onError ( eVar2 , new MediaEngineConnection . FailedConnectionException ( str , failureType ) ) ;
return Unit . a ;
} else {
throw null ;
}
}
}