l$a.smali

.class final Lio/reactivex/internal/operators/observable/l$a;
.super Lio/reactivex/internal/observers/j;
.source "ObservableBufferTimed.java"

# interfaces
.implements Ljava/lang/Runnable;
.implements Lio/reactivex/disposables/b;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lio/reactivex/internal/operators/observable/l;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = "a"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        "U::",
        "Ljava/util/Collection<",
        "-TT;>;>",
        "Lio/reactivex/internal/observers/j<",
        "TT;TU;TU;>;",
        "Ljava/lang/Runnable;",
        "Lio/reactivex/disposables/b;"
    }
.end annotation


# instance fields
.field final g:Ljava/util/concurrent/Callable;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/Callable<",
            "TU;>;"
        }
    .end annotation
.end field

.field final h:J

.field final i:Ljava/util/concurrent/TimeUnit;

.field final j:I

.field final k:Z

.field final l:Lio/reactivex/x$c;

.field m:Ljava/util/Collection;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "TU;"
        }
    .end annotation
.end field

.field n:Lio/reactivex/disposables/b;

.field o:Lio/reactivex/disposables/b;

.field p:J

.field q:J


# direct methods
.method constructor <init>(Lio/reactivex/w;Ljava/util/concurrent/Callable;JLjava/util/concurrent/TimeUnit;IZLio/reactivex/x$c;)V
    .registers 10
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lio/reactivex/w<",
            "-TU;>;",
            "Ljava/util/concurrent/Callable<",
            "TU;>;J",
            "Ljava/util/concurrent/TimeUnit;",
            "IZ",
            "Lio/reactivex/x$c;",
            ")V"
        }
    .end annotation

    .line 1
    new-instance v0, Lio/reactivex/internal/queue/MpscLinkedQueue;

    invoke-direct {v0}, Lio/reactivex/internal/queue/MpscLinkedQueue;-><init>()V

    invoke-direct {p0, p1, v0}, Lio/reactivex/internal/observers/j;-><init>(Lio/reactivex/w;Lio/reactivex/c/a/j;)V

    .line 2
    iput-object p2, p0, Lio/reactivex/internal/operators/observable/l$a;->g:Ljava/util/concurrent/Callable;

    .line 3
    iput-wide p3, p0, Lio/reactivex/internal/operators/observable/l$a;->h:J

    .line 4
    iput-object p5, p0, Lio/reactivex/internal/operators/observable/l$a;->i:Ljava/util/concurrent/TimeUnit;

    .line 5
    iput p6, p0, Lio/reactivex/internal/operators/observable/l$a;->j:I

    .line 6
    iput-boolean p7, p0, Lio/reactivex/internal/operators/observable/l$a;->k:Z

    .line 7
    iput-object p8, p0, Lio/reactivex/internal/operators/observable/l$a;->l:Lio/reactivex/x$c;

    return-void
.end method


# virtual methods
.method public bridge synthetic a(Lio/reactivex/w;Ljava/lang/Object;)V
    .registers 3

    .line 1
    check-cast p2, Ljava/util/Collection;

    invoke-virtual {p0, p1, p2}, Lio/reactivex/internal/operators/observable/l$a;->a(Lio/reactivex/w;Ljava/util/Collection;)V

    return-void
.end method

.method public a(Lio/reactivex/w;Ljava/util/Collection;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lio/reactivex/w<",
            "-TU;>;TU;)V"
        }
    .end annotation

    .line 2
    invoke-interface {p1, p2}, Lio/reactivex/w;->onNext(Ljava/lang/Object;)V

    return-void
.end method

.method public dispose()V
    .registers 2

    .line 1
    iget-boolean v0, p0, Lio/reactivex/internal/observers/j;->d:Z

    if-nez v0, :cond_1a

    const/4 v0, 0x1

    .line 2
    iput-boolean v0, p0, Lio/reactivex/internal/observers/j;->d:Z

    .line 3
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->o:Lio/reactivex/disposables/b;

    invoke-interface {v0}, Lio/reactivex/disposables/b;->dispose()V

    .line 4
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->l:Lio/reactivex/x$c;

    invoke-interface {v0}, Lio/reactivex/disposables/b;->dispose()V

    .line 5
    monitor-enter p0

    const/4 v0, 0x0

    .line 6
    :try_start_13
    iput-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    .line 7
    monitor-exit p0

    goto :goto_1a

    :catchall_17
    move-exception v0

    monitor-exit p0
    :try_end_19
    .catchall {:try_start_13 .. :try_end_19} :catchall_17

    throw v0

    :cond_1a
    :goto_1a
    return-void
