HodorConfig.smali

.class public Lcom/kwai/video/hodor/HodorConfig;
.super Ljava/lang/Object;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/kwai/video/hodor/HodorConfig$HodorQueueMode;
    }
.end annotation


# static fields
.field public static final DEFAULT_CONNECT_TIMEOUT_MS:I = 0xbb8

.field public static final HodorQueueMode_LowConsume:I = 0x0

.field public static final HodorQueueMode_None:I = -0x1

.field public static final HodorQueueMode_Normal:I = 0x1

.field private static final MB:J = 0x100000L

.field private static final MEDIA_CACHE_LIMIT_MB_DEFAULT:J = 0x100L

.field private static final MEDIA_CACHE_LIMIT_MB_MIN:J = 0xaL

.field private static sMediaDirAvialbleMB:J

.field private static sMediaDirFullPath:Ljava/lang/String;

.field private static sResourceDirFullPath:Ljava/lang/String;


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

    invoke-static {}, Lcom/kwai/video/cache/AwesomeCacheInitConfig;->waitSoLibReady()V

    return-void
.end method

.method public constructor <init>()V
    .registers 1

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

    return-void
.end method

.method public static native enalbeCronetForAllTask(Z)V
.end method

.method public static native getCacheV2ScopeMaxBytes()J
.end method

.method public static native getHodorQueueMode()I
.end method

.method public static getMediaDirAvialbleMB()J
    .registers 2

    sget-wide v0, Lcom/kwai/video/hodor/HodorConfig;->sMediaDirAvialbleMB:J

    return-wide v0
.end method

.method public static getMediaDirFullPath()Ljava/lang/String;
    .registers 1

    sget-object v0, Lcom/kwai/video/hodor/HodorConfig;->sMediaDirFullPath:Ljava/lang/String;

    return-object v0
.end method

.method private static getReasonableMediaCacheBytesLimit(Ljava/lang/String;)J
    .registers 7

    invoke-static {p0}, Lcom/kwai/video/hodor/util/FileUtils;->getAvailableBytes(Ljava/lang/String;)J

    move-result-wide v0

    const-wide/32 v2, 0x100000

    div-long v2, v0, v2

    sput-wide v2, Lcom/kwai/video/hodor/HodorConfig;->sMediaDirAvialbleMB:J

    const-wide/high16 v2, 0x4164000000000000L    # 1.048576E7

    long-to-double v0, v0

    const-wide/high16 v4, 0x3fe0000000000000L    # 0.5

    mul-double/2addr v0, v4

    const-wide/high16 v4, 0x41b0000000000000L    # 2.68435456E8

    invoke-static {v0, v1, v4, v5}, Ljava/lang/Math;->min(DD)D

    move-result-wide v0

    invoke-static {v2, v3, v0, v1}, Ljava/lang/Math;->max(DD)D

    move-result-wide v0

    double-to-long v0, v0

    return-wide v0
.end method

.method public static getResourceDirFullPath()Ljava/lang/String;
    .registers 1

    sget-object v0, Lcom/kwai/video/hodor/HodorConfig;->sResourceDirFullPath:Ljava/lang/String;

    return-object v0
.end method

.method public static native getTcpMaxConnects()I
.end method

.method public static init(Landroid/content/Context;)V
    .registers 3

    const/4 v0, 0x1

    invoke-static {p0, v0}, Lcom/kwai/video/hodor/util/FileUtils;->getDefaultCacheDir(Landroid/content/Context;Z)Ljava/io/File;

    move-result-object v0

    if-nez v0, :cond_29

    const-string v0, "."

    :goto_9
    invoke-static {v0}, Lcom/kwai/video/hodor/HodorConfig;->setMediaCacheDirectoryPath(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    sput-object v1, Lcom/kwai/video/hodor/HodorConfig;->sMediaDirFullPath:Ljava/lang/String;

    invoke-static {v0}, Lcom/kwai/video/hodor/HodorConfig;->getReasonableMediaCacheBytesLimit(Ljava/lang/String;)J

    move-result-wide v0

    invoke-static {v0, v1}, Lcom/kwai/video/hodor/HodorConfig;->setMediaCacheBytesLimit(J)J

    const/4 v0, 0x0

    invoke-static {p0, v0}, Lcom/kwai/video/hodor/util/FileUtils;->getDefaultCacheDir(Landroid/content/Context;Z)Ljava/io/File;

    move-result-object v0

    if-nez v0, :cond_2e

    const-string v0, "."

    :goto_1f
    invoke-static {v0}, Lcom/kwai/video/hodor/HodorConfig;->setResourceCacheDirectoryPath(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/kwai/video/hodor/HodorConfig;->sResourceDirFullPath:Ljava/lang/String;

    invoke-static {}, Lcom/kwai/video/hodor/HodorConfig;->initCacheManager()V

    return-void

    :cond_29
    invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    goto :goto_9

    :cond_2e
    invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    goto :goto_1f
.end method

.method private static native initCacheManager()V
.end method

.method public static native isCronetEnalbedForAllTask()Z
.end method

.method public static native setCacheV2ScopeMaxBytes(J)V
.end method

.method public static native setHodorQueueMode(I)I
    .param p0    # I
        .annotation build Lcom/kwai/video/hodor/HodorConfig$HodorQueueMode;
        .end annotation
    .end param
.end method

.method public static native setKlogParam(Ljava/lang/Object;)V
.end method

.method public static native setMediaCacheBytesLimit(J)J
.end method

.method public static native setMediaCacheDirectoryPath(Ljava/lang/String;)Ljava/lang/String;
.end method

.method public static native setPreloadV3VodBufferLowRatio(D)V
.end method

.method public static native setPreloadV3VodCacheKbThresholdWhenPrepare(I)V
.end method

.method public static native setPreloadV3VodPausePreloadMaxCountDueToBufferLow(I)V
.end method

.method public static native setResourceCacheDirectoryPath(Ljava/lang/String;)Ljava/lang/String;
.end method

.method public static native setTcpMaxConnects(I)I
.end method