VoiceWakeuperImpl.smali

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


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


# static fields
.field private static RESPATH:Ljava/lang/String;


# instance fields
.field private isUserPath:Z

.field private mCfgPath:Ljava/lang/String;

.field private mCfgThreshold:Ljava/lang/String;

.field private mConfig:Lcom/iflytek/cloud/msc/util/Config;

.field private mOptimizeManager:Lcom/iflytek/thirdparty/l;

.field private mRequestFocus:Z

.field private mUserCmdPath:Ljava/lang/String;

.field private mUserCommonPath:Ljava/lang/String;

.field private mUserPath:Ljava/lang/String;

.field private mUserThreshold:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 55
    const-string v0, "respath"

    sput-object v0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->RESPATH:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .registers 4

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

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

    .line 45
    iput-boolean v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mRequestFocus:Z

    .line 47
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

    .line 48
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCommonPath:Ljava/lang/String;

    .line 49
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCmdPath:Ljava/lang/String;

    .line 50
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserThreshold:Ljava/lang/String;

    .line 51
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    .line 52
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgThreshold:Ljava/lang/String;

    .line 53
    iput-boolean v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isUserPath:Z

    .line 57
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    .line 59
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

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

    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/Config;->getConfig(Landroid/content/Context;)Lcom/iflytek/cloud/msc/util/Config;

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    .line 64
    return-void
