a.smali

.class public Lcom/fulishe/fs/newvideo/cache/t/a;
.super Ljava/lang/Object;
.source ""


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/fulishe/fs/newvideo/cache/t/a$e;,
        Lcom/fulishe/fs/newvideo/cache/t/a$a;
    }
.end annotation


# static fields
.field public static volatile a:Lcom/fulishe/fs/newvideo/cache/t/a;


# instance fields
.field public b:Lcom/fulishe/fs/newvideo/cache/a;

.field public final c:Ljava/util/concurrent/ExecutorService;

.field public final d:Lcom/fulishe/fs/newvideo/cache/t/a$e;

.field public final e:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lcom/fulishe/fs/newvideo/cache/a;)V
    .registers 4

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

    new-instance v0, Ljava/util/concurrent/CopyOnWriteArrayList;

    invoke-direct {v0}, Ljava/util/concurrent/CopyOnWriteArrayList;-><init>()V

    iput-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->e:Ljava/util/List;

    iput-object p1, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->b:Lcom/fulishe/fs/newvideo/cache/a;

    new-instance v0, Lcom/fulishe/fs/newvideo/cache/t/a$e;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/fulishe/fs/newvideo/cache/t/a$e;-><init>(Lcom/fulishe/fs/newvideo/cache/t/b;)V

    iput-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->d:Lcom/fulishe/fs/newvideo/cache/t/a$e;

    invoke-static {v0}, Lcom/fulishe/fs/newvideo/cache/t/a;->a(Lcom/fulishe/fs/newvideo/cache/t/a$e;)Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    iput-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->c:Ljava/util/concurrent/ExecutorService;

    iget-object v1, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->d:Lcom/fulishe/fs/newvideo/cache/t/a$e;

    check-cast v0, Ljava/util/concurrent/ThreadPoolExecutor;

    invoke-virtual {v1, v0}, Lcom/fulishe/fs/newvideo/cache/t/a$e;->a(Ljava/util/concurrent/ThreadPoolExecutor;)V

    return-void
.end method

.method public static a(Lcom/fulishe/fs/newvideo/cache/a;)Lcom/fulishe/fs/newvideo/cache/t/a;
    .registers 3

    sget-object v0, Lcom/fulishe/fs/newvideo/cache/t/a;->a:Lcom/fulishe/fs/newvideo/cache/t/a;

    if-nez v0, :cond_13

    const-class v1, Lcom/fulishe/fs/newvideo/cache/t/a;

    monitor-enter v1

    :try_start_7
    sget-object v0, Lcom/fulishe/fs/newvideo/cache/t/a;->a:Lcom/fulishe/fs/newvideo/cache/t/a;

    if-nez v0, :cond_12

    new-instance v0, Lcom/fulishe/fs/newvideo/cache/t/a;

    invoke-direct {v0, p0}, Lcom/fulishe/fs/newvideo/cache/t/a;-><init>(Lcom/fulishe/fs/newvideo/cache/a;)V

    sput-object v0, Lcom/fulishe/fs/newvideo/cache/t/a;->a:Lcom/fulishe/fs/newvideo/cache/t/a;

    :cond_12
    monitor-exit v1
    :try_end_13
    .catchall {:try_start_7 .. :try_end_13} :catchall_16

    :cond_13
    sget-object v0, Lcom/fulishe/fs/newvideo/cache/t/a;->a:Lcom/fulishe/fs/newvideo/cache/t/a;

    return-object v0

    :catchall_16
    move-exception v0

    :try_start_17
    monitor-exit v1
    :try_end_18
    .catchall {:try_start_17 .. :try_end_18} :catchall_16

    throw v0
.end method

.method public static synthetic a(Lcom/fulishe/fs/newvideo/cache/t/a;)Ljava/util/List;
    .registers 2

    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->e:Ljava/util/List;

    return-object v0
.end method

.method public static a(Lcom/fulishe/fs/newvideo/cache/t/a$e;)Ljava/util/concurrent/ExecutorService;
    .registers 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/fulishe/fs/newvideo/cache/t/a$e",
            "<",
            "Ljava/lang/Runnable;",
            ">;)",
            "Ljava/util/concurrent/ExecutorService;"
        }
    .end annotation

    const/4 v3, 0x4

    const/4 v1, 0x1

    invoke-static {}, Lcom/fulishe/shadow/base/o;->G()Lcom/fulishe/shadow/base/m;

    move-result-object v0

    invoke-interface {v0}, Lcom/fulishe/shadow/base/m;->h()I

    move-result v0

    if-lt v0, v1, :cond_24

    if-le v0, v3, :cond_26

    :goto_e
    new-instance v1, Ljava/util/concurrent/ThreadPoolExecutor;

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

    new-instance v8, Lcom/fulishe/fs/newvideo/cache/t/c;

    invoke-direct {v8}, Lcom/fulishe/fs/newvideo/cache/t/c;-><init>()V

    new-instance v9, Lcom/fulishe/fs/newvideo/cache/t/e;

    invoke-direct {v9, p0}, Lcom/fulishe/fs/newvideo/cache/t/e;-><init>(Lcom/fulishe/fs/newvideo/cache/t/a$e;)V

    const/4 v2, 0x0

    const-wide/16 v4, 0x3c

    move-object v7, p0

    invoke-direct/range {v1 .. v9}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;Ljava/util/concurrent/RejectedExecutionHandler;)V

    return-object v1

    :cond_24
    move v3, v1

    goto :goto_e

    :cond_26
    move v3, v0

    goto :goto_e
