GamingContext$Companion.smali

.class public final Lcom/facebook/gamingservices/GamingContext$Companion;
.super Ljava/lang/Object;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/facebook/gamingservices/GamingContext;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "Companion"
.end annotation


# direct methods
.method private constructor <init>()V
    .registers 1

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

    return-void
.end method

.method public synthetic constructor <init>(Lkotlin/jvm/internal/e;)V
    .registers 2

    invoke-direct {p0}, Lcom/facebook/gamingservices/GamingContext$Companion;-><init>()V

    return-void
.end method


# virtual methods
.method public final getCurrentGamingContext()Lcom/facebook/gamingservices/GamingContext;
    .registers 5

    .line 1
    invoke-static {}, Lcom/facebook/gamingservices/cloudgaming/CloudGameLoginHandler;->isRunningInCloud()Z

    move-result v0

    if-eqz v0, :cond_2e

    .line 2
    sget-object v0, Lcom/facebook/FacebookSdk;->INSTANCE:Lcom/facebook/FacebookSdk;

    invoke-static {}, Lcom/facebook/FacebookSdk;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 3
    sget-object v1, Lcom/facebook/gamingservices/cloudgaming/internal/SDKMessageEnum;->CONTEXT_GET_ID:Lcom/facebook/gamingservices/cloudgaming/internal/SDKMessageEnum;

    const/4 v2, 0x5

    const/4 v3, 0x0

    .line 4
    invoke-static {v0, v3, v1, v2}, Lcom/facebook/gamingservices/cloudgaming/DaemonRequest;->executeAndWait(Landroid/content/Context;Lorg/json/JSONObject;Lcom/facebook/gamingservices/cloudgaming/internal/SDKMessageEnum;I)Lcom/facebook/GraphResponse;

    move-result-object v0

    if-nez v0, :cond_18

    :goto_16
    move-object v0, v3

    goto :goto_25

    .line 5
    :cond_18
    invoke-virtual {v0}, Lcom/facebook/GraphResponse;->getJSONObject()Lorg/json/JSONObject;

    move-result-object v0

    if-nez v0, :cond_1f

    goto :goto_16

    :cond_1f
    const-string v1, "id"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    :goto_25
    if-nez v0, :cond_28

    return-object v3

    .line 6
    :cond_28
    new-instance v1, Lcom/facebook/gamingservices/GamingContext;

    invoke-direct {v1, v0}, Lcom/facebook/gamingservices/GamingContext;-><init>(Ljava/lang/String;)V

    return-object v1

    .line 7
    :cond_2e
    # getter for: Lcom/facebook/gamingservices/GamingContext;->currentContext:Lcom/facebook/gamingservices/GamingContext;
    invoke-static {}, Lcom/facebook/gamingservices/GamingContext;->access$getCurrentContext$cp()Lcom/facebook/gamingservices/GamingContext;

    move-result-object v0

    return-object v0
.end method

.method public final setCurrentGamingContext(Lcom/facebook/gamingservices/GamingContext;)V
    .registers 3

    const-string v0, "ctx"

    invoke-static {p1, v0}, Lcom/shopee/sz/loadtask/datasource/a;->y(Ljava/lang/Object;Ljava/lang/String;)V

    .line 1
    invoke-static {}, Lcom/facebook/gamingservices/cloudgaming/CloudGameLoginHandler;->isRunningInCloud()Z

    move-result v0

    if-eqz v0, :cond_c

    return-void

    .line 2
    :cond_c
    invoke-static {p1}, Lcom/facebook/gamingservices/GamingContext;->access$setCurrentContext$cp(Lcom/facebook/gamingservices/GamingContext;)V

    return-void
.end method