142 lines
3.3 KiB
Smali
142 lines
3.3 KiB
Smali
.class public Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;
|
|
.super Ljava/lang/Object;
|
|
.source "DefaultBitmapMemoryCacheParamsSupplier.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/facebook/common/internal/Supplier;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/Object;",
|
|
"Lcom/facebook/common/internal/Supplier<",
|
|
"Lcom/facebook/imagepipeline/cache/MemoryCacheParams;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final MAX_CACHE_ENTRIES:I = 0x100
|
|
|
|
.field public static final MAX_CACHE_ENTRY_SIZE:I = 0x7fffffff
|
|
|
|
.field public static final MAX_EVICTION_QUEUE_ENTRIES:I = 0x7fffffff
|
|
|
|
.field public static final MAX_EVICTION_QUEUE_SIZE:I = 0x7fffffff
|
|
|
|
.field public static final PARAMS_CHECK_INTERVAL_MS:J
|
|
|
|
|
|
# instance fields
|
|
.field public final mActivityManager:Landroid/app/ActivityManager;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
sget-object v0, Ljava/util/concurrent/TimeUnit;->MINUTES:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-wide/16 v1, 0x5
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v0
|
|
|
|
sput-wide v0, Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;->PARAMS_CHECK_INTERVAL_MS:J
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/app/ActivityManager;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;->mActivityManager:Landroid/app/ActivityManager;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private getMaxCacheSize()I
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;->mActivityManager:Landroid/app/ActivityManager;
|
|
|
|
invoke-virtual {v0}, Landroid/app/ActivityManager;->getMemoryClass()I
|
|
|
|
move-result v0
|
|
|
|
const/high16 v1, 0x100000
|
|
|
|
mul-int v0, v0, v1
|
|
|
|
const v1, 0x7fffffff
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v0
|
|
|
|
const/high16 v1, 0x2000000
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
const/high16 v0, 0x400000
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/high16 v1, 0x4000000
|
|
|
|
if-ge v0, v1, :cond_1
|
|
|
|
const/high16 v0, 0x600000
|
|
|
|
return v0
|
|
|
|
:cond_1
|
|
div-int/lit8 v0, v0, 0x4
|
|
|
|
return v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public get()Lcom/facebook/imagepipeline/cache/MemoryCacheParams;
|
|
.locals 9
|
|
|
|
new-instance v8, Lcom/facebook/imagepipeline/cache/MemoryCacheParams;
|
|
|
|
invoke-direct {p0}, Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;->getMaxCacheSize()I
|
|
|
|
move-result v1
|
|
|
|
sget-wide v6, Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;->PARAMS_CHECK_INTERVAL_MS:J
|
|
|
|
const/16 v2, 0x100
|
|
|
|
const v3, 0x7fffffff
|
|
|
|
const v4, 0x7fffffff
|
|
|
|
const v5, 0x7fffffff
|
|
|
|
move-object v0, v8
|
|
|
|
invoke-direct/range {v0 .. v7}, Lcom/facebook/imagepipeline/cache/MemoryCacheParams;-><init>(IIIIIJ)V
|
|
|
|
return-object v8
|
|
.end method
|
|
|
|
.method public bridge synthetic get()Ljava/lang/Object;
|
|
.locals 1
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;->get()Lcom/facebook/imagepipeline/cache/MemoryCacheParams;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|