184 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
			
		
		
	
	
			184 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
| .class final Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;
 | |
| .super Ljava/lang/Object;
 | |
| .source "AbstractService.java"
 | |
| 
 | |
| 
 | |
| # annotations
 | |
| .annotation system Ldalvik/annotation/EnclosingClass;
 | |
|     value = Lcom/google/common/util/concurrent/AbstractService;
 | |
| .end annotation
 | |
| 
 | |
| .annotation system Ldalvik/annotation/InnerClass;
 | |
|     accessFlags = 0x19
 | |
|     name = "StateSnapshot"
 | |
| .end annotation
 | |
| 
 | |
| 
 | |
| # instance fields
 | |
| .field public final failure:Ljava/lang/Throwable;
 | |
|     .annotation runtime Ljavax/annotation/CheckForNull;
 | |
|     .end annotation
 | |
| .end field
 | |
| 
 | |
| .field public final shutdownWhenStartupFinishes:Z
 | |
| 
 | |
| .field public final state:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
| 
 | |
| # direct methods
 | |
| .method public constructor <init>(Lcom/google/common/util/concurrent/Service$State;)V
 | |
|     .locals 2
 | |
| 
 | |
|     const/4 v0, 0x0
 | |
| 
 | |
|     const/4 v1, 0x0
 | |
| 
 | |
|     .line 1
 | |
|     invoke-direct {p0, p1, v0, v1}, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;-><init>(Lcom/google/common/util/concurrent/Service$State;ZLjava/lang/Throwable;)V
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public constructor <init>(Lcom/google/common/util/concurrent/Service$State;ZLjava/lang/Throwable;)V
 | |
|     .locals 4
 | |
|     .param p3    # Ljava/lang/Throwable;
 | |
|         .annotation runtime Ljavax/annotation/CheckForNull;
 | |
|         .end annotation
 | |
|     .end param
 | |
| 
 | |
|     .line 2
 | |
|     invoke-direct {p0}, Ljava/lang/Object;-><init>()V
 | |
| 
 | |
|     const/4 v0, 0x0
 | |
| 
 | |
|     const/4 v1, 0x1
 | |
| 
 | |
|     if-eqz p2, :cond_1
 | |
| 
 | |
|     .line 3
 | |
|     sget-object v2, Lcom/google/common/util/concurrent/Service$State;->STARTING:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     if-ne p1, v2, :cond_0
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     :cond_0
 | |
|     move v2, v0
 | |
| 
 | |
|     goto :goto_1
 | |
| 
 | |
|     :cond_1
 | |
|     :goto_0
 | |
|     move v2, v1
 | |
| 
 | |
|     :goto_1
 | |
|     const-string v3, "shutdownWhenStartupFinishes can only be set if state is STARTING. Got %s instead."
 | |
| 
 | |
|     invoke-static {v2, v3, p1}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
 | |
| 
 | |
|     if-eqz p3, :cond_2
 | |
| 
 | |
|     move v2, v1
 | |
| 
 | |
|     goto :goto_2
 | |
| 
 | |
|     :cond_2
 | |
|     move v2, v0
 | |
| 
 | |
|     .line 4
 | |
|     :goto_2
 | |
|     sget-object v3, Lcom/google/common/util/concurrent/Service$State;->FAILED:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     if-ne p1, v3, :cond_3
 | |
| 
 | |
|     move v3, v1
 | |
| 
 | |
|     goto :goto_3
 | |
| 
 | |
|     :cond_3
 | |
|     move v3, v0
 | |
| 
 | |
|     :goto_3
 | |
|     if-ne v2, v3, :cond_4
 | |
| 
 | |
|     move v0, v1
 | |
| 
 | |
|     :cond_4
 | |
|     const-string v1, "A failure cause should be set if and only if the state is failed.  Got %s and %s instead."
 | |
| 
 | |
|     invoke-static {v0, v1, p1, p3}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
 | |
| 
 | |
|     .line 5
 | |
|     iput-object p1, p0, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;->state:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     .line 6
 | |
|     iput-boolean p2, p0, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;->shutdownWhenStartupFinishes:Z
 | |
| 
 | |
|     .line 7
 | |
|     iput-object p3, p0, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;->failure:Ljava/lang/Throwable;
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| 
 | |
| # virtual methods
 | |
| .method public externalState()Lcom/google/common/util/concurrent/Service$State;
 | |
|     .locals 2
 | |
| 
 | |
|     .line 1
 | |
|     iget-boolean v0, p0, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;->shutdownWhenStartupFinishes:Z
 | |
| 
 | |
|     if-eqz v0, :cond_0
 | |
| 
 | |
|     iget-object v0, p0, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;->state:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     sget-object v1, Lcom/google/common/util/concurrent/Service$State;->STARTING:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     if-ne v0, v1, :cond_0
 | |
| 
 | |
|     .line 2
 | |
|     sget-object v0, Lcom/google/common/util/concurrent/Service$State;->STOPPING:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     return-object v0
 | |
| 
 | |
|     .line 3
 | |
|     :cond_0
 | |
|     iget-object v0, p0, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;->state:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| .method public failureCause()Ljava/lang/Throwable;
 | |
|     .locals 3
 | |
| 
 | |
|     .line 1
 | |
|     iget-object v0, p0, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;->state:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     sget-object v1, Lcom/google/common/util/concurrent/Service$State;->FAILED:Lcom/google/common/util/concurrent/Service$State;
 | |
| 
 | |
|     if-ne v0, v1, :cond_0
 | |
| 
 | |
|     const/4 v1, 0x1
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     :cond_0
 | |
|     const/4 v1, 0x0
 | |
| 
 | |
|     :goto_0
 | |
|     const-string v2, "failureCause() is only valid if the service has failed, service is %s"
 | |
| 
 | |
|     invoke-static {v1, v2, v0}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/String;Ljava/lang/Object;)V
 | |
| 
 | |
|     .line 2
 | |
|     iget-object v0, p0, Lcom/google/common/util/concurrent/AbstractService$StateSnapshot;->failure:Ljava/lang/Throwable;
 | |
| 
 | |
|     invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;
 | |
| 
 | |
|     move-object v1, v0
 | |
| 
 | |
|     check-cast v1, Ljava/lang/Throwable;
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 |