.class public Lz3/m;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Landroid/os/Handler$Callback;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lz3/m$b;
    }
.end annotation


# static fields
.field public static final x:Lz3/m$b;


# instance fields
.field public volatile r:Lcom/bumptech/glide/i;

.field public final s:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Landroid/app/FragmentManager;",
            "Lz3/l;",
            ">;"
        }
    .end annotation
.end field

.field public final t:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Landroidx/fragment/app/d0;",
            "Lz3/p;",
            ">;"
        }
    .end annotation
.end field

.field public final u:Landroid/os/Handler;

.field public final v:Lz3/m$b;

.field public final w:Lz3/h;


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

    new-instance v0, Lz3/m$a;

    invoke-direct {v0}, Lz3/m$a;-><init>()V

    sput-object v0, Lz3/m;->x:Lz3/m$b;

    return-void
.end method

.method public constructor <init>(Lz3/m$b;Lcom/bumptech/glide/e;)V
    .registers 4

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

    new-instance v0, Ljava/util/HashMap;

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

    iput-object v0, p0, Lz3/m;->s:Ljava/util/Map;

    new-instance v0, Ljava/util/HashMap;

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

    iput-object v0, p0, Lz3/m;->t:Ljava/util/Map;

    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    if-eqz p1, :cond_19

    goto :goto_1b

    :cond_19
    sget-object p1, Lz3/m;->x:Lz3/m$b;

    :goto_1b
    iput-object p1, p0, Lz3/m;->v:Lz3/m$b;

    new-instance p1, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-direct {p1, v0, p0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;Landroid/os/Handler$Callback;)V

    iput-object p1, p0, Lz3/m;->u:Landroid/os/Handler;

    .line 1
    sget-boolean p1, Lt3/q;->h:Z

    if-eqz p1, :cond_48

    sget-boolean p1, Lt3/q;->g:Z

    if-nez p1, :cond_31

    goto :goto_48

    :cond_31
    const-class p1, Lcom/bumptech/glide/c$d;

    .line 2
    iget-object p2, p2, Lcom/bumptech/glide/e;->a:Ljava/util/Map;

    invoke-interface {p2, p1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_41

    .line 3
    new-instance p1, Lz3/f;

    invoke-direct {p1}, Lz3/f;-><init>()V

    goto :goto_4e

    :cond_41
    new-instance p1, Lz3/g;

    const/4 p2, 0x0

    invoke-direct {p1, p2}, Lz3/g;-><init>(I)V

    goto :goto_4e

    :cond_48
    :goto_48
    new-instance p1, Lb3/c;

    const/4 p2, 0x1

    invoke-direct {p1, p2}, Lb3/c;-><init>(I)V

    .line 4
    :goto_4e
    iput-object p1, p0, Lz3/m;->w:Lz3/h;

    return-void
.end method

.method public static a(Landroid/content/Context;)Landroid/app/Activity;
    .registers 2

    instance-of v0, p0, Landroid/app/Activity;

    if-eqz v0, :cond_7

    check-cast p0, Landroid/app/Activity;

    return-object p0

    :cond_7
    instance-of v0, p0, Landroid/content/ContextWrapper;

    if-eqz v0, :cond_16

    check-cast p0, Landroid/content/ContextWrapper;

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

    move-result-object p0

    invoke-static {p0}, Lz3/m;->a(Landroid/content/Context;)Landroid/app/Activity;

    move-result-object p0

    return-object p0

    :cond_16
    const/4 p0, 0x0

    return-object p0
.end method

.method public static f(Landroid/content/Context;)Z
    .registers 1

    invoke-static {p0}, Lz3/m;->a(Landroid/content/Context;)Landroid/app/Activity;

    move-result-object p0

    if-eqz p0, :cond_f

    invoke-virtual {p0}, Landroid/app/Activity;->isFinishing()Z

    move-result p0

    if-nez p0, :cond_d

    goto :goto_f

    :cond_d
    const/4 p0, 0x0

    goto :goto_10

    :cond_f
    :goto_f
    const/4 p0, 0x1

    :goto_10
    return p0
.end method


# virtual methods
.method public b(Landroid/content/Context;)Lcom/bumptech/glide/i;
    .registers 8

    if-eqz p1, :cond_cb

    invoke-static {}, Lg4/j;->i()Z

    move-result v0

    if-eqz v0, :cond_94

    instance-of v0, p1, Landroid/app/Application;

    if-nez v0, :cond_94

    instance-of v0, p1, Landroidx/fragment/app/r;

    if-eqz v0, :cond_17

    check-cast p1, Landroidx/fragment/app/r;

    invoke-virtual {p0, p1}, Lz3/m;->c(Landroidx/fragment/app/r;)Lcom/bumptech/glide/i;

    move-result-object p1

    return-object p1

    :cond_17
    instance-of v0, p1, Landroid/app/Activity;

    if-eqz v0, :cond_7a

    check-cast p1, Landroid/app/Activity;

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

    move-result v0

    if-eqz v0, :cond_2c

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

    move-result-object p1

    invoke-virtual {p0, p1}, Lz3/m;->b(Landroid/content/Context;)Lcom/bumptech/glide/i;

    move-result-object p1

    goto :goto_71

    :cond_2c
    instance-of v0, p1, Landroidx/fragment/app/r;

    if-eqz v0, :cond_37

    check-cast p1, Landroidx/fragment/app/r;

    invoke-virtual {p0, p1}, Lz3/m;->c(Landroidx/fragment/app/r;)Lcom/bumptech/glide/i;

    move-result-object p1

    goto :goto_71

    .line 2
    :cond_37
    invoke-virtual {p1}, Landroid/app/Activity;->isDestroyed()Z

    move-result v0

    if-nez v0, :cond_72

    .line 3
    iget-object v0, p0, Lz3/m;->w:Lz3/h;

    invoke-interface {v0, p1}, Lz3/h;->a(Landroid/app/Activity;)V

    invoke-virtual {p1}, Landroid/app/Activity;->getFragmentManager()Landroid/app/FragmentManager;

    move-result-object v0

    const/4 v1, 0x0

    invoke-static {p1}, Lz3/m;->f(Landroid/content/Context;)Z

    move-result v2

    .line 4
    invoke-virtual {p0, v0, v1}, Lz3/m;->d(Landroid/app/FragmentManager;Landroid/app/Fragment;)Lz3/l;

    move-result-object v0

    .line 5
    iget-object v1, v0, Lz3/l;->u:Lcom/bumptech/glide/i;

    if-nez v1, :cond_70

    .line 6
    invoke-static {p1}, Lcom/bumptech/glide/b;->b(Landroid/content/Context;)Lcom/bumptech/glide/b;

    move-result-object v1

    iget-object v3, p0, Lz3/m;->v:Lz3/m$b;

    .line 7
    iget-object v4, v0, Lz3/l;->r:Lz3/a;

    .line 8
    iget-object v5, v0, Lz3/l;->s:Lz3/n;

    .line 9
    check-cast v3, Lz3/m$a;

    invoke-static {v3}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 10
    new-instance v3, Lcom/bumptech/glide/i;

    invoke-direct {v3, v1, v4, v5, p1}, Lcom/bumptech/glide/i;-><init>(Lcom/bumptech/glide/b;Lz3/i;Lz3/n;Landroid/content/Context;)V

    if-eqz v2, :cond_6c

    .line 11
    invoke-virtual {v3}, Lcom/bumptech/glide/i;->onStart()V

    .line 12
    :cond_6c
    iput-object v3, v0, Lz3/l;->u:Lcom/bumptech/glide/i;

    move-object p1, v3

    goto :goto_71

    :cond_70
    move-object p1, v1

    :goto_71
    return-object p1

    .line 13
    :cond_72
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string v0, "You cannot start a load for a destroyed activity"

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

    throw p1

    .line 14
    :cond_7a
    instance-of v0, p1, Landroid/content/ContextWrapper;

    if-eqz v0, :cond_94

    move-object v0, p1

    check-cast v0, Landroid/content/ContextWrapper;

    invoke-virtual {v0}, Landroid/content/ContextWrapper;->getBaseContext()Landroid/content/Context;

    move-result-object v1

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

    move-result-object v1

    if-eqz v1, :cond_94

    invoke-virtual {v0}, Landroid/content/ContextWrapper;->getBaseContext()Landroid/content/Context;

    move-result-object p1

    invoke-virtual {p0, p1}, Lz3/m;->b(Landroid/content/Context;)Lcom/bumptech/glide/i;

    move-result-object p1

    return-object p1

    .line 15
    :cond_94
    iget-object v0, p0, Lz3/m;->r:Lcom/bumptech/glide/i;

    if-nez v0, :cond_c8

    monitor-enter p0

    :try_start_99
    iget-object v0, p0, Lz3/m;->r:Lcom/bumptech/glide/i;

    if-nez v0, :cond_c3

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

    move-result-object v0

    invoke-static {v0}, Lcom/bumptech/glide/b;->b(Landroid/content/Context;)Lcom/bumptech/glide/b;

    move-result-object v0

    iget-object v1, p0, Lz3/m;->v:Lz3/m$b;

    new-instance v2, Lb3/a;

    const/4 v3, 0x1

    invoke-direct {v2, v3}, Lb3/a;-><init>(I)V

    new-instance v3, Lz1/b;

    const/4 v4, 0x2

    invoke-direct {v3, v4}, Lz1/b;-><init>(I)V

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

    move-result-object p1

    check-cast v1, Lz3/m$a;

    invoke-static {v1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 16
    new-instance v1, Lcom/bumptech/glide/i;

    invoke-direct {v1, v0, v2, v3, p1}, Lcom/bumptech/glide/i;-><init>(Lcom/bumptech/glide/b;Lz3/i;Lz3/n;Landroid/content/Context;)V

    .line 17
    iput-object v1, p0, Lz3/m;->r:Lcom/bumptech/glide/i;

    :cond_c3
    monitor-exit p0

    goto :goto_c8

    :catchall_c5
    move-exception p1

    monitor-exit p0
    :try_end_c7
    .catchall {:try_start_99 .. :try_end_c7} :catchall_c5

    throw p1

    :cond_c8
    :goto_c8
    iget-object p1, p0, Lz3/m;->r:Lcom/bumptech/glide/i;

    return-object p1

    .line 18
    :cond_cb
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string v0, "You cannot start a load on a null Context"

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

    throw p1
.end method

.method public c(Landroidx/fragment/app/r;)Lcom/bumptech/glide/i;
    .registers 8

    invoke-static {}, Lg4/j;->h()Z

    move-result v0

    if-eqz v0, :cond_f

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

    move-result-object p1

    invoke-virtual {p0, p1}, Lz3/m;->b(Landroid/content/Context;)Lcom/bumptech/glide/i;

    move-result-object p1

    return-object p1

    .line 1
    :cond_f
    invoke-virtual {p1}, Landroid/app/Activity;->isDestroyed()Z

    move-result v0

    if-nez v0, :cond_48

    .line 2
    iget-object v0, p0, Lz3/m;->w:Lz3/h;

    invoke-interface {v0, p1}, Lz3/h;->a(Landroid/app/Activity;)V

    invoke-virtual {p1}, Landroidx/fragment/app/r;->p()Landroidx/fragment/app/d0;

    move-result-object v0

    const/4 v1, 0x0

    invoke-static {p1}, Lz3/m;->f(Landroid/content/Context;)Z

    move-result v2

    .line 3
    invoke-virtual {p0, v0, v1}, Lz3/m;->e(Landroidx/fragment/app/d0;Landroidx/fragment/app/o;)Lz3/p;

    move-result-object v0

    .line 4
    iget-object v1, v0, Lz3/p;->o0:Lcom/bumptech/glide/i;

    if-nez v1, :cond_47

    .line 5
    invoke-static {p1}, Lcom/bumptech/glide/b;->b(Landroid/content/Context;)Lcom/bumptech/glide/b;

    move-result-object v1

    iget-object v3, p0, Lz3/m;->v:Lz3/m$b;

    .line 6
    iget-object v4, v0, Lz3/p;->k0:Lz3/a;

    .line 7
    iget-object v5, v0, Lz3/p;->l0:Lz3/n;

    .line 8
    check-cast v3, Lz3/m$a;

    invoke-static {v3}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 9
    new-instance v3, Lcom/bumptech/glide/i;

    invoke-direct {v3, v1, v4, v5, p1}, Lcom/bumptech/glide/i;-><init>(Lcom/bumptech/glide/b;Lz3/i;Lz3/n;Landroid/content/Context;)V

    if-eqz v2, :cond_44

    .line 10
    invoke-virtual {v3}, Lcom/bumptech/glide/i;->onStart()V

    .line 11
    :cond_44
    iput-object v3, v0, Lz3/p;->o0:Lcom/bumptech/glide/i;

    move-object v1, v3

    :cond_47
    return-object v1

    .line 12
    :cond_48
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string v0, "You cannot start a load for a destroyed activity"

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

    throw p1
.end method

.method public final d(Landroid/app/FragmentManager;Landroid/app/Fragment;)Lz3/l;
    .registers 6

    const-string v0, "com.bumptech.glide.manager"

    invoke-virtual {p1, v0}, Landroid/app/FragmentManager;->findFragmentByTag(Ljava/lang/String;)Landroid/app/Fragment;

    move-result-object v1

    check-cast v1, Lz3/l;

    if-nez v1, :cond_44

    iget-object v1, p0, Lz3/m;->s:Ljava/util/Map;

    invoke-interface {v1, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lz3/l;

    if-nez v1, :cond_44

    new-instance v1, Lz3/l;

    invoke-direct {v1}, Lz3/l;-><init>()V

    .line 1
    iput-object p2, v1, Lz3/l;->w:Landroid/app/Fragment;

    if-eqz p2, :cond_2a

    invoke-virtual {p2}, Landroid/app/Fragment;->getActivity()Landroid/app/Activity;

    move-result-object v2

    if-eqz v2, :cond_2a

    invoke-virtual {p2}, Landroid/app/Fragment;->getActivity()Landroid/app/Activity;

    move-result-object p2

    invoke-virtual {v1, p2}, Lz3/l;->a(Landroid/app/Activity;)V

    .line 2
    :cond_2a
    iget-object p2, p0, Lz3/m;->s:Ljava/util/Map;

    invoke-interface {p2, p1, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    invoke-virtual {p1}, Landroid/app/FragmentManager;->beginTransaction()Landroid/app/FragmentTransaction;

    move-result-object p2

    invoke-virtual {p2, v1, v0}, Landroid/app/FragmentTransaction;->add(Landroid/app/Fragment;Ljava/lang/String;)Landroid/app/FragmentTransaction;

    move-result-object p2

    invoke-virtual {p2}, Landroid/app/FragmentTransaction;->commitAllowingStateLoss()I

    iget-object p2, p0, Lz3/m;->u:Landroid/os/Handler;

    const/4 v0, 0x1

    invoke-virtual {p2, v0, p1}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object p1

    invoke-virtual {p1}, Landroid/os/Message;->sendToTarget()V

    :cond_44
    return-object v1
.end method

.method public final e(Landroidx/fragment/app/d0;Landroidx/fragment/app/o;)Lz3/p;
    .registers 7

    const-string v0, "com.bumptech.glide.manager"

    invoke-virtual {p1, v0}, Landroidx/fragment/app/d0;->I(Ljava/lang/String;)Landroidx/fragment/app/o;

    move-result-object v1

    check-cast v1, Lz3/p;

    if-nez v1, :cond_53

    iget-object v1, p0, Lz3/m;->t:Ljava/util/Map;

    invoke-interface {v1, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lz3/p;

    if-nez v1, :cond_53

    new-instance v1, Lz3/p;

    invoke-direct {v1}, Lz3/p;-><init>()V

    .line 1
    iput-object p2, v1, Lz3/p;->p0:Landroidx/fragment/app/o;

    if-eqz p2, :cond_37

    invoke-virtual {p2}, Landroidx/fragment/app/o;->j()Landroid/content/Context;

    move-result-object v2

    if-nez v2, :cond_24

    goto :goto_37

    :cond_24
    move-object v2, p2

    .line 2
    :goto_25
    iget-object v3, v2, Landroidx/fragment/app/o;->L:Landroidx/fragment/app/o;

    if-eqz v3, :cond_2b

    move-object v2, v3

    goto :goto_25

    .line 3
    :cond_2b
    iget-object v2, v2, Landroidx/fragment/app/o;->I:Landroidx/fragment/app/d0;

    if-nez v2, :cond_30

    goto :goto_37

    .line 4
    :cond_30
    invoke-virtual {p2}, Landroidx/fragment/app/o;->j()Landroid/content/Context;

    move-result-object p2

    invoke-virtual {v1, p2, v2}, Lz3/p;->i0(Landroid/content/Context;Landroidx/fragment/app/d0;)V

    .line 5
    :cond_37
    :goto_37
    iget-object p2, p0, Lz3/m;->t:Ljava/util/Map;

    invoke-interface {p2, p1, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 6
    new-instance p2, Landroidx/fragment/app/b;

    invoke-direct {p2, p1}, Landroidx/fragment/app/b;-><init>(Landroidx/fragment/app/d0;)V

    const/4 v2, 0x0

    const/4 v3, 0x1

    .line 7
    invoke-virtual {p2, v2, v1, v0, v3}, Landroidx/fragment/app/b;->e(ILandroidx/fragment/app/o;Ljava/lang/String;I)V

    .line 8
    invoke-virtual {p2, v3}, Landroidx/fragment/app/b;->d(Z)I

    .line 9
    iget-object p2, p0, Lz3/m;->u:Landroid/os/Handler;

    const/4 v0, 0x2

    invoke-virtual {p2, v0, p1}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object p1

    invoke-virtual {p1}, Landroid/os/Message;->sendToTarget()V

    :cond_53
    return-object v1
.end method

.method public handleMessage(Landroid/os/Message;)Z
    .registers 7

    iget v0, p1, Landroid/os/Message;->what:I

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-eq v0, v2, :cond_14

    const/4 v3, 0x2

    if-eq v0, v3, :cond_c

    const/4 v2, 0x0

    move-object p1, v1

    goto :goto_22

    :cond_c
    iget-object p1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    move-object v1, p1

    check-cast v1, Landroidx/fragment/app/d0;

    iget-object p1, p0, Lz3/m;->t:Ljava/util/Map;

    goto :goto_1b

    :cond_14
    iget-object p1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    move-object v1, p1

    check-cast v1, Landroid/app/FragmentManager;

    iget-object p1, p0, Lz3/m;->s:Ljava/util/Map;

    :goto_1b
    invoke-interface {p1, v1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    move-object v4, v1

    move-object v1, p1

    move-object p1, v4

    :goto_22
    if-eqz v2, :cond_43

    if-nez v1, :cond_43

    const/4 v0, 0x5

    const-string v1, "RMRetriever"

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

    move-result v0

    if-eqz v0, :cond_43

    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v3, "Failed to remove expected request manager fragment, manager: "

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

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

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

    move-result-object p1

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

    :cond_43
    return v2
.end method
