h.smali

.class public Lcom/beetalk/sdk/cache/h;
.super Ljava/lang/Object;
.source "PendingPayCachePreference.java"


# static fields
.field private static volatile a:Lcom/beetalk/sdk/cache/h;


# instance fields
.field private final b:Landroid/content/SharedPreferences;


# direct methods
.method private constructor <init>(Landroid/content/Context;)V
    .registers 4

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

    const-string v0, "com.garena.android.msdk.PendingPayCachePreference"

    const/4 v1, 0x0

    .line 2
    invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object p1

    iput-object p1, p0, Lcom/beetalk/sdk/cache/h;->b:Landroid/content/SharedPreferences;

    return-void
.end method

.method public static a(Landroid/content/Context;)Lcom/beetalk/sdk/cache/h;
    .registers 3

    .line 1
    sget-object v0, Lcom/beetalk/sdk/cache/h;->a:Lcom/beetalk/sdk/cache/h;

    if-nez v0, :cond_17

    .line 2
    const-class v0, Lcom/beetalk/sdk/cache/h;

    monitor-enter v0

    .line 3
    :try_start_7
    sget-object v1, Lcom/beetalk/sdk/cache/h;->a:Lcom/beetalk/sdk/cache/h;

    if-nez v1, :cond_12

    .line 4
    new-instance v1, Lcom/beetalk/sdk/cache/h;

    invoke-direct {v1, p0}, Lcom/beetalk/sdk/cache/h;-><init>(Landroid/content/Context;)V

    sput-object v1, Lcom/beetalk/sdk/cache/h;->a:Lcom/beetalk/sdk/cache/h;

    .line 5
    :cond_12
    monitor-exit v0

    goto :goto_17

    :catchall_14
    move-exception p0

    monitor-exit v0
    :try_end_16
    .catchall {:try_start_7 .. :try_end_16} :catchall_14

    throw p0

    .line 6
    :cond_17
    :goto_17
    sget-object p0, Lcom/beetalk/sdk/cache/h;->a:Lcom/beetalk/sdk/cache/h;

    return-object p0
.end method

.method private c(Landroid/content/Context;Ljava/lang/String;)J
    .registers 5

    .line 1
    invoke-static {p1}, Lcom/beetalk/sdk/cache/h;->a(Landroid/content/Context;)Lcom/beetalk/sdk/cache/h;

    move-result-object p1

    iget-object p1, p1, Lcom/beetalk/sdk/cache/h;->b:Landroid/content/SharedPreferences;

    const-wide/16 v0, 0x0

    .line 2
    invoke-interface {p1, p2, v0, v1}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide p1

    return-wide p1
.end method


# virtual methods
.method public a(Landroid/content/Context;Ljava/lang/String;)Z
    .registers 7

    .line 7
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    invoke-direct {p0, p1, p2}, Lcom/beetalk/sdk/cache/h;->c(Landroid/content/Context;Ljava/lang/String;)J

    move-result-wide v2

    sub-long/2addr v0, v2

    .line 8
    invoke-virtual {p0, p1}, Lcom/beetalk/sdk/cache/h;->b(Landroid/content/Context;)J

    move-result-wide p1

    cmp-long v2, v0, p1

    if-lez v2, :cond_13

    const/4 p1, 0x1

    goto :goto_14

    :cond_13
    const/4 p1, 0x0

    :goto_14
    return p1
.end method

.method public b(Landroid/content/Context;)J
    .registers 5

    .line 1
    invoke-static {}, Lcom/beetalk/sdk/SDKConstants;->n()Lcom/beetalk/sdk/SDKConstants$GGEnvironment;

    move-result-object v0

    sget-object v1, Lcom/beetalk/sdk/SDKConstants$GGEnvironment;->TEST:Lcom/beetalk/sdk/SDKConstants$GGEnvironment;

    if-ne v0, v1, :cond_c

    const-wide/32 v0, 0xc350

    return-wide v0

    .line 2
    :cond_c
    invoke-static {p1}, Lcom/beetalk/sdk/cache/h;->a(Landroid/content/Context;)Lcom/beetalk/sdk/cache/h;

    move-result-object p1

    iget-object p1, p1, Lcom/beetalk/sdk/cache/h;->b:Landroid/content/SharedPreferences;

    const-wide/32 v0, 0x5265c00

    const-string v2, "KEY_PENDING_COMMIT_REQUEST_INTERVAL"

    .line 3
    invoke-interface {p1, v2, v0, v1}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v0

    return-wide v0
.end method

.method public b(Landroid/content/Context;Ljava/lang/String;)V
    .registers 5

    .line 4
    invoke-static {p1}, Lcom/beetalk/sdk/cache/h;->a(Landroid/content/Context;)Lcom/beetalk/sdk/cache/h;

    move-result-object p1

    iget-object p1, p1, Lcom/beetalk/sdk/cache/h;->b:Landroid/content/SharedPreferences;

    invoke-interface {p1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object p1

    .line 5
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    invoke-interface {p1, p2, v0, v1}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    .line 6
    invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V

    return-void
.end method