package com.discord.stores; import c.d.b.a.a; import com.discord.app.AppLog; import com.discord.models.domain.ModelRtcLatencyRegion; import d0.z.d.m; import d0.z.d.o; import java.util.ArrayList; import java.util.List; import kotlin.Unit; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; /* compiled from: StoreRtcRegion.kt */ public final class StoreRtcRegion$maybePerformLatencyTest$1 extends o implements Function0 { public final /* synthetic */ List $regionsWithIps; public final /* synthetic */ StoreRtcRegion this$0; /* compiled from: StoreRtcRegion.kt */ /* renamed from: com.discord.stores.StoreRtcRegion$maybePerformLatencyTest$1$1 reason: invalid class name */ public static final class AnonymousClass1 extends o implements Function1, Unit> { public final /* synthetic */ List $newGeoRankedRegions; public final /* synthetic */ long $timeNowMs; public final /* synthetic */ StoreRtcRegion$maybePerformLatencyTest$1 this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass1(StoreRtcRegion$maybePerformLatencyTest$1 storeRtcRegion$maybePerformLatencyTest$1, List list, long j) { super(1); this.this$0 = storeRtcRegion$maybePerformLatencyTest$1; this.$newGeoRankedRegions = list; this.$timeNowMs = j; } /* 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 /* bridge */ /* synthetic */ Unit invoke(List list) { invoke((List) list); return Unit.a; } public final void invoke(List list) { m.checkNotNullParameter(list, "latencyRankedRegions"); AppLog.i("RTC region latency test ranking is " + list); StoreRtcRegion.access$updateLastTestResult(this.this$0.this$0, new RtcLatencyTestResult(list, this.$newGeoRankedRegions, this.$timeNowMs)); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public StoreRtcRegion$maybePerformLatencyTest$1(StoreRtcRegion storeRtcRegion, List list) { super(0); this.this$0 = storeRtcRegion; this.$regionsWithIps = list; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { List list = this.$regionsWithIps; ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(list, 10)); for (ModelRtcLatencyRegion modelRtcLatencyRegion : list) { arrayList.add(modelRtcLatencyRegion.getRegion()); } long currentTimeMillis = StoreRtcRegion.access$getClock$p(this.this$0).currentTimeMillis(); if (StoreRtcRegion.access$shouldPerformLatencyTest(this.this$0, arrayList, currentTimeMillis)) { StoreRtcRegion.access$getStoreMediaEngine$p(this.this$0).getRankedRtcRegions(this.$regionsWithIps, new AnonymousClass1(this, arrayList, currentTimeMillis)); return; } StringBuilder L = a.L("RTC region latency test cached preferred region is "); L.append(this.this$0.getPreferredRegion()); AppLog.i(L.toString()); } }