2021-08-03 07:33:18 +00:00
package defpackage ;
2021-11-02 06:38:17 +00:00
import c.a.q.m0.c.e ;
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 ;
2021-08-03 07:33:18 +00:00
/* compiled from: kotlin-style lambda group */
/* renamed from: l reason: default package */
2021-11-02 06:38:17 +00:00
public final class l extends o implements Function1 < MediaEngineConnection . d , Unit > {
2021-12-02 18:53:44 +00:00
public final /* synthetic */ int j ;
2021-11-02 06:38:17 +00:00
public final /* synthetic */ Object k ;
2021-12-02 18:53:44 +00:00
public final /* synthetic */ Object l ;
2021-08-03 07:33:18 +00:00
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
2021-11-02 06:38:17 +00:00
public l ( int i , Object obj , Object obj2 ) {
super ( 1 ) ;
2021-12-02 18:53:44 +00:00
this . j = i ;
this . k = obj ;
this . l = obj2 ;
2021-08-03 07:33:18 +00:00
}
/* Return type fixed from 'java.lang.Object' to match base method */
2021-11-02 06:38:17 +00:00
/* 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 . d dVar ) {
MediaEngineConnection . FailedConnectionException . FailureType failureType ;
2021-12-02 18:53:44 +00:00
int i = this . j ;
2021-08-03 07:33:18 +00:00
if ( i = = 0 ) {
2021-11-02 06:38:17 +00:00
MediaEngineConnection . d dVar2 = dVar ;
m . checkNotNullParameter ( dVar2 , " it " ) ;
2021-12-02 18:53:44 +00:00
e eVar = ( e ) this . k ;
dVar2 . onConnected ( eVar , ( MediaEngineConnection . TransportInfo ) this . l , eVar . i ) ;
2021-11-02 06:38:17 +00:00
return Unit . a ;
2021-08-03 07:33:18 +00:00
} else if ( i = = 1 ) {
2021-11-02 06:38:17 +00:00
MediaEngineConnection . d dVar3 = dVar ;
m . checkNotNullParameter ( dVar3 , " it " ) ;
2021-12-02 18:53:44 +00:00
dVar3 . onError ( ( e ) this . k , new MediaEngineConnection . FailedConnectionException ( " No connection info. Error message from media engine: " + ( ( String ) this . l ) , MediaEngineConnection . FailedConnectionException . FailureType . NO_CONNECTION_INFO ) ) ;
2021-11-02 06:38:17 +00:00
return Unit . a ;
2021-08-03 07:33:18 +00:00
} else if ( i = = 2 ) {
2021-11-02 06:38:17 +00:00
MediaEngineConnection . d dVar4 = dVar ;
m . checkNotNullParameter ( dVar4 , " it " ) ;
2021-12-02 18:53:44 +00:00
e eVar2 = ( e ) this . k ;
String str = ( String ) this . l ;
2021-11-02 06:38:17 +00:00
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 ;
}
}
dVar4 . onError ( eVar2 , new MediaEngineConnection . FailedConnectionException ( str , failureType ) ) ;
return Unit . a ;
2021-08-03 07:33:18 +00:00
} else {
throw null ;
}
}
}