FaceRequestImpl$1.smali

.class Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Lcom/iflytek/cloud/msc/util/HttpRequest$HttpRequestListener;


# instance fields
.field final synthetic this$0:Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;


# direct methods
.method constructor <init>(Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;)V
    .registers 2

    .prologue
    .line 83
    iput-object p1, p0, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;->this$0:Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onError(Lcom/iflytek/cloud/SpeechError;)V
    .registers 4

    .prologue
    .line 87
    if-eqz p1, :cond_2e

    .line 89
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "upload error. please check net state:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {p1}, Lcom/iflytek/cloud/SpeechError;->getErrorCode()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

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

    .line 93
    :goto_1c
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;->this$0:Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;

    # getter for: Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;->mListener:Lcom/iflytek/cloud/RequestListener;
    invoke-static {v0}, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;->access$000(Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;)Lcom/iflytek/cloud/RequestListener;

    move-result-object v0

    if-eqz v0, :cond_2d

    .line 94
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;->this$0:Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;

    # getter for: Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;->mListener:Lcom/iflytek/cloud/RequestListener;
    invoke-static {v0}, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;->access$000(Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;)Lcom/iflytek/cloud/RequestListener;

    move-result-object v0

    invoke-interface {v0, p1}, Lcom/iflytek/cloud/RequestListener;->onCompleted(Lcom/iflytek/cloud/SpeechError;)V

    .line 96
    :cond_2d
    return-void

    .line 91
    :cond_2e
    const-string v0, "upload succeed"

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

    goto :goto_1c
.end method

.method public onResult(Lcom/iflytek/cloud/msc/util/HttpRequest;[B)V
    .registers 6

    .prologue
    .line 103
    if-eqz p2, :cond_27

    .line 105
    :try_start_2
    new-instance v0, Ljava/lang/String;

    const-string v1, "utf-8"

    invoke-direct {v0, p2, v1}, Ljava/lang/String;-><init>([BLjava/lang/String;)V

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

    .line 109
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 110
    const-string v0, "ret"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    .line 112
    if-eqz v0, :cond_28

    .line 114
    new-instance v1, Lcom/iflytek/cloud/SpeechError;

    const-string v2, "wfr"

    invoke-direct {v1, v0, v2}, Lcom/iflytek/cloud/SpeechError;-><init>(ILjava/lang/String;)V

    invoke-virtual {p0, v1}, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;->onError(Lcom/iflytek/cloud/SpeechError;)V

    .line 126
    :cond_27
    :goto_27
    return-void

    .line 116
    :cond_28
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;->this$0:Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;

    # getter for: Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;->mListener:Lcom/iflytek/cloud/RequestListener;
    invoke-static {v0}, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;->access$000(Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;)Lcom/iflytek/cloud/RequestListener;

    move-result-object v0

    if-eqz v0, :cond_3f

    .line 117
    const-string v0, "GetNotifyResult"

    const/4 v1, 0x0

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

    .line 118
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;->this$0:Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;

    # getter for: Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;->mListener:Lcom/iflytek/cloud/RequestListener;
    invoke-static {v0}, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;->access$000(Lcom/iflytek/cloud/speech/impl/FaceRequestImpl;)Lcom/iflytek/cloud/RequestListener;

    move-result-object v0

    invoke-interface {v0, p2}, Lcom/iflytek/cloud/RequestListener;->onBufferReceived([B)V

    .line 120
    :cond_3f
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;->onError(Lcom/iflytek/cloud/SpeechError;)V
    :try_end_43
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_43} :catch_44

    goto :goto_27

    .line 123
    :catch_44
    move-exception v0

    .line 124
    new-instance v0, Lcom/iflytek/cloud/SpeechError;

    const/16 v1, 0x4e24

    invoke-direct {v0, v1}, Lcom/iflytek/cloud/SpeechError;-><init>(I)V

    invoke-virtual {p0, v0}, Lcom/iflytek/cloud/speech/impl/FaceRequestImpl$1;->onError(Lcom/iflytek/cloud/SpeechError;)V

    goto :goto_27
.end method