MoPubEvents.smali

.class public Lcom/tradplus/ads/common/event/MoPubEvents;
.super Ljava/lang/Object;


# static fields
.field private static volatile a:Lcom/tradplus/ads/common/event/EventDispatcher;


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

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

    return-void
.end method

.method static a()Lcom/tradplus/ads/common/event/EventDispatcher;
    .registers 5
    .annotation build Lcom/tradplus/ads/common/VisibleForTesting;
    .end annotation

    sget-object v0, Lcom/tradplus/ads/common/event/MoPubEvents;->a:Lcom/tradplus/ads/common/event/EventDispatcher;

    if-nez v0, :cond_37

    const-class v1, Lcom/tradplus/ads/common/event/MoPubEvents;

    monitor-enter v1

    :try_start_7
    sget-object v0, Lcom/tradplus/ads/common/event/MoPubEvents;->a:Lcom/tradplus/ads/common/event/EventDispatcher;

    if-nez v0, :cond_32

    new-instance v0, Ljava/util/ArrayList;

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

    new-instance v2, Landroid/os/HandlerThread;

    const-string v3, "mopub_event_logging"

    invoke-direct {v2, v3}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Landroid/os/HandlerThread;->start()V

    new-instance v3, Lcom/tradplus/ads/common/event/ScribeEventRecorder;

    invoke-virtual {v2}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v4

    invoke-direct {v3, v4}, Lcom/tradplus/ads/common/event/ScribeEventRecorder;-><init>(Landroid/os/Looper;)V

    invoke-virtual {v0, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    new-instance v3, Lcom/tradplus/ads/common/event/EventDispatcher;

    invoke-virtual {v2}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v2

    invoke-direct {v3, v0, v2}, Lcom/tradplus/ads/common/event/EventDispatcher;-><init>(Ljava/lang/Iterable;Landroid/os/Looper;)V

    sput-object v3, Lcom/tradplus/ads/common/event/MoPubEvents;->a:Lcom/tradplus/ads/common/event/EventDispatcher;

    move-object v0, v3

    :cond_32
    monitor-exit v1

    goto :goto_37

    :catchall_34
    move-exception v0

    monitor-exit v1
    :try_end_36
    .catchall {:try_start_7 .. :try_end_36} :catchall_34

    throw v0

    :cond_37
    :goto_37
    return-object v0
.end method

.method public static log(Lcom/tradplus/ads/common/event/BaseEvent;)V
    .registers 2

    invoke-static {}, Lcom/tradplus/ads/common/event/MoPubEvents;->a()Lcom/tradplus/ads/common/event/EventDispatcher;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/tradplus/ads/common/event/EventDispatcher;->dispatch(Lcom/tradplus/ads/common/event/BaseEvent;)V

    return-void
.end method

.method public static setEventDispatcher(Lcom/tradplus/ads/common/event/EventDispatcher;)V
    .registers 1
    .annotation build Lcom/tradplus/ads/common/VisibleForTesting;
    .end annotation

    sput-object p0, Lcom/tradplus/ads/common/event/MoPubEvents;->a:Lcom/tradplus/ads/common/event/EventDispatcher;

    return-void
.end method