.end method

.method public isDisposed()Z
    .registers 2

    .line 1
    iget-boolean v0, p0, Lio/reactivex/internal/observers/j;->d:Z

    return v0
.end method

.method public onComplete()V
    .registers 4

    .line 1
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->l:Lio/reactivex/x$c;

    invoke-interface {v0}, Lio/reactivex/disposables/b;->dispose()V

    .line 2
    monitor-enter p0

    .line 3
    :try_start_6
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    const/4 v1, 0x0

    .line 4
    iput-object v1, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    .line 5
    monitor-exit p0
    :try_end_c
    .catchall {:try_start_6 .. :try_end_c} :catchall_25

    if-eqz v0, :cond_24

    .line 6
    iget-object v1, p0, Lio/reactivex/internal/observers/j;->c:Lio/reactivex/c/a/j;

    invoke-interface {v1, v0}, Lio/reactivex/c/a/k;->offer(Ljava/lang/Object;)Z

    const/4 v0, 0x1

    .line 7
    iput-boolean v0, p0, Lio/reactivex/internal/observers/j;->e:Z

    .line 8
    invoke-virtual {p0}, Lio/reactivex/internal/observers/j;->b()Z

    move-result v0

    if-eqz v0, :cond_24

    .line 9
    iget-object v0, p0, Lio/reactivex/internal/observers/j;->c:Lio/reactivex/c/a/j;

    iget-object v1, p0, Lio/reactivex/internal/observers/j;->b:Lio/reactivex/w;

    const/4 v2, 0x0

    invoke-static {v0, v1, v2, p0, p0}, Lio/reactivex/internal/util/k;->a(Lio/reactivex/c/a/j;Lio/reactivex/w;ZLio/reactivex/disposables/b;Lio/reactivex/internal/util/h;)V

    :cond_24
    return-void

    :catchall_25
    move-exception v0

    .line 10
    :try_start_26
    monitor-exit p0
    :try_end_27
    .catchall {:try_start_26 .. :try_end_27} :catchall_25

    throw v0
.end method

.method public onError(Ljava/lang/Throwable;)V
    .registers 3

    .line 1
    monitor-enter p0

    const/4 v0, 0x0

    .line 2
    :try_start_2
    iput-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    .line 3
    monitor-exit p0
    :try_end_5
    .catchall {:try_start_2 .. :try_end_5} :catchall_10

    .line 4
    iget-object v0, p0, Lio/reactivex/internal/observers/j;->b:Lio/reactivex/w;

    invoke-interface {v0, p1}, Lio/reactivex/w;->onError(Ljava/lang/Throwable;)V

    .line 5
    iget-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->l:Lio/reactivex/x$c;

    invoke-interface {p1}, Lio/reactivex/disposables/b;->dispose()V

    return-void

    :catchall_10
    move-exception p1

    .line 6
    :try_start_11
    monitor-exit p0
    :try_end_12
    .catchall {:try_start_11 .. :try_end_12} :catchall_10

    throw p1
.end method

