IdentityVerifierImpl.smali

.class public Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
.super Lcom/iflytek/thirdparty/w;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl$InternalListener;
    }
.end annotation


# instance fields
.field private mRequestFocus:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 3

    .prologue
    .line 31
    invoke-direct {p0, p1}, Lcom/iflytek/thirdparty/w;-><init>(Landroid/content/Context;)V

    .line 28
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mRequestFocus:Z

    .line 32
    return-void
.end method

.method static synthetic access$200(Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;)Lcom/iflytek/thirdparty/s;
    .registers 2

    .prologue
    .line 25
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    return-object v0
.end method

.method static synthetic access$300(Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;)Landroid/content/Context;
    .registers 2

    .prologue
    .line 25
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$400(Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;)Z
    .registers 2

    .prologue
    .line 25
    iget-boolean v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mRequestFocus:Z

    return v0
.end method


# virtual methods
.method public cancel(Z)V
    .registers 5

    .prologue
    .line 127
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mContext:Landroid/content/Context;

    iget-boolean v1, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mRequestFocus:Z

    invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Lcom/iflytek/cloud/msc/util/FuncAdapter;->UnLock(Landroid/content/Context;Ljava/lang/Boolean;Landroid/media/AudioManager$OnAudioFocusChangeListener;)Z

    .line 128
    invoke-super {p0, p1}, Lcom/iflytek/thirdparty/w;->cancel(Z)V

    .line 129
    return-void
.end method

