474 lines
		
	
	
		
			14 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
			
		
		
	
	
			474 lines
		
	
	
		
			14 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
| .class public final Lio/reactivex/rxjava3/internal/schedulers/k;
 | |
| .super Lai/o0;
 | |
| .source "SingleScheduler.java"
 | |
| 
 | |
| 
 | |
| # annotations
 | |
| .annotation system Ldalvik/annotation/MemberClasses;
 | |
|     value = {
 | |
|         Lio/reactivex/rxjava3/internal/schedulers/k$a;
 | |
|     }
 | |
| .end annotation
 | |
| 
 | |
| 
 | |
| # static fields
 | |
| .field public static final d:Ljava/lang/String; = "rx3.single-priority"
 | |
| 
 | |
| .field public static final e:Ljava/lang/String; = "RxSingleScheduler"
 | |
| 
 | |
| .field public static final f:Lio/reactivex/rxjava3/internal/schedulers/RxThreadFactory;
 | |
| 
 | |
| .field public static final g:Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
| 
 | |
| # instance fields
 | |
| .field public final b:Ljava/util/concurrent/ThreadFactory;
 | |
| 
 | |
| .field public final c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
|     .annotation system Ldalvik/annotation/Signature;
 | |
|         value = {
 | |
|             "Ljava/util/concurrent/atomic/AtomicReference<",
 | |
|             "Ljava/util/concurrent/ScheduledExecutorService;",
 | |
|             ">;"
 | |
|         }
 | |
|     .end annotation
 | |
| .end field
 | |
| 
 | |
| 
 | |
| # direct methods
 | |
| .method public static constructor <clinit>()V
 | |
|     .locals 4
 | |
| 
 | |
|     const/4 v0, 0x0
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {v0}, Ljava/util/concurrent/Executors;->newScheduledThreadPool(I)Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     sput-object v0, Lio/reactivex/rxjava3/internal/schedulers/k;->g:Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     .line 2
 | |
|     invoke-interface {v0}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V
 | |
| 
 | |
|     const-string v0, "rx3.single-priority"
 | |
| 
 | |
|     const/4 v1, 0x5
 | |
| 
 | |
|     .line 3
 | |
|     invoke-static {v0, v1}, Ljava/lang/Integer;->getInteger(Ljava/lang/String;I)Ljava/lang/Integer;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
 | |
| 
 | |
|     move-result v0
 | |
| 
 | |
|     const/16 v1, 0xa
 | |
| 
 | |
|     .line 4
 | |
|     invoke-static {v1, v0}, Ljava/lang/Math;->min(II)I
 | |
| 
 | |
|     move-result v0
 | |
| 
 | |
|     const/4 v1, 0x1
 | |
| 
 | |
|     invoke-static {v1, v0}, Ljava/lang/Math;->max(II)I
 | |
| 
 | |
|     move-result v0
 | |
| 
 | |
|     .line 5
 | |
|     new-instance v2, Lio/reactivex/rxjava3/internal/schedulers/RxThreadFactory;
 | |
| 
 | |
|     const-string v3, "RxSingleScheduler"
 | |
| 
 | |
|     invoke-direct {v2, v3, v0, v1}, Lio/reactivex/rxjava3/internal/schedulers/RxThreadFactory;-><init>(Ljava/lang/String;IZ)V
 | |
| 
 | |
|     sput-object v2, Lio/reactivex/rxjava3/internal/schedulers/k;->f:Lio/reactivex/rxjava3/internal/schedulers/RxThreadFactory;
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public constructor <init>()V
 | |
|     .locals 1
 | |
| 
 | |
|     .line 1
 | |
|     sget-object v0, Lio/reactivex/rxjava3/internal/schedulers/k;->f:Lio/reactivex/rxjava3/internal/schedulers/RxThreadFactory;
 | |
| 
 | |
|     invoke-direct {p0, v0}, Lio/reactivex/rxjava3/internal/schedulers/k;-><init>(Ljava/util/concurrent/ThreadFactory;)V
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public constructor <init>(Ljava/util/concurrent/ThreadFactory;)V
 | |