.end method

.method public static synthetic b(Lcom/fulishe/fs/newvideo/cache/t/a;)Lcom/fulishe/fs/newvideo/cache/a;
    .registers 2

    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->b:Lcom/fulishe/fs/newvideo/cache/a;

    return-object v0
.end method


# virtual methods
.method public a(Ljava/lang/String;)V
    .registers 3

    const v0, 0x32000

    invoke-virtual {p0, p1, v0}, Lcom/fulishe/fs/newvideo/cache/t/a;->a(Ljava/lang/String;I)V

    return-void
.end method

.method public a(Ljava/lang/String;I)V
    .registers 9

    if-eqz p1, :cond_4f

    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->b:Lcom/fulishe/fs/newvideo/cache/a;

    if-eqz v0, :cond_4f

    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->c:Ljava/util/concurrent/ExecutorService;

    if-eqz v0, :cond_4f

    const v0, 0x28000

    if-ge p2, v0, :cond_12

    const p2, 0x32000

    :cond_12
    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->b:Lcom/fulishe/fs/newvideo/cache/a;

    invoke-virtual {v0, p1}, Lcom/fulishe/fs/newvideo/cache/a;->c(Ljava/lang/String;)Ljava/io/File;

    move-result-object v0

    if-eqz v0, :cond_50

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_50

    invoke-virtual {v0}, Ljava/io/File;->length()J

    move-result-wide v2

    int-to-long v4, p2

    cmp-long v1, v2, v4

    if-lez v1, :cond_50

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "no need preload, file size: "

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

    move-result-object v1

    invoke-virtual {v0}, Ljava/io/File;->length()J

    move-result-wide v2

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

    move-result-object v0

    const-string v1, ", need preload size: "

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

    move-result-object v0

    invoke-virtual {v0, p2}, 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

    const-string v1, "PreLoader"

    invoke-static {v1, v0}, Lcom/fulishe/shadow/base/p;->a(Ljava/lang/String;Ljava/lang/String;)V

    :cond_4f
    :goto_4f
    return-void

    :cond_50
    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->e:Ljava/util/List;

    invoke-static {}, Lcom/fulishe/shadow/base/o;->G()Lcom/fulishe/shadow/base/m;

    move-result-object v1

    invoke-interface {v1, p1}, Lcom/fulishe/shadow/base/m;->f(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_68

    const-string v0, "PreLoader"

    const-string v1, "no need preload, the url is running"

    invoke-static {v0, v1}, Lcom/fulishe/shadow/base/p;->a(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_4f

    :cond_68
    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->b:Lcom/fulishe/fs/newvideo/cache/a;

    new-instance v1, Lcom/fulishe/fs/newvideo/cache/t/b;

    invoke-direct {v1, p0}, Lcom/fulishe/fs/newvideo/cache/t/b;-><init>(Lcom/fulishe/fs/newvideo/cache/t/a;)V

    invoke-virtual {v0, p1, v1}, Lcom/fulishe/fs/newvideo/cache/a;->a(Ljava/lang/String;Lcom/fulishe/fs/newvideo/cache/p$a;)V

    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->e:Ljava/util/List;

    invoke-static {}, Lcom/fulishe/shadow/base/o;->G()Lcom/fulishe/shadow/base/m;

    move-result-object v1

    invoke-interface {v1, p1}, Lcom/fulishe/shadow/base/m;->f(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    const-string v0, "PreLoader"

    const-string v1, "----\u89c6\u9891\u9884\u52a0\u8f7d---start preload ......"

    invoke-static {v0, v1}, Lcom/fulishe/shadow/base/p;->a(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->c:Ljava/util/concurrent/ExecutorService;

    new-instance v1, Lcom/fulishe/fs/newvideo/cache/t/a$a;

    iget-object v2, p0, Lcom/fulishe/fs/newvideo/cache/t/a;->b:Lcom/fulishe/fs/newvideo/cache/a;

    invoke-direct {v1, v2, p1, p2}, Lcom/fulishe/fs/newvideo/cache/t/a$a;-><init>(Lcom/fulishe/fs/newvideo/cache/a;Ljava/lang/String;I)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    goto :goto_4f
.end method