package a3;

import android.content.Context;
import android.speech.SpeechRecognizer;
import m3.AbstractC2467b;

/* JADX INFO: loaded from: classes.dex */
public final class a0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Context f10615a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public SpeechRecognizer f10616b;

    public a0(Context context) {
        this.f10615a = context.getApplicationContext();
    }

    public final boolean a() {
        return SpeechRecognizer.isRecognitionAvailable(this.f10615a);
    }

    public final void b() {
        try {
            SpeechRecognizer speechRecognizer = this.f10616b;
            if (speechRecognizer != null) {
                speechRecognizer.stopListening();
            }
            SpeechRecognizer speechRecognizer2 = this.f10616b;
            if (speechRecognizer2 != null) {
                speechRecognizer2.destroy();
            }
        } catch (Throwable th) {
            AbstractC2467b.d(th);
        }
        this.f10616b = null;
    }
}