.end method

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

    .prologue
    .line 42
    invoke-direct {p0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isQueryEnable()Z

    move-result v0

    return v0
.end method

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

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

    return v0
.end method

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

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

    return-object v0
.end method

.method static synthetic access$300(Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;)Lcom/iflytek/cloud/msc/util/Config;
    .registers 2

    .prologue
    .line 42
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    return-object v0
.end method

.method static synthetic access$500(Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;Z)V
    .registers 2

    .prologue
    .line 42
    invoke-direct {p0, p1}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->restartWorking(Z)V

    return-void
.end method

.method static synthetic access$700(Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;)Lcom/iflytek/thirdparty/ad;
    .registers 2

    .prologue
    .line 42
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    return-object v0
.end method

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

    .prologue
    .line 42
    invoke-direct {p0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->getIsUserPath()Z

    move-result v0

    return v0
.end method

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

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

    return-object v0
.end method

.method private declared-synchronized getIsUserPath()Z
    .registers 2

    .prologue
    .line 378
    monitor-enter p0

    :try_start_1
    iget-boolean v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isUserPath:Z
    :try_end_3
    .catchall {:try_start_1 .. :try_end_3} :catchall_5

    monitor-exit p0

    return v0

    :catchall_5
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method private isNetResourceNew()Z
    .registers 4

    .prologue
    .line 406
    const/4 v0, 0x0

    .line 408
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_12

    .line 409
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_13

    .line 410
    const/4 v0, 0x1

    .line 418
    :cond_12
    :goto_12
    return v0

    .line 412
    :cond_13
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    const-string v1, ""

    invoke-static {v0, v1}, Lcom/iflytek/thirdparty/l;->b(Ljava/lang/String;Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    .line 413
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCmdPath:Ljava/lang/String;

    const-string v2, ""

    invoke-static {v1, v2}, Lcom/iflytek/thirdparty/l;->b(Ljava/lang/String;Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    .line 414
    invoke-static {v0, v1}, Lcom/iflytek/thirdparty/l;->a(Lorg/json/JSONObject;Lorg/json/JSONObject;)Z

    move-result v0

    goto :goto_12
.end method

.method private isQueryEnable()Z
    .registers 4

    .prologue
    const/4 v0, 0x0

    .line 399
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v2, "ivw_net_mode"

    invoke-virtual {v1, v2, v0}, Lcom/iflytek/thirdparty/ad;->a(Ljava/lang/String;I)I

    move-result v1

    .line 401
    const/4 v2, 0x2

    if-eq v2, v1, :cond_17

    const/4 v2, 0x4

    if-ne v2, v1, :cond_18

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

    .line 402
    invoke-static {v1}, Lcom/iflytek/cloud/msc/util/NetworkUtil;->isWifiConnect(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_18

    :cond_17
    const/4 v0, 0x1

    .line 401
    :cond_18
    return v0
.end method

.method private restartWorking(Z)V
    .registers 8

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

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

    const-string v1, "restart wake ,isError:"

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

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Z)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;->LogD(Ljava/lang/String;)V

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

    monitor-enter v1

    .line 273
    if-eqz p1, :cond_2b

    .line 275
    const/4 v0, 0x0

    :try_start_1c
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

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

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

    invoke-virtual {v0}, Lcom/iflytek/thirdparty/k;->e()Lcom/iflytek/cloud/WakeuperListener;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->startWorking(Lcom/iflytek/cloud/WakeuperListener;)I

    .line 294
    :cond_29
    :goto_29
    monitor-exit v1

    .line 295
    return-void

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

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

    move-result v0

    if-eqz v0, :cond_29

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

    sget-object v2, Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;->path:Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;

    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    const-string v4, "ivw_config_path"

    const/4 v5, 0x0

    .line 286
    invoke-virtual {v3, v4, v5}, Lcom/iflytek/cloud/msc/util/Config;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 285
    invoke-static {v0, v2, v3}, Lcom/iflytek/cloud/util/ResourceUtil;->generateResourcePath(Landroid/content/Context;Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    .line 287
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    const-string v2, "cfg_threshold"

    const/4 v3, 0x0

    invoke-virtual {v0, v2, v3}, Lcom/iflytek/cloud/msc/util/Config;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgThreshold:Ljava/lang/String;

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

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

    invoke-virtual {v0}, Lcom/iflytek/thirdparty/k;->e()Lcom/iflytek/cloud/WakeuperListener;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->startWorking(Lcom/iflytek/cloud/WakeuperListener;)I

    goto :goto_29

    .line 294
    :catchall_5d
    move-exception v0

    monitor-exit v1
    :try_end_5f
    .catchall {:try_start_1c .. :try_end_5f} :catchall_5d

    throw v0
.end method

.method private declared-synchronized setIsUserPath(Z)V
    .registers 3

    .prologue
    .line 374
    monitor-enter p0

    :try_start_1
    iput-boolean p1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isUserPath:Z
    :try_end_3
    .catchall {:try_start_1 .. :try_end_3} :catchall_5

    .line 375
    monitor-exit p0

    return-void

    .line 374
    :catchall_5
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method private startWorking(Lcom/iflytek/cloud/WakeuperListener;)I
    .registers 8

    .prologue
    const/4 v1, 0x0

    .line 197
    .line 199
    iget-object v2, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSynObj:Ljava/lang/Object;

    monitor-enter v2

    .line 202
    :try_start_4
    invoke-direct {p0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isQueryEnable()Z

    move-result v0

    if-eqz v0, :cond_a5

    invoke-direct {p0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isNetResourceNew()Z

    move-result v0

    if-eqz v0, :cond_a5

    .line 203
    const-string v0, "ivw use resource from server"

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

    .line 205
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCommonPath:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_88

    .line 206
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    .line 210
    :goto_1f
    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v4, "ivw_res_path"

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

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

    const-string v3, "ivw_threshold"

    const/4 v4, 0x0

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

    .line 212
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->setIsUserPath(Z)V

    .line 220
    :goto_32
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v3, "request_audio_focus"

    const/4 v4, 0x0

    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/VoiceWakeuperImpl;->mRequestFocus:Z

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

    if-eqz v0, :cond_51

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

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

    move-result v0

    if-eqz v0, :cond_51

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

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

    const/4 v3, 0x0

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

    .line 227
    :cond_51
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v3, "ivw_channel_num"

    const/4 v4, 0x0

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

    move-result v0

    .line 228
    if-nez v0, :cond_c7

    .line 229
    new-instance v0, Lcom/iflytek/thirdparty/k;

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

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

    const-string v5, "wakeuper"

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

    move-result-object v5

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

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

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

    iget-boolean v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->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 238
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mscer:Lcom/iflytek/thirdparty/s;

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

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

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

    .line 239
    invoke-virtual {v0, v3}, Lcom/iflytek/thirdparty/k;->a(Lcom/iflytek/cloud/WakeuperListener;)V
    :try_end_85
    .catch Lcom/iflytek/cloud/SpeechError; {:try_start_4 .. :try_end_85} :catch_bd
    .catch Ljava/lang/Throwable; {:try_start_4 .. :try_end_85} :catch_d9
    .catchall {:try_start_4 .. :try_end_85} :catchall_e1

    move v0, v1

    .line 247
    :goto_86
    :try_start_86
    monitor-exit v2
    :try_end_87
    .catchall {:try_start_86 .. :try_end_87} :catchall_e1

    .line 249
    return v0

    .line 208
    :cond_88
    :try_start_88
    new-instance v0, Ljava/lang/StringBuilder;

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

    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCommonPath:Ljava/lang/String;

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

    move-result-object v0

    const-string v3, ";"

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

    move-result-object v0

    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

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

    move-result-object v0

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

    move-result-object v0

    goto/16 :goto_1f

    .line 215
    :cond_a5
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v3, "ivw_res_path"

    iget-object v4, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

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

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

    const-string v3, "ivw_threshold"

    iget-object v4, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserThreshold:Ljava/lang/String;

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

    .line 217
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->setIsUserPath(Z)V
    :try_end_bb
    .catch Lcom/iflytek/cloud/SpeechError; {:try_start_88 .. :try_end_bb} :catch_bd
    .catch Ljava/lang/Throwable; {:try_start_88 .. :try_end_bb} :catch_d9
    .catchall {:try_start_88 .. :try_end_bb} :catchall_e1

    goto/16 :goto_32

    .line 240
    :catch_bd
    move-exception v0

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

    move-result v1

    .line 242
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V
    :try_end_c5
    .catchall {:try_start_be .. :try_end_c5} :catchall_e1

    move v0, v1

    .line 246
    goto :goto_86

    .line 232
    :cond_c7
    :try_start_c7
    new-instance v0, Lcom/iflytek/thirdparty/i;

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

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

    const-string v5, "wakeuper"

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

    move-result-object v5

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

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mscer:Lcom/iflytek/thirdparty/s;
    :try_end_d8
    .catch Lcom/iflytek/cloud/SpeechError; {:try_start_c7 .. :try_end_d8} :catch_bd
    .catch Ljava/lang/Throwable; {:try_start_c7 .. :try_end_d8} :catch_d9
    .catchall {:try_start_c7 .. :try_end_d8} :catchall_e1

    goto :goto_6d

    .line 243
    :catch_d9
    move-exception v0

    .line 244
    const/16 v1, 0x5207

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

    move v0, v1

    goto :goto_86

    .line 247
    :catchall_e1
    move-exception v0

    monitor-exit v2
    :try_end_e3
    .catchall {:try_start_dc .. :try_end_e3} :catchall_e1

    throw v0
.end method


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

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

    monitor-enter v1

    .line 346
    :try_start_3
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    if-eqz v0, :cond_f

    .line 347
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    invoke-virtual {v0}, Lcom/iflytek/thirdparty/l;->a()V

    .line 348
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

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

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

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

    move-result-object v2

    const/4 v3, 0x0

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

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

    .line 353
    monitor-exit v1

    .line 354
    return-void

    .line 353
    :catchall_20
    move-exception v0

    monitor-exit v1
    :try_end_22
    .catchall {:try_start_3 .. :try_end_22} :catchall_20

    throw v0
.end method

.method public destroy()Z
    .registers 3

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

    monitor-enter v1

    .line 359
    :try_start_3
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    if-eqz v0, :cond_f

    .line 360
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    invoke-virtual {v0}, Lcom/iflytek/thirdparty/l;->a()V

    .line 361
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    .line 363
    :cond_f
    invoke-super {p0}, Lcom/iflytek/thirdparty/w;->destroy()Z

    move-result v0

    monitor-exit v1

    return v0

    .line 364
    :catchall_15
    move-exception v0

    monitor-exit v1
    :try_end_17
    .catchall {:try_start_3 .. :try_end_17} :catchall_15

    throw v0
.end method

.method public downloadResource(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/iflytek/cloud/util/FileDownloadListener;)I
    .registers 9

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

    monitor-enter v1

    .line 114
    :try_start_3
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_15

    .line 115
    invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_15

    .line 116
    invoke-static {p3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_19

    .line 117
    :cond_15
    const/16 v0, 0x4e2c

    monitor-exit v1

    .line 127
    :goto_18
    return v0

    .line 120
    :cond_19
    const-string v0, "CreateDownload"

    const/4 v2, 0x0

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

    .line 122
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    if-eqz v0, :cond_2b

    .line 123
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    invoke-virtual {v0}, Lcom/iflytek/thirdparty/l;->a()V

    .line 124
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    .line 126
    :cond_2b
    new-instance v0, Lcom/iflytek/thirdparty/l;

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

    invoke-direct {v0, v2}, Lcom/iflytek/thirdparty/l;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    .line 127
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    new-instance v2, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl$InternalDownloadListener;

    invoke-direct {v2, p0, p4, p5}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl$InternalDownloadListener;-><init>(Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;ZLcom/iflytek/cloud/util/FileDownloadListener;)V

    invoke-virtual {v0, p1, p2, p3, v2}, Lcom/iflytek/thirdparty/l;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/iflytek/cloud/util/FileDownloadListener;)I

    move-result v0

    monitor-exit v1

    goto :goto_18

    .line 129
    :catchall_41
    move-exception v0

    monitor-exit v1
    :try_end_43
    .catchall {:try_start_3 .. :try_end_43} :catchall_41

    throw v0
.end method

.method public isListening()Z
    .registers 3

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

    monitor-enter v1

    .line 369
    :try_start_3
    invoke-virtual {p0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isRunning()Z

    move-result v0

    monitor-exit v1

    return v0

    .line 370
    :catchall_9
    move-exception v0

    monitor-exit v1
    :try_end_b
    .catchall {:try_start_3 .. :try_end_b} :catchall_9

    throw v0
.end method

.method public queryResource(Ljava/lang/String;ZLcom/iflytek/cloud/RequestListener;)I
    .registers 11

    .prologue
    const/16 v0, 0x6213

    const/4 v1, 0x0

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

    monitor-enter v2

    .line 68
    :try_start_6
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-eqz v3, :cond_13

    .line 69
    const-string v1, "respath is null. please set respath before startlisten"

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

    .line 70
    monitor-exit v2

    .line 107
    :goto_12
    return v0

    .line 74
    :cond_13
    if-nez p2, :cond_26

    .line 76
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mContext:Landroid/content/Context;

    sget-object v3, Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;->path:Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;

    iget-object v4, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    const-string v5, "ivw_config_path"

    const/4 v6, 0x0

    .line 77
    invoke-virtual {v4, v5, v6}, Lcom/iflytek/cloud/msc/util/Config;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 76
    invoke-static {v1, v3, v4}, Lcom/iflytek/cloud/util/ResourceUtil;->generateResourcePath(Landroid/content/Context;Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 80
    :cond_26
    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    if-eqz v3, :cond_32

    .line 81
    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    invoke-virtual {v3}, Lcom/iflytek/thirdparty/l;->a()V

    .line 82
    const/4 v3, 0x0

    iput-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    .line 84
    :cond_32
    new-instance v3, Lcom/iflytek/thirdparty/l;

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

    invoke-direct {v3, v4}, Lcom/iflytek/thirdparty/l;-><init>(Landroid/content/Context;)V

    iput-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    .line 85
    invoke-static {p1, v1}, Lcom/iflytek/thirdparty/l;->a(Ljava/lang/String;Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    .line 88
    if-nez v1, :cond_4b

    .line 89
    const-string v1, "ivw invalid resource"

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

    .line 90
    monitor-exit v2

    goto :goto_12

    .line 109
    :catchall_48
    move-exception v0

    monitor-exit v2
    :try_end_4a
    .catchall {:try_start_6 .. :try_end_4a} :catchall_48

    throw v0

    .line 94
    :cond_4b
    :try_start_4b
    sget-object v0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->RESPATH:Ljava/lang/String;

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

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    .line 95
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-nez v3, :cond_86

    invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_86

    .line 96
    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    .line 97
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    const-string v3, "cfg_threshold"

    const/4 v4, 0x0

    invoke-virtual {v0, v3, v4}, Lcom/iflytek/cloud/msc/util/Config;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgThreshold:Ljava/lang/String;

    .line 105
    :goto_6c
    const-string v0, "SendRequest"

    const/4 v3, 0x0

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

    .line 106
    invoke-virtual {v1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

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

    .line 107
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mOptimizeManager:Lcom/iflytek/thirdparty/l;

    new-instance v3, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl$InternalRequestListener;

    invoke-direct {v3, p0, p2, p3}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl$InternalRequestListener;-><init>(Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;ZLcom/iflytek/cloud/RequestListener;)V

    invoke-virtual {v0, v1, v3}, Lcom/iflytek/thirdparty/l;->a(Lorg/json/JSONObject;Lcom/iflytek/cloud/RequestListener;)I

    move-result v0

    monitor-exit v2

    goto :goto_12

    .line 100
    :cond_86
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    .line 101
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    const-string v3, "ivw_config_path"

    invoke-virtual {v0, v3}, Lcom/iflytek/cloud/msc/util/Config;->removeBean(Ljava/lang/String;)V

    .line 102
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    const-string v3, "cfg_threshold"

    invoke-virtual {v0, v3}, Lcom/iflytek/cloud/msc/util/Config;->removeBean(Ljava/lang/String;)V
    :try_end_97
    .catchall {:try_start_4b .. :try_end_97} :catchall_48

    goto :goto_6c
.end method

.method public restartWorking(Ljava/lang/String;)Z
    .registers 5

    .prologue
    const/4 v0, 0x0

    .line 258
    .line 259
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSynObj:Ljava/lang/Object;

    monitor-enter v1

    .line 260
    :try_start_4
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_c

    .line 261
    monitor-exit v1

    .line 267
    :goto_b
    return v0

    .line 263
    :cond_c
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    const-string v2, "ivw_config_path"

    invoke-virtual {v0, v2, p1}, Lcom/iflytek/cloud/msc/util/Config;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 264
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->restartWorking(Z)V

    .line 265
    const/4 v0, 0x1

    .line 266
    monitor-exit v1

    goto :goto_b

    :catchall_1a
    move-exception v0

    monitor-exit v1
    :try_end_1c
    .catchall {:try_start_4 .. :try_end_1c} :catchall_1a

    throw v0
.end method

.method public startListening(Lcom/iflytek/cloud/WakeuperListener;)I
    .registers 14

    .prologue
    .line 139
    .line 141
    iget-object v2, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSynObj:Ljava/lang/Object;

    monitor-enter v2

    .line 143
    :try_start_3
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v1, "ivw_res_path"

    invoke-virtual {v0, v1}, Lcom/iflytek/thirdparty/ad;->d(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

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

    const-string v1, "ivw_threshold"

    invoke-virtual {v0, v1}, Lcom/iflytek/thirdparty/ad;->d(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserThreshold:Ljava/lang/String;

    .line 145
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCommonPath:Ljava/lang/String;

    .line 146
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_47

    .line 147
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

    const-string v1, ";"

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

    move-result v0

    .line 148
    if-lez v0, :cond_de

    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v1

    if-le v1, v0, :cond_de

    .line 149
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

    const/4 v3, 0x0

    invoke-virtual {v1, v3, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCommonPath:Ljava/lang/String;

    .line 150
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

    add-int/lit8 v0, v0, 0x1

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

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCmdPath:Ljava/lang/String;

    .line 157
    :cond_47
    :goto_47
    invoke-direct {p0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isQueryEnable()Z

    move-result v0

    if-eqz v0, :cond_bd

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

    sget-object v1, Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;->path:Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;

    iget-object v3, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    const-string v4, "ivw_config_path"

    const/4 v5, 0x0

    .line 159
    invoke-virtual {v3, v4, v5}, Lcom/iflytek/cloud/msc/util/Config;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 158
    invoke-static {v0, v1, v3}, Lcom/iflytek/cloud/util/ResourceUtil;->generateResourcePath(Landroid/content/Context;Lcom/iflytek/cloud/util/ResourceUtil$RESOURCE_TYPE;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    .line 161
    iget-object v1, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mConfig:Lcom/iflytek/cloud/msc/util/Config;

    .line 162
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    .line 163
    const-string v0, "ivw_query_last_time"

    const-wide/16 v6, 0x0

    invoke-virtual {v1, v0, v6, v7}, Lcom/iflytek/cloud/msc/util/Config;->getLong(Ljava/lang/String;J)J

    move-result-wide v6

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

    const-string v3, "ivw_query_period"

    const-wide/32 v8, 0x5265c00

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

    move-result-wide v8

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

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

    const-string v3, "query ivw res period: "

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

    move-result-object v0

    invoke-virtual {v0, v8, v9}, Ljava/lang/StringBuilder;->append(J)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;->LogD(Ljava/lang/String;)V

    .line 169
    sub-long v10, v4, v6

    cmp-long v0, v10, v8

    if-ltz v0, :cond_ef

    .line 171
    invoke-direct {p0}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->isNetResourceNew()Z

    move-result v0

    if-eqz v0, :cond_ec

    .line 172
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mCfgPath:Ljava/lang/String;

    .line 176
    :goto_9d
    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v6, "begin resource query res path: "

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

    move-result-object v3

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

    move-result-object v3

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

    move-result-object v3

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

    .line 178
    const/4 v3, 0x0

    const/4 v6, 0x0

    invoke-virtual {p0, v0, v3, v6}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->queryResource(Ljava/lang/String;ZLcom/iflytek/cloud/RequestListener;)I

    .line 179
    const-string v0, "ivw_query_last_time"

    invoke-virtual {v1, v0, v4, v5}, Lcom/iflytek/cloud/msc/util/Config;->putLong(Ljava/lang/String;J)V

    .line 184
    :cond_bd
    :goto_bd
    const-string v0, "ive startwork "

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

    .line 185
    invoke-direct {p0, p1}, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->startWorking(Lcom/iflytek/cloud/WakeuperListener;)I

    move-result v0

    .line 186
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v3, "ive startwork ret="

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

    move-result-object v1

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V
    :try_end_dc
    .catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_dc} :catch_e4
    .catchall {:try_start_3 .. :try_end_dc} :catchall_f9

    .line 191
    :goto_dc
    :try_start_dc
    monitor-exit v2
    :try_end_dd
    .catchall {:try_start_dc .. :try_end_dd} :catchall_f9

    .line 193
    return v0

    .line 152
    :cond_de
    :try_start_de
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserPath:Ljava/lang/String;

    iput-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCmdPath:Ljava/lang/String;
    :try_end_e2
    .catch Ljava/lang/Throwable; {:try_start_de .. :try_end_e2} :catch_e4
    .catchall {:try_start_de .. :try_end_e2} :catchall_f9

    goto/16 :goto_47

    .line 187
    :catch_e4
    move-exception v0

    .line 188
    const/16 v1, 0x5207

    .line 189
    :try_start_e7
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V
    :try_end_ea
    .catchall {:try_start_e7 .. :try_end_ea} :catchall_f9

    move v0, v1

    goto :goto_dc

    .line 174
    :cond_ec
    :try_start_ec
    iget-object v0, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mUserCmdPath:Ljava/lang/String;

    goto :goto_9d

    .line 180
    :cond_ef
    cmp-long v0, v4, v6

    if-nez v0, :cond_bd

    .line 181
    const-string v0, "ivw_query_last_time"

    invoke-virtual {v1, v0, v4, v5}, Lcom/iflytek/cloud/msc/util/Config;->putLong(Ljava/lang/String;J)V
    :try_end_f8
    .catch Ljava/lang/Throwable; {:try_start_ec .. :try_end_f8} :catch_e4
    .catchall {:try_start_ec .. :try_end_f8} :catchall_f9

    goto :goto_bd

    .line 191
    :catchall_f9
    move-exception v0

    :try_start_fa
    monitor-exit v2
    :try_end_fb
    .catchall {:try_start_fa .. :try_end_fb} :catchall_f9

    throw v0
.end method

.method public stopListening()V
    .registers 4

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

    monitor-enter v1

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

    if-eqz v0, :cond_f

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

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

    const/4 v2, 0x1

    invoke-virtual {v0, v2}, Lcom/iflytek/thirdparty/k;->a(Z)Z

    .line 337
    :cond_f
    monitor-exit v1

    .line 338
    return-void

    .line 337
    :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 writeAudio([BII)I
    .registers 8

    .prologue
    const/16 v0, 0x277d

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

    monitor-enter v1

    .line 305
    :try_start_5
    iget-object v2, p0, Lcom/iflytek/cloud/speech/impl/VoiceWakeuperImpl;->mscer:Lcom/iflytek/thirdparty/s;

    if-nez v2, :cond_12

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

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

    .line 307
    const/16 v0, 0x520c

    monitor-exit v1

    .line 325
    :goto_11
    return v0

    .line 310
    :cond_12
    if-eqz p1, :cond_17

    array-length v2, p1

    if-gtz v2, :cond_21

    .line 311
    :cond_17
    const-string v2, "writeAudio error,buffer is null."

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

    .line 312
    monitor-exit v1

    goto :goto_11

    .line 326
    :catchall_1e
    move-exception v0

    monitor-exit v1
    :try_end_20
    .catchall {:try_start_5 .. :try_end_20} :catchall_1e

    throw v0

    .line 315
    :cond_21
    :try_start_21
    array-length v2, p1

    add-int v3, p3, p2

    if-ge v2, v3, :cond_2d

    .line 316
    const-string v2, "writeAudio error,buffer length < length."

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

    .line 317
    monitor-exit v1

    goto :goto_11

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

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

    invoke-virtual {v0}, Lcom/iflytek/thirdparty/k;->c()I

    move-result v0

    .line 321
    const/4 v2, -0x1

    if-eq v2, v0, :cond_3c

    .line 322
    const/16 v0, 0x277a

    monitor-exit v1

    goto :goto_11

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

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

    invoke-virtual {v0, p1, p2, p3}, Lcom/iflytek/thirdparty/k;->a([BII)I

    move-result v0

    monitor-exit v1
    :try_end_45
    .catchall {:try_start_21 .. :try_end_45} :catchall_1e

    goto :goto_11
.end method