.class public Lm1/j;
.super Ll1/o;
.source ""


# static fields
.field public static j:Lm1/j;

.field public static k:Lm1/j;

.field public static final l:Ljava/lang/Object;


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

.field public b:Landroidx/work/b;

.field public c:Landroidx/work/impl/WorkDatabase;

.field public d:Lx1/a;

.field public e:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lm1/d;",
            ">;"
        }
    .end annotation
.end field

.field public f:Lm1/c;

.field public g:Lv1/h;

.field public h:Z

.field public i:Landroid/content/BroadcastReceiver$PendingResult;


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

    const-string v0, "WorkManagerImpl"

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

    const/4 v0, 0x0

    sput-object v0, Lm1/j;->j:Lm1/j;

    sput-object v0, Lm1/j;->k:Lm1/j;

    new-instance v0, Ljava/lang/Object;

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

    sput-object v0, Lm1/j;->l:Ljava/lang/Object;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroidx/work/b;Lx1/a;)V
    .registers 31

    move-object/from16 v1, p0

    move-object/from16 v0, p2

    move-object/from16 v8, p3

    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f050006

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getBoolean(I)Z

    move-result v2

    .line 1
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    move-object v4, v8

    check-cast v4, Lx1/b;

    .line 2
    iget-object v4, v4, Lx1/b;->a:Lv1/j;

    .line 3
    sget v5, Landroidx/work/impl/WorkDatabase;->k:I

    .line 4
    const-class v5, Landroidx/work/impl/WorkDatabase;

    const/4 v6, 0x1

    if-eqz v2, :cond_2a

    .line 5
    new-instance v2, Lb1/h$a;

    const/4 v7, 0x0

    invoke-direct {v2, v3, v5, v7}, Lb1/h$a;-><init>(Landroid/content/Context;Ljava/lang/Class;Ljava/lang/String;)V

    .line 6
    iput-boolean v6, v2, Lb1/h$a;->h:Z

    goto :goto_3a

    .line 7
    :cond_2a
    sget-object v2, Lm1/i;->a:Ljava/lang/String;

    .line 8
    new-instance v2, Lb1/h$a;

    const-string v7, "androidx.work.workdb"

    invoke-direct {v2, v3, v5, v7}, Lb1/h$a;-><init>(Landroid/content/Context;Ljava/lang/Class;Ljava/lang/String;)V

    .line 9
    new-instance v5, Lm1/g;

    invoke-direct {v5, v3}, Lm1/g;-><init>(Landroid/content/Context;)V

    .line 10
    iput-object v5, v2, Lb1/h$a;->g:Le1/b$c;

    .line 11
    :goto_3a
    iput-object v4, v2, Lb1/h$a;->e:Ljava/util/concurrent/Executor;

    .line 12
    new-instance v4, Lm1/h;

    invoke-direct {v4}, Lm1/h;-><init>()V

    .line 13
    iget-object v5, v2, Lb1/h$a;->d:Ljava/util/ArrayList;

    if-nez v5, :cond_4c

    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V

    iput-object v5, v2, Lb1/h$a;->d:Ljava/util/ArrayList;

    :cond_4c
    iget-object v5, v2, Lb1/h$a;->d:Ljava/util/ArrayList;

    invoke-virtual {v5, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    new-array v4, v6, [Lc1/a;

    .line 14
    sget-object v5, Landroidx/work/impl/a;->a:Lc1/a;

    const/4 v7, 0x0

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    new-instance v5, Landroidx/work/impl/a$h;

    const/4 v9, 0x2

    const/4 v10, 0x3

    invoke-direct {v5, v3, v9, v10}, Landroidx/work/impl/a$h;-><init>(Landroid/content/Context;II)V

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    sget-object v5, Landroidx/work/impl/a;->b:Lc1/a;

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    sget-object v5, Landroidx/work/impl/a;->c:Lc1/a;

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    new-instance v5, Landroidx/work/impl/a$h;

    const/4 v11, 0x5

    const/4 v12, 0x6

    invoke-direct {v5, v3, v11, v12}, Landroidx/work/impl/a$h;-><init>(Landroid/content/Context;II)V

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    sget-object v5, Landroidx/work/impl/a;->d:Lc1/a;

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    sget-object v5, Landroidx/work/impl/a;->e:Lc1/a;

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    sget-object v5, Landroidx/work/impl/a;->f:Lc1/a;

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    new-instance v5, Landroidx/work/impl/a$i;

    invoke-direct {v5, v3}, Landroidx/work/impl/a$i;-><init>(Landroid/content/Context;)V

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v4, v6, [Lc1/a;

    new-instance v5, Landroidx/work/impl/a$h;

    const/16 v11, 0xa

    const/16 v12, 0xb

    invoke-direct {v5, v3, v11, v12}, Landroidx/work/impl/a$h;-><init>(Landroid/content/Context;II)V

    aput-object v5, v4, v7

    invoke-virtual {v2, v4}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    new-array v3, v6, [Lc1/a;

    sget-object v4, Landroidx/work/impl/a;->g:Lc1/a;

    aput-object v4, v3, v7

    invoke-virtual {v2, v3}, Lb1/h$a;->a([Lc1/a;)Lb1/h$a;

    .line 15
    iput-boolean v7, v2, Lb1/h$a;->i:Z

    iput-boolean v6, v2, Lb1/h$a;->j:Z

    .line 16
    iget-object v12, v2, Lb1/h$a;->c:Landroid/content/Context;

    if-eqz v12, :cond_2a5

    iget-object v3, v2, Lb1/h$a;->a:Ljava/lang/Class;

    if-eqz v3, :cond_29d

    iget-object v3, v2, Lb1/h$a;->e:Ljava/util/concurrent/Executor;

    if-nez v3, :cond_e2

    iget-object v4, v2, Lb1/h$a;->f:Ljava/util/concurrent/Executor;

    if-nez v4, :cond_e2

    sget-object v3, Ll/a;->c:Ljava/util/concurrent/Executor;

    iput-object v3, v2, Lb1/h$a;->f:Ljava/util/concurrent/Executor;

    goto :goto_f1

    :cond_e2
    if-eqz v3, :cond_eb

    iget-object v4, v2, Lb1/h$a;->f:Ljava/util/concurrent/Executor;

    if-nez v4, :cond_eb

    iput-object v3, v2, Lb1/h$a;->f:Ljava/util/concurrent/Executor;

    goto :goto_f3

    :cond_eb
    if-nez v3, :cond_f3

    iget-object v3, v2, Lb1/h$a;->f:Ljava/util/concurrent/Executor;

    if-eqz v3, :cond_f3

    :goto_f1
    iput-object v3, v2, Lb1/h$a;->e:Ljava/util/concurrent/Executor;

    :cond_f3
    :goto_f3
    iget-object v3, v2, Lb1/h$a;->g:Le1/b$c;

    if-nez v3, :cond_fe

    new-instance v3, Lf1/d;

    invoke-direct {v3}, Lf1/d;-><init>()V

    iput-object v3, v2, Lb1/h$a;->g:Le1/b$c;

    :cond_fe
    new-instance v3, Lb1/a;

    iget-object v13, v2, Lb1/h$a;->b:Ljava/lang/String;

    iget-object v14, v2, Lb1/h$a;->g:Le1/b$c;

    iget-object v15, v2, Lb1/h$a;->k:Lb1/h$c;

    iget-object v4, v2, Lb1/h$a;->d:Ljava/util/ArrayList;

    iget-boolean v5, v2, Lb1/h$a;->h:Z

    const-string v6, "activity"

    .line 17
    invoke-virtual {v12, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Landroid/app/ActivityManager;

    if-eqz v6, :cond_11b

    .line 18
    invoke-virtual {v6}, Landroid/app/ActivityManager;->isLowRamDevice()Z

    move-result v6

    if-nez v6, :cond_11b

    move v9, v10

    .line 19
    :cond_11b
    iget-object v6, v2, Lb1/h$a;->e:Ljava/util/concurrent/Executor;

    iget-object v7, v2, Lb1/h$a;->f:Ljava/util/concurrent/Executor;

    const/16 v21, 0x0

    iget-boolean v10, v2, Lb1/h$a;->i:Z

    iget-boolean v11, v2, Lb1/h$a;->j:Z

    const/16 v24, 0x0

    const/16 v25, 0x0

    const/16 v26, 0x0

    move/from16 v23, v11

    move-object v11, v3

    move-object/from16 v16, v4

    move/from16 v17, v5

    move/from16 v18, v9

    move-object/from16 v19, v6

    move-object/from16 v20, v7

    move/from16 v22, v10

    invoke-direct/range {v11 .. v26}, Lb1/a;-><init>(Landroid/content/Context;Ljava/lang/String;Le1/b$c;Lb1/h$c;Ljava/util/List;ZILjava/util/concurrent/Executor;Ljava/util/concurrent/Executor;ZZZLjava/util/Set;Ljava/lang/String;Ljava/io/File;)V

    iget-object v2, v2, Lb1/h$a;->a:Ljava/lang/Class;

    .line 20
    invoke-virtual {v2}, Ljava/lang/Class;->getPackage()Ljava/lang/Package;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Package;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v2}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v7}, Ljava/lang/String;->isEmpty()Z

    move-result v11

    if-eqz v11, :cond_152

    goto :goto_15c

    :cond_152
    invoke-virtual {v7}, Ljava/lang/String;->length()I

    move-result v11

    add-int/lit8 v11, v11, 0x1

    invoke-virtual {v10, v11}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v10

    :goto_15c
    new-instance v11, Ljava/lang/StringBuilder;

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

    const/16 v12, 0x2e

    const/16 v13, 0x5f

    invoke-virtual {v10, v12, v13}, Ljava/lang/String;->replace(CC)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v11, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v10, "_Impl"

    invoke-virtual {v11, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    :try_start_175
    invoke-virtual {v7}, Ljava/lang/String;->isEmpty()Z

    move-result v11

    if-eqz v11, :cond_17d

    move-object v7, v10

    goto :goto_191

    :cond_17d
    new-instance v11, Ljava/lang/StringBuilder;

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

    invoke-virtual {v11, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v7, "."

    invoke-virtual {v11, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v11, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    :goto_191
    invoke-static {v7}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v2
    :try_end_199
    .catch Ljava/lang/ClassNotFoundException; {:try_start_175 .. :try_end_199} :catch_279
    .catch Ljava/lang/IllegalAccessException; {:try_start_175 .. :try_end_199} :catch_262
    .catch Ljava/lang/InstantiationException; {:try_start_175 .. :try_end_199} :catch_24b

    .line 21
    check-cast v2, Lb1/h;

    .line 22
    invoke-virtual {v2, v3}, Lb1/h;->f(Lb1/a;)Le1/b;

    move-result-object v7

    iput-object v7, v2, Lb1/h;->c:Le1/b;

    instance-of v10, v7, Lb1/k;

    if-eqz v10, :cond_1aa

    move-object v10, v7

    check-cast v10, Lb1/k;

    .line 23
    iput-object v3, v10, Lb1/k;->w:Lb1/a;

    :cond_1aa
    const/4 v3, 0x3

    if-ne v9, v3, :cond_1af

    const/4 v3, 0x1

    goto :goto_1b0

    :cond_1af
    const/4 v3, 0x0

    .line 24
    :goto_1b0
    invoke-interface {v7, v3}, Le1/b;->setWriteAheadLoggingEnabled(Z)V

    iput-object v4, v2, Lb1/h;->g:Ljava/util/List;

    iput-object v6, v2, Lb1/h;->b:Ljava/util/concurrent/Executor;

    .line 25
    new-instance v4, Ljava/util/ArrayDeque;

    invoke-direct {v4}, Ljava/util/ArrayDeque;-><init>()V

    .line 26
    iput-boolean v5, v2, Lb1/h;->e:Z

    iput-boolean v3, v2, Lb1/h;->f:Z

    .line 27
    move-object v9, v2

    check-cast v9, Landroidx/work/impl/WorkDatabase;

    .line 28
    invoke-direct/range {p0 .. p0}, Ll1/o;-><init>()V

    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    new-instance v3, Ll1/i$a;

    .line 29
    iget v4, v0, Landroidx/work/b;->f:I

    .line 30
    invoke-direct {v3, v4}, Ll1/i$a;-><init>(I)V

    .line 31
    const-class v4, Ll1/i;

    monitor-enter v4

    :try_start_1d4
    sput-object v3, Ll1/i;->a:Ll1/i;
    :try_end_1d6
    .catchall {:try_start_1d4 .. :try_end_1d6} :catchall_247

    monitor-exit v4

    const/4 v3, 0x2

    new-array v3, v3, [Lm1/d;

    .line 32
    sget-object v4, Lm1/e;->a:Ljava/lang/String;

    .line 33
    new-instance v4, Lp1/b;

    invoke-direct {v4, v2, v1}, Lp1/b;-><init>(Landroid/content/Context;Lm1/j;)V

    const-class v5, Landroidx/work/impl/background/systemjob/SystemJobService;

    const/4 v6, 0x1

    invoke-static {v2, v5, v6}, Lv1/g;->a(Landroid/content/Context;Ljava/lang/Class;Z)V

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

    move-result-object v5

    sget-object v7, Lm1/e;->a:Ljava/lang/String;

    const/4 v10, 0x0

    new-array v11, v10, [Ljava/lang/Throwable;

    const-string v12, "Created SystemJobScheduler and enabled SystemJobService"

    invoke-virtual {v5, v7, v12, v11}, Ll1/i;->a(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V

    aput-object v4, v3, v10

    .line 34
    new-instance v4, Ln1/c;

    invoke-direct {v4, v2, v0, v8, v1}, Ln1/c;-><init>(Landroid/content/Context;Landroidx/work/b;Lx1/a;Lm1/j;)V

    aput-object v4, v3, v6

    invoke-static {v3}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v10

    .line 35
    new-instance v11, Lm1/c;

    move-object v2, v11

    move-object/from16 v3, p1

    move-object/from16 v4, p2

    move-object/from16 v5, p3

    move-object v6, v9

    move-object v7, v10

    invoke-direct/range {v2 .. v7}, Lm1/c;-><init>(Landroid/content/Context;Landroidx/work/b;Lx1/a;Landroidx/work/impl/WorkDatabase;Ljava/util/List;)V

    .line 36
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    iput-object v2, v1, Lm1/j;->a:Landroid/content/Context;

    iput-object v0, v1, Lm1/j;->b:Landroidx/work/b;

    iput-object v8, v1, Lm1/j;->d:Lx1/a;

    iput-object v9, v1, Lm1/j;->c:Landroidx/work/impl/WorkDatabase;

    iput-object v10, v1, Lm1/j;->e:Ljava/util/List;

    iput-object v11, v1, Lm1/j;->f:Lm1/c;

    new-instance v0, Lv1/h;

    invoke-direct {v0, v9}, Lv1/h;-><init>(Landroidx/work/impl/WorkDatabase;)V

    iput-object v0, v1, Lm1/j;->g:Lv1/h;

    const/4 v0, 0x0

    iput-boolean v0, v1, Lm1/j;->h:Z

    invoke-virtual {v2}, Landroid/content/Context;->isDeviceProtectedStorage()Z

    move-result v0

    if-nez v0, :cond_23f

    iget-object v0, v1, Lm1/j;->d:Lx1/a;

    new-instance v3, Landroidx/work/impl/utils/ForceStopRunnable;

    invoke-direct {v3, v2, v1}, Landroidx/work/impl/utils/ForceStopRunnable;-><init>(Landroid/content/Context;Lm1/j;)V

    check-cast v0, Lx1/b;

    .line 37
    iget-object v0, v0, Lx1/b;->a:Lv1/j;

    invoke-virtual {v0, v3}, Lv1/j;->execute(Ljava/lang/Runnable;)V

    return-void

    .line 38
    :cond_23f
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v2, "Cannot initialize WorkManager in direct boot mode"

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

    throw v0

    :catchall_247
    move-exception v0

    move-object v2, v0

    .line 39
    monitor-exit v4

    throw v2

    .line 40
    :catch_24b
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v3, "Failed to create an instance of "

    invoke-static {v3}, Landroidx/activity/c;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v2}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

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

    throw v0

    :catch_262
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v3, "Cannot access the constructor"

    invoke-static {v3}, Landroidx/activity/c;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v2}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

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

    throw v0

    :catch_279
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v3, "cannot find implementation for "

    invoke-static {v3}, Landroidx/activity/c;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v2}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, ". "

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, " does not exist"

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

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

    throw v0

    .line 41
    :cond_29d
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v2, "Must provide an abstract class that extends RoomDatabase"

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

    throw v0

    :cond_2a5
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v2, "Cannot provide null context for the database."

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

    throw v0
.end method

.method public static b(Landroid/content/Context;)Lm1/j;
    .registers 3

    sget-object v0, Lm1/j;->l:Ljava/lang/Object;

    monitor-enter v0

    .line 1
    :try_start_3
    monitor-enter v0
    :try_end_4
    .catchall {:try_start_3 .. :try_end_4} :catchall_35

    :try_start_4
    sget-object v1, Lm1/j;->j:Lm1/j;

    if-eqz v1, :cond_a

    :goto_8
    monitor-exit v0

    goto :goto_d

    :cond_a
    sget-object v1, Lm1/j;->k:Lm1/j;
    :try_end_c
    .catchall {:try_start_4 .. :try_end_c} :catchall_30

    goto :goto_8

    :goto_d
    if-nez v1, :cond_2e

    .line 2
    :try_start_f
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p0

    instance-of v1, p0, Landroidx/work/b$b;

    if-eqz v1, :cond_26

    move-object v1, p0

    check-cast v1, Landroidx/work/b$b;

    invoke-interface {v1}, Landroidx/work/b$b;->a()Landroidx/work/b;

    move-result-object v1

    invoke-static {p0, v1}, Lm1/j;->c(Landroid/content/Context;Landroidx/work/b;)V

    invoke-static {p0}, Lm1/j;->b(Landroid/content/Context;)Lm1/j;

    move-result-object v1

    goto :goto_2e

    :cond_26
    new-instance p0, Ljava/lang/IllegalStateException;

    const-string v1, "WorkManager is not initialized properly.  You have explicitly disabled WorkManagerInitializer in your manifest, have not manually called WorkManager#initialize at this point, and your Application does not implement Configuration.Provider."

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

    throw p0

    :cond_2e
    :goto_2e
    monitor-exit v0
    :try_end_2f
    .catchall {:try_start_f .. :try_end_2f} :catchall_35

    return-object v1

    :catchall_30
    move-exception p0

    .line 3
    :try_start_31
    monitor-exit v0
    :try_end_32
    .catchall {:try_start_31 .. :try_end_32} :catchall_30

    :try_start_32
    throw p0

    .line 4
    :goto_33
    monitor-exit v0
    :try_end_34
    .catchall {:try_start_32 .. :try_end_34} :catchall_35

    throw p0

    :catchall_35
    move-exception p0

    goto :goto_33
.end method

.method public static c(Landroid/content/Context;Landroidx/work/b;)V
    .registers 6

    sget-object v0, Lm1/j;->l:Ljava/lang/Object;

    monitor-enter v0

    :try_start_3
    sget-object v1, Lm1/j;->j:Lm1/j;

    if-eqz v1, :cond_14

    sget-object v2, Lm1/j;->k:Lm1/j;

    if-nez v2, :cond_c

    goto :goto_14

    :cond_c
    new-instance p0, Ljava/lang/IllegalStateException;

    const-string p1, "WorkManager is already initialized.  Did you try to initialize it manually without disabling WorkManagerInitializer? See WorkManager#initialize(Context, Configuration) or the class level Javadoc for more information."

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

    throw p0

    :cond_14
    :goto_14
    if-nez v1, :cond_30

    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p0

    sget-object v1, Lm1/j;->k:Lm1/j;

    if-nez v1, :cond_2c

    new-instance v1, Lm1/j;

    new-instance v2, Lx1/b;

    .line 1
    iget-object v3, p1, Landroidx/work/b;->b:Ljava/util/concurrent/Executor;

    .line 2
    invoke-direct {v2, v3}, Lx1/b;-><init>(Ljava/util/concurrent/Executor;)V

    invoke-direct {v1, p0, p1, v2}, Lm1/j;-><init>(Landroid/content/Context;Landroidx/work/b;Lx1/a;)V

    sput-object v1, Lm1/j;->k:Lm1/j;

    :cond_2c
    sget-object p0, Lm1/j;->k:Lm1/j;

    sput-object p0, Lm1/j;->j:Lm1/j;

    :cond_30
    monitor-exit v0

    return-void

    :catchall_32
    move-exception p0

    monitor-exit v0
    :try_end_34
    .catchall {:try_start_3 .. :try_end_34} :catchall_32

    throw p0
.end method


# virtual methods
.method public d()V
    .registers 3

    sget-object v0, Lm1/j;->l:Ljava/lang/Object;

    monitor-enter v0

    const/4 v1, 0x1

    :try_start_4
    iput-boolean v1, p0, Lm1/j;->h:Z

    iget-object v1, p0, Lm1/j;->i:Landroid/content/BroadcastReceiver$PendingResult;

    if-eqz v1, :cond_10

    invoke-virtual {v1}, Landroid/content/BroadcastReceiver$PendingResult;->finish()V

    const/4 v1, 0x0

    iput-object v1, p0, Lm1/j;->i:Landroid/content/BroadcastReceiver$PendingResult;

    :cond_10
    monitor-exit v0

    return-void

    :catchall_12
    move-exception v1

    monitor-exit v0
    :try_end_14
    .catchall {:try_start_4 .. :try_end_14} :catchall_12

    throw v1
.end method

.method public e()V
    .registers 5

    .line 1
    iget-object v0, p0, Lm1/j;->a:Landroid/content/Context;

    .line 2
    sget-object v1, Lp1/b;->v:Ljava/lang/String;

    const-string v1, "jobscheduler"

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

    move-result-object v1

    check-cast v1, Landroid/app/job/JobScheduler;

    if-eqz v1, :cond_32

    invoke-static {v0, v1}, Lp1/b;->e(Landroid/content/Context;Landroid/app/job/JobScheduler;)Ljava/util/List;

    move-result-object v0

    if-eqz v0, :cond_32

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v2

    if-nez v2, :cond_32

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_1e
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_32

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/app/job/JobInfo;

    invoke-virtual {v2}, Landroid/app/job/JobInfo;->getId()I

    move-result v2

    invoke-static {v1, v2}, Lp1/b;->a(Landroid/app/job/JobScheduler;I)V

    goto :goto_1e

    .line 4
    :cond_32
    iget-object v0, p0, Lm1/j;->c:Landroidx/work/impl/WorkDatabase;

    .line 5
    invoke-virtual {v0}, Landroidx/work/impl/WorkDatabase;->q()Lu1/q;

    move-result-object v0

    check-cast v0, Lu1/r;

    .line 6
    iget-object v1, v0, Lu1/r;->a:Lb1/h;

    invoke-virtual {v1}, Lb1/h;->b()V

    iget-object v1, v0, Lu1/r;->i:Lb1/l;

    invoke-virtual {v1}, Lb1/l;->a()Lf1/f;

    move-result-object v1

    iget-object v2, v0, Lu1/r;->a:Lb1/h;

    invoke-virtual {v2}, Lb1/h;->c()V

    :try_start_4a
    invoke-virtual {v1}, Lf1/f;->b()I

    iget-object v2, v0, Lu1/r;->a:Lb1/h;

    invoke-virtual {v2}, Lb1/h;->k()V
    :try_end_52
    .catchall {:try_start_4a .. :try_end_52} :catchall_6d

    iget-object v2, v0, Lu1/r;->a:Lb1/h;

    invoke-virtual {v2}, Lb1/h;->g()V

    iget-object v0, v0, Lu1/r;->i:Lb1/l;

    .line 7
    iget-object v2, v0, Lb1/l;->c:Lf1/f;

    if-ne v1, v2, :cond_63

    iget-object v0, v0, Lb1/l;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 8
    :cond_63
    iget-object v0, p0, Lm1/j;->b:Landroidx/work/b;

    .line 9
    iget-object v1, p0, Lm1/j;->c:Landroidx/work/impl/WorkDatabase;

    .line 10
    iget-object v2, p0, Lm1/j;->e:Ljava/util/List;

    .line 11
    invoke-static {v0, v1, v2}, Lm1/e;->a(Landroidx/work/b;Landroidx/work/impl/WorkDatabase;Ljava/util/List;)V

    return-void

    :catchall_6d
    move-exception v2

    .line 12
    iget-object v3, v0, Lu1/r;->a:Lb1/h;

    invoke-virtual {v3}, Lb1/h;->g()V

    iget-object v0, v0, Lu1/r;->i:Lb1/l;

    invoke-virtual {v0, v1}, Lb1/l;->c(Lf1/f;)V

    throw v2
.end method

.method public f(Ljava/lang/String;)V
    .registers 5

    iget-object v0, p0, Lm1/j;->d:Lx1/a;

    new-instance v1, Lv1/l;

    const/4 v2, 0x0

    invoke-direct {v1, p0, p1, v2}, Lv1/l;-><init>(Lm1/j;Ljava/lang/String;Z)V

    check-cast v0, Lx1/b;

    .line 1
    iget-object p1, v0, Lx1/b;->a:Lv1/j;

    invoke-virtual {p1, v1}, Lv1/j;->execute(Ljava/lang/Runnable;)V

    return-void
.end method