.method public execute(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/iflytek/cloud/IdentityListener;)I
    .registers 11

    .prologue
    const/4 v4, 0x0

    .line 109
    .line 111
    const-string v0, "sst"

    invoke-virtual {p0, v0, p2}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->setParameter(Ljava/lang/String;Ljava/lang/String;)Z

    .line 112
    invoke-virtual {p0, p4}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->startWorking(Lcom/iflytek/cloud/IdentityListener;)I

    move-result v0

    .line 113
    if-nez v0, :cond_18

    .line 114
    const/4 v3, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p3

    move v5, v4

    invoke-virtual/range {v0 .. v5}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->writeData(Ljava/lang/String;Ljava/lang/String;[BII)I

    move-result v0

    .line 115
    invoke-virtual {p0, p1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->stopWrite(Ljava/lang/String;)V

    .line 118
    :cond_18
    return v0
.end method

.method public isWorking()Z
    .registers 2

    .prologue
    .line 230
    invoke-virtual {p0}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->isRunning()Z

    move-result v0

    return v0
.end method

.method public pushSessionInfo(Ljava/lang/String;)V
    .registers 4

    .prologue
    .line 40
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mSynObj:Ljava/lang/Object;

    monitor-enter v1

    .line 41
    :try_start_3
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    if-eqz v0, :cond_12

    .line 42
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    check-cast v0, Lcom/iflytek/thirdparty/r;

    invoke-virtual {v0}, Lcom/iflytek/thirdparty/r;->f()Lcom/iflytek/thirdparty/u;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/iflytek/thirdparty/u;->a(Ljava/lang/String;)V

    .line 44
    :cond_12
    monitor-exit v1

    .line 45
    return-void

    .line 44
    :catchall_14
    move-exception v0

    monitor-exit v1
    :try_end_16
    .catchall {:try_start_3 .. :try_end_16} :catchall_14

    throw v0
.end method

.method public startWorking(Lcom/iflytek/cloud/IdentityListener;)I
    .registers 8

    .prologue
    const/4 v1, 0x0

    .line 48
    .line 50
    iget-object v2, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mSynObj:Ljava/lang/Object;

    monitor-enter v2

    .line 52
    :try_start_4
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v3, "request_audio_focus"

    const/4 v4, 0x1

    invoke-virtual {v0, v3, v4}, Lcom/iflytek/thirdparty/ad;->a(Ljava/lang/String;Z)Z

    move-result v0

    iput-boolean v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mRequestFocus:Z

    .line 54
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    if-eqz v0, :cond_29

    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    invoke-virtual {v0}, Lcom/iflytek/thirdparty/s;->isRunning()Z

    move-result v0

    if-eqz v0, :cond_29

    .line 56
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v4, "mfv_interrupt_error"

    const/4 v5, 0x0

    invoke-virtual {v3, v4, v5}, Lcom/iflytek/thirdparty/ad;->a(Ljava/lang/String;Z)Z

    move-result v3

    invoke-virtual {v0, v3}, Lcom/iflytek/thirdparty/s;->cancel(Z)V

    .line 60
    :cond_29
    new-instance v0, Lcom/iflytek/thirdparty/r;

    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mContext:Landroid/content/Context;

    iget-object v4, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v5, "mfv"

    invoke-virtual {p0, v5}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->getHandlerThread(Ljava/lang/String;)Landroid/os/HandlerThread;

    move-result-object v5

    invoke-direct {v0, v3, v4, v5}, Lcom/iflytek/thirdparty/r;-><init>(Landroid/content/Context;Lcom/iflytek/thirdparty/ad;Landroid/os/HandlerThread;)V

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    .line 62
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mContext:Landroid/content/Context;

    iget-boolean v3, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mRequestFocus:Z

    invoke-static {v3}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v3

    const/4 v4, 0x0

    invoke-static {v0, v3, v4}, Lcom/iflytek/cloud/msc/util/FuncAdapter;->Lock(Landroid/content/Context;Ljava/lang/Boolean;Landroid/media/AudioManager$OnAudioFocusChangeListener;)Z

    .line 63
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    check-cast v0, Lcom/iflytek/thirdparty/r;

    new-instance v3, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl$InternalListener;

    invoke-direct {v3, p0, p1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl$InternalListener;-><init>(Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;Lcom/iflytek/cloud/IdentityListener;)V

    invoke-virtual {v0, v3}, Lcom/iflytek/thirdparty/r;->a(Lcom/iflytek/cloud/IdentityListener;)V
    :try_end_52
    .catch Lcom/iflytek/cloud/SpeechError; {:try_start_4 .. :try_end_52} :catch_55
    .catch Ljava/lang/Throwable; {:try_start_4 .. :try_end_52} :catch_5f
    .catchall {:try_start_4 .. :try_end_52} :catchall_67

    move v0, v1

    .line 71
    :goto_53
    :try_start_53
    monitor-exit v2

    .line 73
    return v0

    .line 64
    :catch_55
    move-exception v0

    .line 65
    invoke-virtual {v0}, Lcom/iflytek/cloud/SpeechError;->getErrorCode()I

    move-result v1

    .line 66
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V

    move v0, v1

    .line 70
    goto :goto_53

    .line 67
    :catch_5f
    move-exception v0

    .line 68
    const/16 v1, 0x5207

    .line 69
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V

    move v0, v1

    goto :goto_53

    .line 71
    :catchall_67
    move-exception v0

    monitor-exit v2
    :try_end_69
    .catchall {:try_start_53 .. :try_end_69} :catchall_67

    throw v0
.end method

.method public stopWrite(Ljava/lang/String;)V
    .registers 5

    .prologue
    .line 101
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mSynObj:Ljava/lang/Object;

    monitor-enter v1

    .line 102
    :try_start_3
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    if-eqz v0, :cond_f

    .line 103
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    check-cast v0, Lcom/iflytek/thirdparty/r;

    const/4 v2, 0x1

    invoke-virtual {v0, p1, v2}, Lcom/iflytek/thirdparty/r;->a(Ljava/lang/String;Z)Z

    .line 105
    :cond_f
    monitor-exit v1

    .line 106
    return-void

    .line 105
    :catchall_11
    move-exception v0

    monitor-exit v1
    :try_end_13
    .catchall {:try_start_3 .. :try_end_13} :catchall_11

    throw v0
.end method

.method public writeData(Ljava/lang/String;Ljava/lang/String;[BII)I
    .registers 13

    .prologue
    const/16 v0, 0x277d

    .line 78
    iget-object v6, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mSynObj:Ljava/lang/Object;

    monitor-enter v6

    .line 79
    :try_start_5
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    if-nez v1, :cond_12

    .line 80
    const-string v0, "writeAudio error, no active session."

    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V

    .line 81
    const/16 v0, 0x520c

    monitor-exit v6

    .line 96
    :goto_11
    return v0

    .line 84
    :cond_12
    if-gez p5, :cond_1e

    .line 85
    const-string v1, "writeAudio error, length < 0."

    invoke-static {v1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V

    .line 86
    monitor-exit v6

    goto :goto_11

    .line 97
    :catchall_1b
    move-exception v0

    monitor-exit v6
    :try_end_1d
    .catchall {:try_start_5 .. :try_end_1d} :catchall_1b

    throw v0

    .line 89
    :cond_1e
    if-eqz p3, :cond_2c

    :try_start_20
    array-length v1, p3

    add-int v2, p5, p4

    if-ge v1, v2, :cond_2c

    .line 90
    const-string v1, "writeAudio error, buffer length < offset + length."

    invoke-static {v1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V

    .line 91
    monitor-exit v6

    goto :goto_11

    .line 94
    :cond_2c
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->mscer:Lcom/iflytek/thirdparty/s;

    check-cast v0, Lcom/iflytek/thirdparty/r;

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move v4, p4

    move v5, p5

    invoke-virtual/range {v0 .. v5}, Lcom/iflytek/thirdparty/r;->a(Ljava/lang/String;Ljava/lang/String;[BII)V

    .line 96
    const/4 v0, 0x0

    monitor-exit v6
    :try_end_3a
    .catchall {:try_start_20 .. :try_end_3a} :catchall_1b

    goto :goto_11
.end method