ExoCacheIO$ExoCacheIOHandler.smali

.class Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;
.super Landroid/os/Handler;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/mmc/player/videocache/exocache/ExoCacheIO;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "ExoCacheIOHandler"
.end annotation


# instance fields
.field public final synthetic this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;


# direct methods
.method public constructor <init>(Lcom/mmc/player/videocache/exocache/ExoCacheIO;Landroid/os/Looper;)V
    .registers 3

    .line 1
    iput-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    .line 2
    invoke-direct {p0, p2}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    return-void
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .registers 8

    const-string v0, "handleMessage"

    const-string v1, "com/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler"

    const-string v2, "message"

    invoke-static {v0, v1, v2}, Lcom/shopee/monitor/trace/c;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 1
    invoke-super {p0, p1}, Landroid/os/Handler;->handleMessage(Landroid/os/Message;)V

    .line 2
    iget v0, p1, Landroid/os/Message;->what:I

    const/4 v1, 0x1

    if-eqz v0, :cond_d9

    const-wide/16 v2, 0x0

    if-eq v0, v1, :cond_97

    const/4 v4, 0x2

    if-eq v0, v4, :cond_1a

    goto/16 :goto_fe

    .line 3
    :cond_1a
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    iget-object p1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast p1, Ljava/lang/Long;

    invoke-virtual {p1}, Ljava/lang/Long;->longValue()J

    move-result-wide v4

    # invokes: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->seekInternal(J)J
    invoke-static {v0, v4, v5}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$700(Lcom/mmc/player/videocache/exocache/ExoCacheIO;J)J

    move-result-wide v4

    .line 4
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->lock:Ljava/lang/Object;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$300(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Ljava/lang/Object;

    move-result-object p1

    monitor-enter p1

    .line 5
    :try_start_2f
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # setter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->seekRet:J
    invoke-static {v0, v4, v5}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$802(Lcom/mmc/player/videocache/exocache/ExoCacheIO;J)J

    .line 6
    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->lock:Ljava/lang/Object;
    invoke-static {v0}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$300(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->notifyAll()V

    .line 7
    monitor-exit p1
    :try_end_3e
    .catchall {:try_start_2f .. :try_end_3e} :catchall_8b

    cmp-long p1, v4, v2

    if-lez p1, :cond_59

    .line 8
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->handler:Landroid/os/Handler;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$400(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Landroid/os/Handler;

    move-result-object p1

    invoke-virtual {p1, v1}, Landroid/os/Handler;->hasMessages(I)Z

    move-result p1

    if-nez p1, :cond_59

    .line 9
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->handler:Landroid/os/Handler;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$400(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Landroid/os/Handler;

    move-result-object p1

    invoke-virtual {p1, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    goto/16 :goto_fe

    :cond_59
    const-string p1, "MMCExoCacheIO"

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

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

    iget-object v2, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->LOG_PREFIX:Ljava/lang/String;
    invoke-static {v2}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$000(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Ljava/lang/String;

    move-result-object v2

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

    const-string v2, "no need to run main task, has main:"

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

    iget-object v2, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->handler:Landroid/os/Handler;
    invoke-static {v2}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$400(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Landroid/os/Handler;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/os/Handler;->hasMessages(I)Z

    move-result v1

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

    const-string v1, ", seek return:"

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

    invoke-virtual {v0, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

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

    move-result-object v0

    invoke-static {p1, v0}, Lcom/mmc/player/log/MMCLogDelegate;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_fe

    :catchall_8b
    move-exception v0

    .line 11
    :try_start_8c
    monitor-exit p1
    :try_end_8d
    .catchall {:try_start_8c .. :try_end_8d} :catchall_8b

    const-string p1, "handleMessage"

    const-string v1, "com/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler"

    const-string v2, "message"

    invoke-static {p1, v1, v2}, Lcom/shopee/monitor/trace/c;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    throw v0

    .line 12
    :cond_97
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # invokes: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->main()J
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$500(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)J

    move-result-wide v4

    cmp-long p1, v4, v2

    if-gez p1, :cond_c7

    .line 13
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->handler:Landroid/os/Handler;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$400(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Landroid/os/Handler;

    move-result-object p1

    invoke-virtual {p1, v1}, Landroid/os/Handler;->removeMessages(I)V

    const-string p1, "MMCExoCacheIO"

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

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

    iget-object v1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->LOG_PREFIX:Ljava/lang/String;
    invoke-static {v1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$000(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Ljava/lang/String;

    move-result-object v1

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

    const-string v1, "main task suspend for now"

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

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

    move-result-object v0

    invoke-static {p1, v0}, Lcom/mmc/player/log/MMCLogDelegate;->i(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_fe

    .line 15
    :cond_c7
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->handler:Landroid/os/Handler;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$400(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Landroid/os/Handler;

    move-result-object p1

    iget-object v0, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->plusInterval:I
    invoke-static {v0}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$600(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)I

    move-result v0

    int-to-long v2, v0

    add-long/2addr v4, v2

    invoke-virtual {p1, v1, v4, v5}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    goto :goto_fe

    .line 16
    :cond_d9
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # invokes: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->openInternal()Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$200(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;

    move-result-object v0

    # setter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->openRetForHandler:Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;
    invoke-static {p1, v0}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$102(Lcom/mmc/player/videocache/exocache/ExoCacheIO;Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;)Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;

    .line 17
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->lock:Ljava/lang/Object;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$300(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Ljava/lang/Object;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Object;->notifyAll()V

    .line 18
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->openRetForHandler:Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$100(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;

    move-result-object p1

    iget p1, p1, Lcom/mmc/player/videocache/exocache/ExoCacheIO$CacheIORet;->ret:I

    if-ltz p1, :cond_fe

    .line 19
    iget-object p1, p0, Lcom/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler;->this$0:Lcom/mmc/player/videocache/exocache/ExoCacheIO;

    # getter for: Lcom/mmc/player/videocache/exocache/ExoCacheIO;->handler:Landroid/os/Handler;
    invoke-static {p1}, Lcom/mmc/player/videocache/exocache/ExoCacheIO;->access$400(Lcom/mmc/player/videocache/exocache/ExoCacheIO;)Landroid/os/Handler;

    move-result-object p1

    invoke-virtual {p1, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    :cond_fe
    :goto_fe
    const-string p1, "handleMessage"

    const-string v0, "com/mmc/player/videocache/exocache/ExoCacheIO$ExoCacheIOHandler"

    const-string v1, "message"

    .line 20
    invoke-static {p1, v0, v1}, Lcom/shopee/monitor/trace/c;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method