|     .locals 1
 | |
|     .annotation system Ldalvik/annotation/MethodParameters;
 | |
|         accessFlags = {
 | |
|             0x0
 | |
|         }
 | |
|         names = {
 | |
|             "threadFactory"
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     .line 2
 | |
|     invoke-direct {p0}, Lai/o0;-><init>()V
 | |
| 
 | |
|     .line 3
 | |
|     new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
 | |
| 
 | |
|     iput-object v0, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     .line 4
 | |
|     iput-object p1, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->b:Ljava/util/concurrent/ThreadFactory;
 | |
| 
 | |
|     .line 5
 | |
|     invoke-static {p1}, Lio/reactivex/rxjava3/internal/schedulers/k;->u(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     invoke-virtual {v0, p1}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public static u(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ScheduledExecutorService;
 | |
|     .locals 0
 | |
|     .annotation system Ldalvik/annotation/MethodParameters;
 | |
|         accessFlags = {
 | |
|             0x0
 | |
|         }
 | |
|         names = {
 | |
|             "threadFactory"
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {p0}, Lio/reactivex/rxjava3/internal/schedulers/j;->a(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     move-result-object p0
 | |
| 
 | |
|     return-object p0
 | |
| .end method
 | |
| 
 | |
| 
 | |
| # virtual methods
 | |
| .method public d()Lai/o0$c;
 | |
|     .locals 2
 | |
|     .annotation build Lio/reactivex/rxjava3/annotations/NonNull;
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     new-instance v0, Lio/reactivex/rxjava3/internal/schedulers/k$a;
 | |
| 
 | |
|     iget-object v1, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     invoke-virtual {v1}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
 | |
| 
 | |
|     move-result-object v1
 | |
| 
 | |
|     check-cast v1, Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     invoke-direct {v0, v1}, Lio/reactivex/rxjava3/internal/schedulers/k$a;-><init>(Ljava/util/concurrent/ScheduledExecutorService;)V
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public g(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Lio/reactivex/rxjava3/disposables/c;
 | |
|     .locals 3
 | |
|     .param p1    # Ljava/lang/Runnable;
 | |
|         .annotation build Lio/reactivex/rxjava3/annotations/NonNull;
 | |
|         .end annotation
 | |
|     .end param
 | |
|     .annotation system Ldalvik/annotation/MethodParameters;
 | |
|         accessFlags = {
 | |
|             0x0,
 | |
|             0x0,
 | |
|             0x0
 | |
|         }
 | |
|         names = {
 | |
|             "run",
 | |
|             "delay",
 | |
|             "unit"
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     .annotation build Lio/reactivex/rxjava3/annotations/NonNull;
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     new-instance v0, Lio/reactivex/rxjava3/internal/schedulers/ScheduledDirectTask;
 | |
| 
 | |
|     invoke-static {p1}, Lji/a;->b0(Ljava/lang/Runnable;)Ljava/lang/Runnable;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     invoke-direct {v0, p1}, Lio/reactivex/rxjava3/internal/schedulers/ScheduledDirectTask;-><init>(Ljava/lang/Runnable;)V
 | |
| 
 | |
|     const-wide/16 v1, 0x0
 | |
| 
 | |
|     cmp-long p1, p2, v1
 | |
| 
 | |
|     if-gtz p1, :cond_0
 | |
| 
 | |
|     .line 2
 | |
|     :try_start_0
 | |
|     iget-object p1, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     check-cast p1, Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     invoke-interface {p1, v0}, Ljava/util/concurrent/ScheduledExecutorService;->submit(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     .line 3
 | |
|     :cond_0
 | |
|     iget-object p1, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     check-cast p1, Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     invoke-interface {p1, v0, p2, p3, p4}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/util/concurrent/Callable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     .line 4
 | |
|     :goto_0
 | |
|     invoke-virtual {v0, p1}, Lio/reactivex/rxjava3/internal/schedulers/AbstractDirectTask;->setFuture(Ljava/util/concurrent/Future;)V
 | |
|     :try_end_0
 | |
|     .catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_0 .. :try_end_0} :catch_0
 | |
| 
 | |
|     return-object v0
 | |
| 
 | |
|     :catch_0
 | |
|     move-exception p1
 | |
| 
 | |
|     .line 5
 | |
|     invoke-static {p1}, Lji/a;->Y(Ljava/lang/Throwable;)V
 | |
| 
 | |
|     .line 6
 | |
|     sget-object p1, Lio/reactivex/rxjava3/internal/disposables/EmptyDisposable;->INSTANCE:Lio/reactivex/rxjava3/internal/disposables/EmptyDisposable;
 | |
| 
 | |
|     return-object p1
 | |
| .end method
 | |
| 
 | |
| .method public q(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Lio/reactivex/rxjava3/disposables/c;
 | |
|     .locals 8
 | |
|     .param p1    # Ljava/lang/Runnable;
 | |
|         .annotation build Lio/reactivex/rxjava3/annotations/NonNull;
 | |
|         .end annotation
 | |
|     .end param
 | |
|     .annotation system Ldalvik/annotation/MethodParameters;
 | |
|         accessFlags = {
 | |
|             0x0,
 | |
|             0x0,
 | |
|             0x0,
 | |
|             0x0
 | |
|         }
 | |
|         names = {
 | |
|             "run",
 | |
|             "initialDelay",
 | |
|             "period",
 | |
|             "unit"
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     .annotation build Lio/reactivex/rxjava3/annotations/NonNull;
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {p1}, Lji/a;->b0(Ljava/lang/Runnable;)Ljava/lang/Runnable;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     const-wide/16 v0, 0x0
 | |
| 
 | |
|     cmp-long v2, p4, v0
 | |
| 
 | |
|     if-gtz v2, :cond_1
 | |
| 
 | |
|     .line 2
 | |
|     iget-object p4, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     invoke-virtual {p4}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
 | |
| 
 | |
|     move-result-object p4
 | |
| 
 | |
|     check-cast p4, Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     .line 3
 | |
|     new-instance p5, Lio/reactivex/rxjava3/internal/schedulers/d;
 | |
| 
 | |
|     invoke-direct {p5, p1, p4}, Lio/reactivex/rxjava3/internal/schedulers/d;-><init>(Ljava/lang/Runnable;Ljava/util/concurrent/ExecutorService;)V
 | |
| 
 | |
|     cmp-long p1, p2, v0
 | |
| 
 | |
|     if-gtz p1, :cond_0
 | |
| 
 | |
|     .line 4
 | |
|     :try_start_0
 | |
|     invoke-interface {p4, p5}, Ljava/util/concurrent/ScheduledExecutorService;->submit(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     .line 5
 | |
|     :cond_0
 | |
|     invoke-interface {p4, p5, p2, p3, p6}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/util/concurrent/Callable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     .line 6
 | |
|     :goto_0
 | |
|     invoke-virtual {p5, p1}, Lio/reactivex/rxjava3/internal/schedulers/d;->b(Ljava/util/concurrent/Future;)V
 | |
|     :try_end_0
 | |
|     .catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_0 .. :try_end_0} :catch_0
 | |
| 
 | |
|     return-object p5
 | |
| 
 | |
|     :catch_0
 | |
|     move-exception p1
 | |
| 
 | |
|     .line 7
 | |
|     invoke-static {p1}, Lji/a;->Y(Ljava/lang/Throwable;)V
 | |
| 
 | |
|     .line 8
 | |
|     sget-object p1, Lio/reactivex/rxjava3/internal/disposables/EmptyDisposable;->INSTANCE:Lio/reactivex/rxjava3/internal/disposables/EmptyDisposable;
 | |
| 
 | |
|     return-object p1
 | |
| 
 | |
|     .line 9
 | |
|     :cond_1
 | |
|     new-instance v7, Lio/reactivex/rxjava3/internal/schedulers/ScheduledDirectPeriodicTask;
 | |
| 
 | |
|     invoke-direct {v7, p1}, Lio/reactivex/rxjava3/internal/schedulers/ScheduledDirectPeriodicTask;-><init>(Ljava/lang/Runnable;)V
 | |
| 
 | |
|     .line 10
 | |
|     :try_start_1
 | |
|     iget-object p1, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     move-object v0, p1
 | |
| 
 | |
|     check-cast v0, Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     move-object v1, v7
 | |
| 
 | |
|     move-wide v2, p2
 | |
| 
 | |
|     move-wide v4, p4
 | |
| 
 | |
|     move-object v6, p6
 | |
| 
 | |
|     invoke-interface/range {v0 .. v6}, Ljava/util/concurrent/ScheduledExecutorService;->scheduleAtFixedRate(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     .line 11
 | |
|     invoke-virtual {v7, p1}, Lio/reactivex/rxjava3/internal/schedulers/AbstractDirectTask;->setFuture(Ljava/util/concurrent/Future;)V
 | |
|     :try_end_1
 | |
|     .catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_1 .. :try_end_1} :catch_1
 | |
| 
 | |
|     return-object v7
 | |
| 
 | |
|     :catch_1
 | |
|     move-exception p1
 | |
| 
 | |
|     .line 12
 | |
|     invoke-static {p1}, Lji/a;->Y(Ljava/lang/Throwable;)V
 | |
| 
 | |
|     .line 13
 | |
|     sget-object p1, Lio/reactivex/rxjava3/internal/disposables/EmptyDisposable;->INSTANCE:Lio/reactivex/rxjava3/internal/disposables/EmptyDisposable;
 | |
| 
 | |
|     return-object p1
 | |
| .end method
 | |
| 
 | |
| .method public r()V
 | |
|     .locals 2
 | |
| 
 | |
|     .line 1
 | |
|     iget-object v0, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     sget-object v1, Lio/reactivex/rxjava3/internal/schedulers/k;->g:Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;->getAndSet(Ljava/lang/Object;)Ljava/lang/Object;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     check-cast v0, Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     if-eq v0, v1, :cond_0
 | |
| 
 | |
|     .line 2
 | |
|     invoke-interface {v0}, Ljava/util/concurrent/ScheduledExecutorService;->shutdownNow()Ljava/util/List;
 | |
| 
 | |
|     :cond_0
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public s()V
 | |
|     .locals 3
 | |
| 
 | |
|     const/4 v0, 0x0
 | |
| 
 | |
|     .line 1
 | |
|     :cond_0
 | |
|     iget-object v1, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     invoke-virtual {v1}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
 | |
| 
 | |
|     move-result-object v1
 | |
| 
 | |
|     check-cast v1, Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     .line 2
 | |
|     sget-object v2, Lio/reactivex/rxjava3/internal/schedulers/k;->g:Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     if-eq v1, v2, :cond_2
 | |
| 
 | |
|     if-eqz v0, :cond_1
 | |
| 
 | |
|     .line 3
 | |
|     invoke-interface {v0}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V
 | |
| 
 | |
|     :cond_1
 | |
|     return-void
 | |
| 
 | |
|     :cond_2
 | |
|     if-nez v0, :cond_3
 | |
| 
 | |
|     .line 4
 | |
|     iget-object v0, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->b:Ljava/util/concurrent/ThreadFactory;
 | |
| 
 | |
|     invoke-static {v0}, Lio/reactivex/rxjava3/internal/schedulers/k;->u(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ScheduledExecutorService;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     .line 5
 | |
|     :cond_3
 | |
|     iget-object v2, p0, Lio/reactivex/rxjava3/internal/schedulers/k;->c:Ljava/util/concurrent/atomic/AtomicReference;
 | |
| 
 | |
|     invoke-virtual {v2, v1, v0}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
 | |
| 
 | |
|     move-result v1
 | |
| 
 | |
|     if-eqz v1, :cond_0
 | |
| 
 | |
|     return-void
 | |
| .end method
 |