IdentityVerifier.smali
.class public final Lcom/iflytek/cloud/IdentityVerifier;
.super Lcom/iflytek/thirdparty/v;
.source "SourceFile"
# static fields
.field private static a:Lcom/iflytek/cloud/IdentityVerifier;
# instance fields
.field private b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
.field private c:Lcom/iflytek/cloud/InitListener;
.field private d:Landroid/os/Handler;
# direct methods
.method static constructor <clinit>()V
.registers 1
.prologue
.line 99
const/4 v0, 0x0
sput-object v0, Lcom/iflytek/cloud/IdentityVerifier;->a:Lcom/iflytek/cloud/IdentityVerifier;
return-void
.end method
.method protected constructor <init>(Landroid/content/Context;Lcom/iflytek/cloud/InitListener;)V
.registers 7
.prologue
const/4 v3, 0x0
const/4 v2, 0x0
.line 158
invoke-direct {p0}, Lcom/iflytek/thirdparty/v;-><init>()V
.line 104
iput-object v3, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
.line 109
iput-object v3, p0, Lcom/iflytek/cloud/IdentityVerifier;->c:Lcom/iflytek/cloud/InitListener;
.line 173
new-instance v0, Lcom/iflytek/cloud/IdentityVerifier$1;
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
move-result-object v1
invoke-direct {v0, p0, v1}, Lcom/iflytek/cloud/IdentityVerifier$1;-><init>(Lcom/iflytek/cloud/IdentityVerifier;Landroid/os/Looper;)V
iput-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->d:Landroid/os/Handler;
.line 159
iput-object p2, p0, Lcom/iflytek/cloud/IdentityVerifier;->c:Lcom/iflytek/cloud/InitListener;
.line 161
new-instance v0, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-direct {v0, p1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
.line 163
if-eqz p2, :cond_28
.line 168
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->d:Landroid/os/Handler;
invoke-static {v0, v2, v2, v2, v3}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;
move-result-object v0
invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
.line 171
:cond_28
return-void
.end method
.method static synthetic a(Lcom/iflytek/cloud/IdentityVerifier;)Lcom/iflytek/cloud/InitListener;
.registers 2
.prologue
.line 94
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->c:Lcom/iflytek/cloud/InitListener;
return-object v0
.end method
.method public static declared-synchronized createVerifier(Landroid/content/Context;Lcom/iflytek/cloud/InitListener;)Lcom/iflytek/cloud/IdentityVerifier;
.registers 5
.prologue
.line 127
const-class v1, Lcom/iflytek/cloud/IdentityVerifier;
monitor-enter v1
:try_start_3
sget-object v2, Lcom/iflytek/cloud/IdentityVerifier;->sSync:Ljava/lang/Object;
monitor-enter v2
:try_end_6
.catchall {:try_start_3 .. :try_end_6} :catchall_1f
.line 128
:try_start_6
sget-object v0, Lcom/iflytek/cloud/IdentityVerifier;->a:Lcom/iflytek/cloud/IdentityVerifier;
if-nez v0, :cond_17
invoke-static {}, Lcom/iflytek/cloud/SpeechUtility;->getUtility()Lcom/iflytek/cloud/SpeechUtility;
move-result-object v0
if-eqz v0, :cond_17
.line 129
new-instance v0, Lcom/iflytek/cloud/IdentityVerifier;
invoke-direct {v0, p0, p1}, Lcom/iflytek/cloud/IdentityVerifier;-><init>(Landroid/content/Context;Lcom/iflytek/cloud/InitListener;)V
sput-object v0, Lcom/iflytek/cloud/IdentityVerifier;->a:Lcom/iflytek/cloud/IdentityVerifier;
.line 131
:cond_17
monitor-exit v2
:try_end_18
.catchall {:try_start_6 .. :try_end_18} :catchall_1c
.line 133
:try_start_18
sget-object v0, Lcom/iflytek/cloud/IdentityVerifier;->a:Lcom/iflytek/cloud/IdentityVerifier;
:try_end_1a
.catchall {:try_start_18 .. :try_end_1a} :catchall_1f
monitor-exit v1
return-object v0
.line 131
:catchall_1c
move-exception v0
:try_start_1d
monitor-exit v2
:try_end_1e
.catchall {:try_start_1d .. :try_end_1e} :catchall_1c
:try_start_1e
throw v0
:try_end_1f
.catchall {:try_start_1e .. :try_end_1f} :catchall_1f
.line 127
:catchall_1f
move-exception v0
monitor-exit v1
throw v0
.end method
.method public static getVerifier()Lcom/iflytek/cloud/IdentityVerifier;
.registers 1
.prologue
.line 149
sget-object v0, Lcom/iflytek/cloud/IdentityVerifier;->a:Lcom/iflytek/cloud/IdentityVerifier;
return-object v0
.end method
# virtual methods
.method public cancel()V
.registers 3
.prologue
.line 357
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
if-eqz v0, :cond_13
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-virtual {v0}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->isWorking()Z
move-result v0
if-eqz v0, :cond_13
.line 358
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->cancel(Z)V
.line 362
:goto_12
return-void
.line 360
:cond_13
const-string v0, "IdentityVerifier cancel failed, is not running"
invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V
goto :goto_12
.end method
.method public destroy()Z
.registers 4
.prologue
.line 421
const/4 v0, 0x1
.line 422
iget-object v1, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
.line 423
if-eqz v1, :cond_9
.line 424
invoke-virtual {v1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->destroy()Z
move-result v0
.line 427
:cond_9
if-eqz v0, :cond_18
invoke-super {p0}, Lcom/iflytek/thirdparty/v;->destroy()Z
move-result v0
if-eqz v0, :cond_18
.line 428
sget-object v1, Lcom/iflytek/cloud/IdentityVerifier;->sSync:Ljava/lang/Object;
monitor-enter v1
.line 429
const/4 v2, 0x0
:try_start_15
sput-object v2, Lcom/iflytek/cloud/IdentityVerifier;->a:Lcom/iflytek/cloud/IdentityVerifier;
.line 430
monitor-exit v1
.line 433
:cond_18
return v0
.line 430
:catchall_19
move-exception v0
monitor-exit v1
:try_end_1b
.catchall {:try_start_15 .. :try_end_1b} :catchall_19
throw v0
.end method
.method public execute(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/iflytek/cloud/IdentityListener;)I
.registers 7
.prologue
.line 306
.line 308
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
if-eqz v0, :cond_18
.line 309
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
iget-object v1, p0, Lcom/iflytek/cloud/IdentityVerifier;->mSessionParams:Lcom/iflytek/thirdparty/ad;
invoke-virtual {v0, v1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->setParameter(Lcom/iflytek/thirdparty/ad;)Z
move-result v0
if-eqz v0, :cond_15
.line 310
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-virtual {v0, p1, p2, p3, p4}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->execute(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/iflytek/cloud/IdentityListener;)I
move-result v0
.line 319
:goto_14
return v0
.line 312
:cond_15
const/16 v0, 0x4e2c
goto :goto_14
.line 315
:cond_18
const-string v0, "IdentityVerifier execute failed, is not running"
invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V
.line 316
const/16 v0, 0x5209
goto :goto_14
.end method
.method public getParameter(Ljava/lang/String;)Ljava/lang/String;
.registers 3
.prologue
.line 397
invoke-super {p0, p1}, Lcom/iflytek/thirdparty/v;->getParameter(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public isWorking()Z
.registers 2
.prologue
.line 339
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
if-eqz v0, :cond_e
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-virtual {v0}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->isWorking()Z
move-result v0
if-eqz v0, :cond_e
.line 340
const/4 v0, 0x1
.line 342
:goto_d
return v0
:cond_e
const/4 v0, 0x0
goto :goto_d
.end method
.method public setParameter(Ljava/lang/String;Ljava/lang/String;)Z
.registers 4
.prologue
.line 384
invoke-super {p0, p1, p2}, Lcom/iflytek/thirdparty/v;->setParameter(Ljava/lang/String;Ljava/lang/String;)Z
move-result v0
return v0
.end method
.method public startWorking(Lcom/iflytek/cloud/IdentityListener;)I
.registers 4
.prologue
.line 207
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
if-nez v0, :cond_7
.line 208
const/16 v0, 0x5209
.line 210
:goto_6
return v0
.line 209
:cond_7
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
iget-object v1, p0, Lcom/iflytek/cloud/IdentityVerifier;->mSessionParams:Lcom/iflytek/thirdparty/ad;
invoke-virtual {v0, v1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->setParameter(Lcom/iflytek/thirdparty/ad;)Z
.line 210
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-virtual {v0, p1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->startWorking(Lcom/iflytek/cloud/IdentityListener;)I
move-result v0
goto :goto_6
.end method
.method public stopWrite(Ljava/lang/String;)V
.registers 3
.prologue
.line 273
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
if-eqz v0, :cond_12
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-virtual {v0}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->isWorking()Z
move-result v0
if-eqz v0, :cond_12
.line 274
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-virtual {v0, p1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->stopWrite(Ljava/lang/String;)V
.line 278
:goto_11
return-void
.line 276
:cond_12
const-string v0, "IdentityVerifier stopListening failed, is not running"
invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V
goto :goto_11
.end method
.method public writeData(Ljava/lang/String;Ljava/lang/String;[BII)I
.registers 12
.prologue
.line 245
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
if-eqz v0, :cond_45
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-virtual {v0}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->isWorking()Z
move-result v0
if-eqz v0, :cond_45
.line 246
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "mVerifierImpl is"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
if-eqz v0, :cond_43
const/4 v0, 0x1
:goto_1c
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, " mVerifierImpl.isWorking() is "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
invoke-virtual {v1}, Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;->isWorking()Z
move-result v1
invoke-virtual {v0, v1}, 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;->LogE(Ljava/lang/String;)V
.line 247
iget-object v0, p0, Lcom/iflytek/cloud/IdentityVerifier;->b:Lcom/iflytek/cloud/speech/impl/IdentityVerifierImpl;
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/cloud/speech/impl/IdentityVerifierImpl;->writeData(Ljava/lang/String;Ljava/lang/String;[BII)I
move-result v0
.line 250
:goto_42
return v0
.line 246
:cond_43
const/4 v0, 0x0
goto :goto_1c
.line 249
:cond_45
const-string v0, "IdentityVerifier writeAudio failed, is not running"
invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V
.line 250
const/16 v0, 0x520c
goto :goto_42
.end method