358 lines
9.4 KiB
Smali
358 lines
9.4 KiB
Smali
.class public Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.super Ljava/lang/Object;
|
|
.source "EventBusBuilder.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final DEFAULT_EXECUTOR_SERVICE:Ljava/util/concurrent/ExecutorService;
|
|
|
|
|
|
# instance fields
|
|
.field eventInheritance:Z
|
|
|
|
.field executorService:Ljava/util/concurrent/ExecutorService;
|
|
|
|
.field ignoreGeneratedIndex:Z
|
|
|
|
.field logNoSubscriberMessages:Z
|
|
|
|
.field logSubscriberExceptions:Z
|
|
|
|
.field logger:Lorg/greenrobot/eventbus/Logger;
|
|
|
|
.field mainThreadSupport:Lorg/greenrobot/eventbus/MainThreadSupport;
|
|
|
|
.field sendNoSubscriberEvent:Z
|
|
|
|
.field sendSubscriberExceptionEvent:Z
|
|
|
|
.field skipMethodVerificationForClasses:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/Class<",
|
|
"*>;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field strictMethodVerification:Z
|
|
|
|
.field subscriberInfoIndexes:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lorg/greenrobot/eventbus/meta/SubscriberInfoIndex;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field throwSubscriberException:Z
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.line 31
|
|
invoke-static {}, Ljava/util/concurrent/Executors;->newCachedThreadPool()Ljava/util/concurrent/ExecutorService;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lorg/greenrobot/eventbus/EventBusBuilder;->DEFAULT_EXECUTOR_SERVICE:Ljava/util/concurrent/ExecutorService;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 47
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 33
|
|
iput-boolean v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->logSubscriberExceptions:Z
|
|
|
|
.line 34
|
|
iput-boolean v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->logNoSubscriberMessages:Z
|
|
|
|
.line 35
|
|
iput-boolean v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->sendSubscriberExceptionEvent:Z
|
|
|
|
.line 36
|
|
iput-boolean v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->sendNoSubscriberEvent:Z
|
|
|
|
.line 38
|
|
iput-boolean v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->eventInheritance:Z
|
|
|
|
.line 41
|
|
sget-object v0, Lorg/greenrobot/eventbus/EventBusBuilder;->DEFAULT_EXECUTOR_SERVICE:Ljava/util/concurrent/ExecutorService;
|
|
|
|
iput-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->executorService:Ljava/util/concurrent/ExecutorService;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public addIndex(Lorg/greenrobot/eventbus/meta/SubscriberInfoIndex;)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 1
|
|
|
|
.line 136
|
|
iget-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->subscriberInfoIndexes:Ljava/util/List;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 137
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->subscriberInfoIndexes:Ljava/util/List;
|
|
|
|
.line 139
|
|
:cond_0
|
|
iget-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->subscriberInfoIndexes:Ljava/util/List;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public build()Lorg/greenrobot/eventbus/EventBus;
|
|
.locals 1
|
|
|
|
.line 190
|
|
new-instance v0, Lorg/greenrobot/eventbus/EventBus;
|
|
|
|
invoke-direct {v0, p0}, Lorg/greenrobot/eventbus/EventBus;-><init>(Lorg/greenrobot/eventbus/EventBusBuilder;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public eventInheritance(Z)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 95
|
|
iput-boolean p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->eventInheritance:Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public executorService(Ljava/util/concurrent/ExecutorService;)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 105
|
|
iput-object p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->executorService:Ljava/util/concurrent/ExecutorService;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method getLogger()Lorg/greenrobot/eventbus/Logger;
|
|
.locals 1
|
|
|
|
.line 154
|
|
iget-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->logger:Lorg/greenrobot/eventbus/Logger;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
.line 157
|
|
:cond_0
|
|
invoke-static {}, Lorg/greenrobot/eventbus/Logger$Default;->get()Lorg/greenrobot/eventbus/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method getMainThreadSupport()Lorg/greenrobot/eventbus/MainThreadSupport;
|
|
.locals 1
|
|
|
|
.line 162
|
|
iget-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->mainThreadSupport:Lorg/greenrobot/eventbus/MainThreadSupport;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
.line 164
|
|
:cond_0
|
|
invoke-static {}, Lorg/greenrobot/eventbus/android/AndroidComponents;->areAvailable()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 165
|
|
invoke-static {}, Lorg/greenrobot/eventbus/android/AndroidComponents;->get()Lorg/greenrobot/eventbus/android/AndroidComponents;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v0, v0, Lorg/greenrobot/eventbus/android/AndroidComponents;->defaultMainThreadSupport:Lorg/greenrobot/eventbus/MainThreadSupport;
|
|
|
|
return-object v0
|
|
|
|
:cond_1
|
|
const/4 v0, 0x0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public ignoreGeneratedIndex(Z)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 124
|
|
iput-boolean p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->ignoreGeneratedIndex:Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public installDefaultEventBus()Lorg/greenrobot/eventbus/EventBus;
|
|
.locals 3
|
|
|
|
.line 178
|
|
const-class v0, Lorg/greenrobot/eventbus/EventBus;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 179
|
|
:try_start_0
|
|
sget-object v1, Lorg/greenrobot/eventbus/EventBus;->defaultInstance:Lorg/greenrobot/eventbus/EventBus;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
.line 183
|
|
invoke-virtual {p0}, Lorg/greenrobot/eventbus/EventBusBuilder;->build()Lorg/greenrobot/eventbus/EventBus;
|
|
|
|
move-result-object v1
|
|
|
|
sput-object v1, Lorg/greenrobot/eventbus/EventBus;->defaultInstance:Lorg/greenrobot/eventbus/EventBus;
|
|
|
|
.line 184
|
|
sget-object v1, Lorg/greenrobot/eventbus/EventBus;->defaultInstance:Lorg/greenrobot/eventbus/EventBus;
|
|
|
|
monitor-exit v0
|
|
|
|
return-object v1
|
|
|
|
.line 180
|
|
:cond_0
|
|
new-instance v1, Lorg/greenrobot/eventbus/EventBusException;
|
|
|
|
const-string v2, "Default instance already exists. It may be only set once before it\'s used the first time to ensure consistent behavior."
|
|
|
|
invoke-direct {v1, v2}, Lorg/greenrobot/eventbus/EventBusException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
.line 185
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public logNoSubscriberMessages(Z)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 58
|
|
iput-boolean p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->logNoSubscriberMessages:Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public logSubscriberExceptions(Z)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 52
|
|
iput-boolean p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->logSubscriberExceptions:Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public logger(Lorg/greenrobot/eventbus/Logger;)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 149
|
|
iput-object p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->logger:Lorg/greenrobot/eventbus/Logger;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public sendNoSubscriberEvent(Z)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 70
|
|
iput-boolean p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->sendNoSubscriberEvent:Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public sendSubscriberExceptionEvent(Z)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 64
|
|
iput-boolean p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->sendSubscriberExceptionEvent:Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public skipMethodVerificationFor(Ljava/lang/Class;)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/Class<",
|
|
"*>;)",
|
|
"Lorg/greenrobot/eventbus/EventBusBuilder;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 115
|
|
iget-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->skipMethodVerificationForClasses:Ljava/util/List;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 116
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->skipMethodVerificationForClasses:Ljava/util/List;
|
|
|
|
.line 118
|
|
:cond_0
|
|
iget-object v0, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->skipMethodVerificationForClasses:Ljava/util/List;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public strictMethodVerification(Z)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 130
|
|
iput-boolean p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->strictMethodVerification:Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public throwSubscriberException(Z)Lorg/greenrobot/eventbus/EventBusBuilder;
|
|
.locals 0
|
|
|
|
.line 81
|
|
iput-boolean p1, p0, Lorg/greenrobot/eventbus/EventBusBuilder;->throwSubscriberException:Z
|
|
|
|
return-object p0
|
|
.end method
|