.class public Lcom/google/firebase/messaging/a;
.super Ljava/lang/Object;
.source ""


# static fields
.field public static final b:Ljava/lang/Object;

.field public static c:Lk8/i0;
    .annotation build Ljavax/annotation/concurrent/GuardedBy;
        value = "lock"
    .end annotation
.end field


# instance fields
.field public final a:Landroid/content/Context;


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

    new-instance v0, Ljava/lang/Object;

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

    sput-object v0, Lcom/google/firebase/messaging/a;->b:Ljava/lang/Object;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .registers 2

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

    iput-object p1, p0, Lcom/google/firebase/messaging/a;->a:Landroid/content/Context;

    return-void
.end method

.method public static a(Landroid/content/Context;Landroid/content/Intent;)Ln6/i;
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Landroid/content/Intent;",
            ")",
            "Ln6/i<",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation

    const-string v0, "FirebaseMessaging"

    const/4 v1, 0x3

    invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result v0

    if-eqz v0, :cond_10

    const-string v0, "FirebaseMessaging"

    const-string v2, "Binding to service"

    invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_10
    const-string v0, "com.google.firebase.MESSAGING_EVENT"

    .line 1
    sget-object v2, Lcom/google/firebase/messaging/a;->b:Ljava/lang/Object;

    monitor-enter v2

    :try_start_15
    sget-object v3, Lcom/google/firebase/messaging/a;->c:Lk8/i0;

    if-nez v3, :cond_20

    new-instance v3, Lk8/i0;

    invoke-direct {v3, p0, v0}, Lk8/i0;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    sput-object v3, Lcom/google/firebase/messaging/a;->c:Lk8/i0;

    :cond_20
    sget-object p0, Lcom/google/firebase/messaging/a;->c:Lk8/i0;

    monitor-exit v2
    :try_end_23
    .catchall {:try_start_15 .. :try_end_23} :catchall_76

    .line 2
    monitor-enter p0

    :try_start_24
    const-string v0, "FirebaseMessaging"

    invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result v0

    if-eqz v0, :cond_33

    const-string v0, "FirebaseMessaging"

    const-string v1, "new intent queued in the bind-strategy delivery"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_33
    new-instance v0, Lk8/i0$a;

    invoke-direct {v0, p1}, Lk8/i0$a;-><init>(Landroid/content/Intent;)V

    iget-object p1, p0, Lk8/i0;->t:Ljava/util/concurrent/ScheduledExecutorService;

    .line 3
    new-instance v1, Lk8/z;

    invoke-direct {v1, v0}, Lk8/z;-><init>(Lk8/i0$a;)V

    sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    const-wide/16 v3, 0x2328

    invoke-interface {p1, v1, v3, v4, v2}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;

    move-result-object v1

    .line 4
    iget-object v2, v0, Lk8/i0$a;->b:Ln6/j;

    .line 5
    iget-object v2, v2, Ln6/j;->a:Ln6/u;

    .line 6
    new-instance v3, Lf/o;

    invoke-direct {v3, v1}, Lf/o;-><init>(Ljava/util/concurrent/ScheduledFuture;)V

    .line 7
    iget-object v1, v2, Ln6/u;->b:Ln6/s;

    new-instance v4, Ln6/o;

    invoke-direct {v4, p1, v3}, Ln6/o;-><init>(Ljava/util/concurrent/Executor;Ln6/d;)V

    invoke-virtual {v1, v4}, Ln6/s;->a(Ln6/r;)V

    invoke-virtual {v2}, Ln6/u;->t()V

    .line 8
    iget-object p1, p0, Lk8/i0;->u:Ljava/util/Queue;

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

    invoke-virtual {p0}, Lk8/i0;->b()V

    .line 9
    iget-object p1, v0, Lk8/i0$a;->b:Ln6/j;

    .line 10
    iget-object p1, p1, Ln6/j;->a:Ln6/u;
    :try_end_69
    .catchall {:try_start_24 .. :try_end_69} :catchall_73

    .line 11
    monitor-exit p0

    .line 12
    sget-object p0, Lk8/h;->r:Lk8/h;

    sget-object v0, Lk8/f;->r:Lk8/f;

    invoke-virtual {p1, p0, v0}, Ln6/u;->f(Ljava/util/concurrent/Executor;Ln6/a;)Ln6/i;

    move-result-object p0

    return-object p0

    :catchall_73
    move-exception p1

    .line 13
    monitor-exit p0

    throw p1

    :catchall_76
    move-exception p0

    .line 14
    :try_start_77
    monitor-exit v2
    :try_end_78
    .catchall {:try_start_77 .. :try_end_78} :catchall_76

    throw p0
.end method


# virtual methods
.method public b(Landroid/content/Intent;)Ln6/i;
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Intent;",
            ")",
            "Ln6/i<",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation

    const-string v0, "gcm.rawData64"

    invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    if-eqz v1, :cond_15

    invoke-static {v1, v2}, Landroid/util/Base64;->decode(Ljava/lang/String;I)[B

    move-result-object v1

    const-string v3, "rawData"

    invoke-virtual {p1, v3, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;[B)Landroid/content/Intent;

    invoke-virtual {p1, v0}, Landroid/content/Intent;->removeExtra(Ljava/lang/String;)V

    :cond_15
    iget-object v0, p0, Lcom/google/firebase/messaging/a;->a:Landroid/content/Context;

    .line 1
    invoke-static {}, Lu5/j;->a()Z

    move-result v1

    if-eqz v1, :cond_28

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;

    move-result-object v1

    iget v1, v1, Landroid/content/pm/ApplicationInfo;->targetSdkVersion:I

    const/16 v3, 0x1a

    if-lt v1, v3, :cond_28

    const/4 v2, 0x1

    :cond_28
    invoke-virtual {p1}, Landroid/content/Intent;->getFlags()I

    move-result v1

    const/high16 v3, 0x10000000

    and-int/2addr v1, v3

    if-eqz v2, :cond_38

    if-nez v1, :cond_38

    invoke-static {v0, p1}, Lcom/google/firebase/messaging/a;->a(Landroid/content/Context;Landroid/content/Intent;)Ln6/i;

    move-result-object p1

    goto :goto_4c

    :cond_38
    sget-object v1, Lk8/h;->r:Lk8/h;

    new-instance v2, Lz5/w10;

    invoke-direct {v2, v0, p1}, Lz5/w10;-><init>(Landroid/content/Context;Landroid/content/Intent;)V

    invoke-static {v1, v2}, Ln6/l;->c(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Callable;)Ln6/i;

    move-result-object v2

    new-instance v3, Lj6/x3;

    invoke-direct {v3, v0, p1}, Lj6/x3;-><init>(Landroid/content/Context;Landroid/content/Intent;)V

    invoke-virtual {v2, v1, v3}, Ln6/i;->g(Ljava/util/concurrent/Executor;Ln6/a;)Ln6/i;

    move-result-object p1

    :goto_4c
    return-object p1
.end method