.method public onNext(Ljava/lang/Object;)V
    .registers 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .line 1
    monitor-enter p0

    .line 2
    :try_start_1
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    if-nez v0, :cond_7

    .line 3
    monitor-exit p0

    return-void

    .line 4
    :cond_7
    invoke-interface {v0, p1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z

    .line 5
    invoke-interface {v0}, Ljava/util/Collection;->size()I

    move-result p1

    iget v1, p0, Lio/reactivex/internal/operators/observable/l$a;->j:I

    if-ge p1, v1, :cond_14

    .line 6
    monitor-exit p0

    return-void

    :cond_14
    const/4 p1, 0x0

    .line 7
    iput-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    .line 8
    iget-wide v1, p0, Lio/reactivex/internal/operators/observable/l$a;->p:J

    const-wide/16 v3, 0x1

    add-long/2addr v1, v3

    iput-wide v1, p0, Lio/reactivex/internal/operators/observable/l$a;->p:J

    .line 9
    monitor-exit p0
    :try_end_1f
    .catchall {:try_start_1 .. :try_end_1f} :catchall_65

    .line 10
    iget-boolean p1, p0, Lio/reactivex/internal/operators/observable/l$a;->k:Z

    if-eqz p1, :cond_28

    .line 11
    iget-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->n:Lio/reactivex/disposables/b;

    invoke-interface {p1}, Lio/reactivex/disposables/b;->dispose()V

    :cond_28
    const/4 p1, 0x0

    .line 12
    invoke-virtual {p0, v0, p1, p0}, Lio/reactivex/internal/observers/j;->b(Ljava/lang/Object;ZLio/reactivex/disposables/b;)V

    .line 13
    :try_start_2c
    iget-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->g:Ljava/util/concurrent/Callable;

    invoke-interface {p1}, Ljava/util/concurrent/Callable;->call()Ljava/lang/Object;

    move-result-object p1

    const-string v0, "The buffer supplied is null"

    invoke-static {p1, v0}, Lio/reactivex/internal/functions/a;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;

    check-cast p1, Ljava/util/Collection;
    :try_end_39
    .catch Ljava/lang/Throwable; {:try_start_2c .. :try_end_39} :catch_58

    .line 14
    monitor-enter p0

    .line 15
    :try_start_3a
    iput-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    .line 16
    iget-wide v0, p0, Lio/reactivex/internal/operators/observable/l$a;->q:J

    add-long/2addr v0, v3

    iput-wide v0, p0, Lio/reactivex/internal/operators/observable/l$a;->q:J

    .line 17
    monitor-exit p0
    :try_end_42
    .catchall {:try_start_3a .. :try_end_42} :catchall_55

    .line 18
    iget-boolean p1, p0, Lio/reactivex/internal/operators/observable/l$a;->k:Z

    if-eqz p1, :cond_54

    .line 19
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->l:Lio/reactivex/x$c;

    iget-wide v4, p0, Lio/reactivex/internal/operators/observable/l$a;->h:J

    iget-object v6, p0, Lio/reactivex/internal/operators/observable/l$a;->i:Ljava/util/concurrent/TimeUnit;

    move-object v1, p0

    move-wide v2, v4

    invoke-virtual/range {v0 .. v6}, Lio/reactivex/x$c;->a(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Lio/reactivex/disposables/b;

    move-result-object p1

    iput-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->n:Lio/reactivex/disposables/b;

    :cond_54
    return-void

    :catchall_55
    move-exception p1

    .line 20
    :try_start_56
    monitor-exit p0
    :try_end_57
    .catchall {:try_start_56 .. :try_end_57} :catchall_55

    throw p1

    :catch_58
    move-exception p1

    .line 21
    invoke-static {p1}, Lio/reactivex/exceptions/a;->b(Ljava/lang/Throwable;)V

    .line 22
    iget-object v0, p0, Lio/reactivex/internal/observers/j;->b:Lio/reactivex/w;

    invoke-interface {v0, p1}, Lio/reactivex/w;->onError(Ljava/lang/Throwable;)V

    .line 23
    invoke-virtual {p0}, Lio/reactivex/internal/operators/observable/l$a;->dispose()V

    return-void

    :catchall_65
    move-exception p1

    .line 24
    :try_start_66
    monitor-exit p0
    :try_end_67
    .catchall {:try_start_66 .. :try_end_67} :catchall_65

    throw p1
.end method

.method public onSubscribe(Lio/reactivex/disposables/b;)V
    .registers 9

    .line 1
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->o:Lio/reactivex/disposables/b;

    invoke-static {v0, p1}, Lio/reactivex/internal/disposables/DisposableHelper;->validate(Lio/reactivex/disposables/b;Lio/reactivex/disposables/b;)Z

    move-result v0

    if-eqz v0, :cond_3e

    .line 2
    iput-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->o:Lio/reactivex/disposables/b;

    .line 3
    :try_start_a
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->g:Ljava/util/concurrent/Callable;

    invoke-interface {v0}, Ljava/util/concurrent/Callable;->call()Ljava/lang/Object;

    move-result-object v0

    const-string v1, "The buffer supplied is null"

    invoke-static {v0, v1}, Lio/reactivex/internal/functions/a;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;

    check-cast v0, Ljava/util/Collection;
    :try_end_17
    .catch Ljava/lang/Throwable; {:try_start_a .. :try_end_17} :catch_2d

    .line 4
    iput-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    .line 5
    iget-object p1, p0, Lio/reactivex/internal/observers/j;->b:Lio/reactivex/w;

    invoke-interface {p1, p0}, Lio/reactivex/w;->onSubscribe(Lio/reactivex/disposables/b;)V

    .line 6
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->l:Lio/reactivex/x$c;

    iget-wide v4, p0, Lio/reactivex/internal/operators/observable/l$a;->h:J

    iget-object v6, p0, Lio/reactivex/internal/operators/observable/l$a;->i:Ljava/util/concurrent/TimeUnit;

    move-object v1, p0

    move-wide v2, v4

    invoke-virtual/range {v0 .. v6}, Lio/reactivex/x$c;->a(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Lio/reactivex/disposables/b;

    move-result-object p1

    iput-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->n:Lio/reactivex/disposables/b;

    goto :goto_3e

    :catch_2d
    move-exception v0

    .line 7
    invoke-static {v0}, Lio/reactivex/exceptions/a;->b(Ljava/lang/Throwable;)V

    .line 8
    invoke-interface {p1}, Lio/reactivex/disposables/b;->dispose()V

    .line 9
    iget-object p1, p0, Lio/reactivex/internal/observers/j;->b:Lio/reactivex/w;

    invoke-static {v0, p1}, Lio/reactivex/internal/disposables/EmptyDisposable;->error(Ljava/lang/Throwable;Lio/reactivex/w;)V

    .line 10
    iget-object p1, p0, Lio/reactivex/internal/operators/observable/l$a;->l:Lio/reactivex/x$c;

    invoke-interface {p1}, Lio/reactivex/disposables/b;->dispose()V

    :cond_3e
    :goto_3e
    return-void
.end method

.method public run()V
    .registers 8

    .line 1
    :try_start_0
    iget-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->g:Ljava/util/concurrent/Callable;

    invoke-interface {v0}, Ljava/util/concurrent/Callable;->call()Ljava/lang/Object;

    move-result-object v0

    const-string v1, "The bufferSupplier returned a null buffer"

    invoke-static {v0, v1}, Lio/reactivex/internal/functions/a;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;

    check-cast v0, Ljava/util/Collection;
    :try_end_d
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_d} :catch_28

    .line 2
    monitor-enter p0

    .line 3
    :try_start_e
    iget-object v1, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    if-eqz v1, :cond_23

    .line 4
    iget-wide v2, p0, Lio/reactivex/internal/operators/observable/l$a;->p:J

    iget-wide v4, p0, Lio/reactivex/internal/operators/observable/l$a;->q:J

    cmp-long v6, v2, v4

    if-eqz v6, :cond_1b

    goto :goto_23

    .line 5
    :cond_1b
    iput-object v0, p0, Lio/reactivex/internal/operators/observable/l$a;->m:Ljava/util/Collection;

    .line 6
    monitor-exit p0
    :try_end_1e
    .catchall {:try_start_e .. :try_end_1e} :catchall_25

    const/4 v0, 0x0

    .line 7
    invoke-virtual {p0, v1, v0, p0}, Lio/reactivex/internal/observers/j;->b(Ljava/lang/Object;ZLio/reactivex/disposables/b;)V

    return-void

    .line 8
    :cond_23
    :goto_23
    :try_start_23
    monitor-exit p0

    return-void

    :catchall_25
    move-exception v0

    .line 9
    monitor-exit p0
    :try_end_27
    .catchall {:try_start_23 .. :try_end_27} :catchall_25

    throw v0

    :catch_28
    move-exception v0

    .line 10
    invoke-static {v0}, Lio/reactivex/exceptions/a;->b(Ljava/lang/Throwable;)V

    .line 11
    invoke-virtual {p0}, Lio/reactivex/internal/operators/observable/l$a;->dispose()V

    .line 12
    iget-object v1, p0, Lio/reactivex/internal/observers/j;->b:Lio/reactivex/w;

    invoke-interface {v1, v0}, Lio/reactivex/w;->onError(Ljava/lang/Throwable;)V

    return-void
.end method