package o; import android.content.Context; 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.text.FirebaseVisionText; import com.google.firebase.ml.vision.text.FirebaseVisionTextRecognizer; import java.io.IOException; import java.util.ArrayList; import java.util.concurrent.atomic.AtomicBoolean; /* renamed from: o.fQQ, reason: case insensitive filesystem */ /* loaded from: classes5.dex */ public final class C13084fQQ implements OnSuccessListener, InterfaceC13090fQd { private static final AtomicBoolean a = new AtomicBoolean(false); private final FirebaseVisionTextRecognizer b = FirebaseVision.getInstance().getOnDeviceTextRecognizer(); public fQU c; private final Context d; @Override // com.google.android.gms.tasks.OnSuccessListener public final /* synthetic */ void onSuccess(FirebaseVisionText firebaseVisionText) { ArrayList arrayList = new ArrayList(); arrayList.add(firebaseVisionText); this.c.d(arrayList); } @Override // o.InterfaceC13090fQd public final void a(FirebaseVisionImage firebaseVisionImage, C13120fRb c13120fRb) { try { if (a.getAndSet(true)) { return; } this.b.processImage(firebaseVisionImage).addOnCompleteListener(new OnCompleteListener(this) { // from class: o.fQQ.2 private C13084fQQ d; @Override // com.google.android.gms.tasks.OnCompleteListener public final void onComplete(Task task) { C13084fQQ.a.set(false); } { this.d = this; } }).addOnSuccessListener(this); } catch (Throwable unused) { a.set(false); } } @Override // o.InterfaceC13090fQd public final void a() { try { this.c.b(); this.b.close(); } catch (IOException unused) { } } /* renamed from: o.fQQ$RVV */ /* loaded from: classes5.dex */ public static class RVV { public final C13084fQQ a; public RVV(Context context) { this.a = new C13084fQQ(context); } } public C13084fQQ(Context context) { this.d = context; } }