.class public Lo1/a;
.super Ljava/lang/Object;
.source ""


# static fields
.field public static final a:Ljava/lang/String;


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

    const-string v0, "Alarms"

    invoke-static {v0}, Ll1/i;->e(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lo1/a;->a:Ljava/lang/String;

    return-void
.end method

.method public static a(Landroid/content/Context;Ljava/lang/String;I)V
    .registers 8

    const-string v0, "alarm"

    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/AlarmManager;

    invoke-static {p0, p1}, Landroidx/work/impl/background/systemalarm/a;->c(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v1

    const/high16 v2, 0x24000000

    invoke-static {p0, p2, v1, v2}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object p0

    if-eqz p0, :cond_37

    if-eqz v0, :cond_37

    invoke-static {}, Ll1/i;->c()Ll1/i;

    move-result-object v1

    sget-object v2, Lo1/a;->a:Ljava/lang/String;

    const/4 v3, 0x2

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object p1, v3, v4

    const/4 p1, 0x1

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p2

    aput-object p2, v3, p1

    const-string p1, "Cancelling existing alarm with (workSpecId, systemId) (%s, %s)"

    invoke-static {p1, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    new-array p2, v4, [Ljava/lang/Throwable;

    invoke-virtual {v1, v2, p1, p2}, Ll1/i;->a(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V

    invoke-virtual {v0, p0}, Landroid/app/AlarmManager;->cancel(Landroid/app/PendingIntent;)V

    :cond_37
    return-void
.end method

.method public static b(Landroid/content/Context;Lm1/j;Ljava/lang/String;J)V
    .registers 14

    .line 1
    iget-object p1, p1, Lm1/j;->c:Landroidx/work/impl/WorkDatabase;

    .line 2
    invoke-virtual {p1}, Landroidx/work/impl/WorkDatabase;->n()Lu1/h;

    move-result-object v0

    check-cast v0, Lu1/i;

    invoke-virtual {v0, p2}, Lu1/i;->a(Ljava/lang/String;)Lu1/g;

    move-result-object v1

    if-eqz v1, :cond_19

    iget p1, v1, Lu1/g;->b:I

    invoke-static {p0, p2, p1}, Lo1/a;->a(Landroid/content/Context;Ljava/lang/String;I)V

    iget p1, v1, Lu1/g;->b:I

    invoke-static {p0, p2, p1, p3, p4}, Lo1/a;->c(Landroid/content/Context;Ljava/lang/String;IJ)V

    goto :goto_5d

    .line 3
    :cond_19
    const-class v1, Lv1/f;

    monitor-enter v1

    :try_start_1c
    const-string v2, "next_alarm_manager_id"

    .line 4
    invoke-virtual {p1}, Lb1/h;->c()V
    :try_end_21
    .catchall {:try_start_1c .. :try_end_21} :catchall_63

    :try_start_21
    invoke-virtual {p1}, Landroidx/work/impl/WorkDatabase;->m()Lu1/e;

    move-result-object v3

    check-cast v3, Lu1/f;

    invoke-virtual {v3, v2}, Lu1/f;->a(Ljava/lang/String;)Ljava/lang/Long;

    move-result-object v3

    const/4 v4, 0x0

    if-eqz v3, :cond_33

    invoke-virtual {v3}, Ljava/lang/Long;->intValue()I

    move-result v3

    goto :goto_34

    :cond_33
    move v3, v4

    :goto_34
    const v5, 0x7fffffff

    if-ne v3, v5, :cond_3a

    goto :goto_3c

    :cond_3a
    add-int/lit8 v4, v3, 0x1

    .line 5
    :goto_3c
    invoke-virtual {p1}, Landroidx/work/impl/WorkDatabase;->m()Lu1/e;

    move-result-object v5

    new-instance v6, Lu1/d;

    int-to-long v7, v4

    invoke-direct {v6, v2, v7, v8}, Lu1/d;-><init>(Ljava/lang/String;J)V

    check-cast v5, Lu1/f;

    invoke-virtual {v5, v6}, Lu1/f;->b(Lu1/d;)V

    .line 6
    invoke-virtual {p1}, Lb1/h;->k()V
    :try_end_4e
    .catchall {:try_start_21 .. :try_end_4e} :catchall_5e

    :try_start_4e
    invoke-virtual {p1}, Lb1/h;->g()V

    .line 7
    monitor-exit v1
    :try_end_52
    .catchall {:try_start_4e .. :try_end_52} :catchall_63

    .line 8
    new-instance p1, Lu1/g;

    invoke-direct {p1, p2, v3}, Lu1/g;-><init>(Ljava/lang/String;I)V

    invoke-virtual {v0, p1}, Lu1/i;->b(Lu1/g;)V

    invoke-static {p0, p2, v3, p3, p4}, Lo1/a;->c(Landroid/content/Context;Ljava/lang/String;IJ)V

    :goto_5d
    return-void

    :catchall_5e
    move-exception p0

    .line 9
    :try_start_5f
    invoke-virtual {p1}, Lb1/h;->g()V

    throw p0

    :catchall_63
    move-exception p0

    .line 10
    monitor-exit v1
    :try_end_65
    .catchall {:try_start_5f .. :try_end_65} :catchall_63

    throw p0
.end method

.method public static c(Landroid/content/Context;Ljava/lang/String;IJ)V
    .registers 7

    const-string v0, "alarm"

    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/AlarmManager;

    const/high16 v1, 0xc000000

    invoke-static {p0, p1}, Landroidx/work/impl/background/systemalarm/a;->c(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;

    move-result-object p1

    invoke-static {p0, p2, p1, v1}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object p0

    if-eqz v0, :cond_18

    const/4 p1, 0x0

    invoke-virtual {v0, p1, p3, p4, p0}, Landroid/app/AlarmManager;->setExact(IJLandroid/app/PendingIntent;)V

    :cond_18
    return-void
.end method
