package o; import android.util.SparseArray; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.android.gms.tasks.Task; import com.google.firebase.ml.vision.FirebaseVision; import com.google.firebase.ml.vision.common.FirebaseVisionImage; import com.google.firebase.ml.vision.face.FirebaseVisionFace; import com.google.firebase.ml.vision.face.FirebaseVisionFaceDetector; import com.google.firebase.ml.vision.face.FirebaseVisionFaceDetectorOptions; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; /* renamed from: o.fRc, reason: case insensitive filesystem */ /* loaded from: classes5.dex */ public final class C13121fRc implements InterfaceC13090fQd { private static FirebaseVisionImage a; private static final AtomicBoolean c = new AtomicBoolean(false); private static List e = null; public fQU b; private FirebaseVisionFaceDetector j = FirebaseVision.getInstance().getVisionFaceDetector(new FirebaseVisionFaceDetectorOptions.Builder().setClassificationMode(2).setContourMode(2).setLandmarkMode(2).setPerformanceMode(1).setMinFaceSize(0.15f).enableTracking().build()); private final SparseArray d = new SparseArray<>(); public static FirebaseVisionImage e() { return a; } public static List b() { return e; } @Override // o.InterfaceC13090fQd public final void a(FirebaseVisionImage firebaseVisionImage, C13120fRb c13120fRb) { try { if (c.getAndSet(true)) { return; } a = firebaseVisionImage; this.j.detectInImage(firebaseVisionImage).addOnCompleteListener(new OnCompleteListener>(this) { // from class: o.fRc.3 private C13121fRc a; @Override // com.google.android.gms.tasks.OnCompleteListener public final void onComplete(Task> task) { C13121fRc.c.set(false); } { this.a = this; } }).addOnSuccessListener(new OnSuccessListener>(this, c13120fRb) { // from class: o.fRc.2 private C13120fRb a; private C13121fRc d; @Override // com.google.android.gms.tasks.OnSuccessListener public final /* synthetic */ void onSuccess(List list) { ArrayList arrayList = new ArrayList(); for (FirebaseVisionFace firebaseVisionFace : list) { boolean z = true; if (this.a.e != 1) { z = false; } arrayList.add(new C13099fQm(firebaseVisionFace, z)); } List unused = C13121fRc.e = arrayList; this.d.b.d(arrayList); } { this.d = this; this.a = c13120fRb; } }); } catch (Throwable unused) { c.set(false); } } @Override // o.InterfaceC13090fQd public final void a() { this.b.b(); } }