PingSocketTransfer.smali

.class public Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;
.super Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/DataTransferWraper;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$OnSignErrorListener;,
        Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$ConnectedCallback;
    }
.end annotation


# static fields
.field private static final PING_INTERVAL:J


# instance fields
.field private final mOnSignErrorListener:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$OnSignErrorListener;

.field private mSendPingTask:Ljava/lang/Runnable;


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

    sget-object v0, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    const-wide/16 v2, 0xa

    invoke-virtual {v0, v2, v3}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J

    move-result-wide v0

    sput-wide v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->PING_INTERVAL:J

    return-void
.end method

.method public constructor <init>(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/IDataTransfer;Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$OnSignErrorListener;)V
    .registers 4

    invoke-direct {p0, p1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/DataTransferWraper;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/IDataTransfer;)V

    new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$2;

    invoke-direct {v0, p0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$2;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;)V

    iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->mSendPingTask:Ljava/lang/Runnable;

    iput-object p2, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->mOnSignErrorListener:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$OnSignErrorListener;

    return-void
.end method

.method static synthetic access$000(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;)Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$OnSignErrorListener;
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->mOnSignErrorListener:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$OnSignErrorListener;

    return-object v0
.end method

.method static synthetic access$100(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;)Ljava/lang/Runnable;
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->mSendPingTask:Ljava/lang/Runnable;

    return-object v0
.end method

.method static synthetic access$200(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;)V
    .registers 1

    invoke-direct {p0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->sendPingMessage()V

    return-void
.end method

.method static synthetic access$300()J
    .registers 2

    sget-wide v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->PING_INTERVAL:J

    return-wide v0
.end method

.method private sendPingMessage()V
    .registers 4

    const/4 v0, 0x4

    const-string/jumbo v1, "ping"

    new-instance v2, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$1;

    invoke-direct {v2, p0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$1;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;)V

    invoke-virtual {p0, v0, v1, v2}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->send(ILjava/lang/String;Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/OnSendCallBack;)Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ResponseControl;

    return-void
.end method


# virtual methods
.method public create(Ljava/lang/String;Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket$OnSocketListener;)V
    .registers 4

    new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$ConnectedCallback;

    invoke-direct {v0, p0, p2}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer$ConnectedCallback;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket$OnSocketListener;)V

    invoke-super {p0, p1, v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/DataTransferWraper;->create(Ljava/lang/String;Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket$OnSocketListener;)V

    return-void
.end method

.method public destroy()V
    .registers 3

    invoke-super {p0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/DataTransferWraper;->destroy()V

    invoke-static {}, Lcom/cmcm/xiaobao/phone/commons/utils/Executors;->getBgHandler()Landroid/os/Handler;

    move-result-object v0

    iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/PingSocketTransfer;->mSendPingTask:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    return-void
.end method