FakeCronetEngine.smali

.class final Laegon/chrome/net/test/FakeCronetEngine;
.super Laegon/chrome/net/impl/CronetEngineBase;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Laegon/chrome/net/test/FakeCronetEngine$Builder;
    }
.end annotation


# instance fields
.field private mActiveRequestCount:I
    .annotation build Landroid/support/annotation/GuardedBy;
        value = "mLock"
    .end annotation
.end field

.field private final mController:Laegon/chrome/net/test/FakeCronetController;

.field private mIsShutdown:Z
    .annotation build Landroid/support/annotation/GuardedBy;
        value = "mLock"
    .end annotation
.end field

.field private final mLock:Ljava/lang/Object;


# direct methods
.method private constructor <init>(Laegon/chrome/net/test/FakeCronetEngine$Builder;)V
    .registers 3

    invoke-direct {p0}, Laegon/chrome/net/impl/CronetEngineBase;-><init>()V

    new-instance v0, Ljava/lang/Object;

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

    iput-object v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mLock:Ljava/lang/Object;

    # getter for: Laegon/chrome/net/test/FakeCronetEngine$Builder;->mController:Laegon/chrome/net/test/FakeCronetController;
    invoke-static {p1}, Laegon/chrome/net/test/FakeCronetEngine$Builder;->access$100(Laegon/chrome/net/test/FakeCronetEngine$Builder;)Laegon/chrome/net/test/FakeCronetController;

    move-result-object v0

    if-eqz v0, :cond_1a

    # getter for: Laegon/chrome/net/test/FakeCronetEngine$Builder;->mController:Laegon/chrome/net/test/FakeCronetController;
    invoke-static {p1}, Laegon/chrome/net/test/FakeCronetEngine$Builder;->access$100(Laegon/chrome/net/test/FakeCronetEngine$Builder;)Laegon/chrome/net/test/FakeCronetController;

    move-result-object v0

    iput-object v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mController:Laegon/chrome/net/test/FakeCronetController;

    :goto_16
    invoke-static {p0}, Laegon/chrome/net/test/FakeCronetController;->addFakeCronetEngine(Laegon/chrome/net/test/FakeCronetEngine;)V

    return-void

    :cond_1a
    new-instance v0, Laegon/chrome/net/test/FakeCronetController;

    invoke-direct {v0}, Laegon/chrome/net/test/FakeCronetController;-><init>()V

    iput-object v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mController:Laegon/chrome/net/test/FakeCronetController;

    goto :goto_16
.end method

.method synthetic constructor <init>(Laegon/chrome/net/test/FakeCronetEngine$Builder;Laegon/chrome/net/test/FakeCronetEngine$1;)V
    .registers 3

    invoke-direct {p0, p1}, Laegon/chrome/net/test/FakeCronetEngine;-><init>(Laegon/chrome/net/test/FakeCronetEngine$Builder;)V

    return-void
.end method


# virtual methods
.method public addRequestFinishedListener(Laegon/chrome/net/RequestFinishedInfo$Listener;)V
    .registers 2

    return-void
.end method

.method public addRttListener(Laegon/chrome/net/NetworkQualityRttListener;)V
    .registers 2

    return-void
.end method

.method public addThroughputListener(Laegon/chrome/net/NetworkQualityThroughputListener;)V
    .registers 2

    return-void
.end method

.method public configureNetworkQualityEstimatorForTesting(ZZZ)V
    .registers 4

    return-void
.end method

.method protected createBidirectionalStream(Ljava/lang/String;Laegon/chrome/net/BidirectionalStream$Callback;Ljava/util/concurrent/Executor;Ljava/lang/String;Ljava/util/List;IZLjava/util/Collection;ZIZI)Laegon/chrome/net/ExperimentalBidirectionalStream;
    .registers 16
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Laegon/chrome/net/BidirectionalStream$Callback;",
            "Ljava/util/concurrent/Executor;",
            "Ljava/lang/String;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map$Entry",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;>;IZ",
            "Ljava/util/Collection",
            "<",
            "Ljava/lang/Object;",
            ">;ZIZI)",
            "Laegon/chrome/net/ExperimentalBidirectionalStream;"
        }
    .end annotation

    iget-object v1, p0, Laegon/chrome/net/test/FakeCronetEngine;->mLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-boolean v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mIsShutdown:Z

    if-eqz v0, :cond_12

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v2, "This instance of CronetEngine has been shutdown and can no longer be used."

    invoke-direct {v0, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :catchall_f
    move-exception v0

    monitor-exit v1
    :try_end_11
    .catchall {:try_start_3 .. :try_end_11} :catchall_f

    throw v0

    :cond_12
    :try_start_12
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v2, "The BidirectionalStream API is not supported by the Fake implementation of CronetEngine."

    invoke-direct {v0, v2}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_1a
    .catchall {:try_start_12 .. :try_end_1a} :catchall_f
.end method

.method protected createRequest(Ljava/lang/String;Laegon/chrome/net/UrlRequest$Callback;Ljava/util/concurrent/Executor;ILjava/util/Collection;ZZZZIZILaegon/chrome/net/RequestFinishedInfo$Listener;)Laegon/chrome/net/impl/UrlRequestBase;
    .registers 17
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Laegon/chrome/net/UrlRequest$Callback;",
            "Ljava/util/concurrent/Executor;",
            "I",
            "Ljava/util/Collection",
            "<",
            "Ljava/lang/Object;",
            ">;ZZZZIZI",
            "Laegon/chrome/net/RequestFinishedInfo$Listener;",
            ")",
            "Laegon/chrome/net/impl/UrlRequestBase;"
        }
    .end annotation

    iget-object v1, p0, Laegon/chrome/net/test/FakeCronetEngine;->mLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-boolean v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mIsShutdown:Z

    if-eqz v0, :cond_12

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v2, "This instance of CronetEngine has been shutdown and can no longer be used."

    invoke-direct {v0, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :catchall_f
    move-exception v0

    monitor-exit v1
    :try_end_11
    .catchall {:try_start_3 .. :try_end_11} :catchall_f

    throw v0

    :cond_12
    :try_start_12
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v2, "The UrlRequest API is not supported by the Fake implementation of CronetEngine."

    invoke-direct {v0, v2}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_1a
    .catchall {:try_start_12 .. :try_end_1a} :catchall_f
.end method

.method public createURLStreamHandlerFactory()Ljava/net/URLStreamHandlerFactory;
    .registers 3

    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "The URLStreamHandlerFactory API is not supported by the Fake implementation of CronetEngine."

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method getController()Laegon/chrome/net/test/FakeCronetController;
    .registers 2

    iget-object v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mController:Laegon/chrome/net/test/FakeCronetController;

    return-object v0
.end method

.method public getDownstreamThroughputKbps()I
    .registers 2

    const/4 v0, -0x1

    return v0
.end method

.method public getEffectiveConnectionType()I
    .registers 2

    const/4 v0, 0x0

    return v0
.end method

.method public getGlobalMetricsDeltas()[B
    .registers 2

    const/4 v0, 0x0

    new-array v0, v0, [B

    return-object v0
.end method

.method public getHttpRttMs()I
    .registers 2

    const/4 v0, -0x1

    return v0
.end method

.method public getTransportRttMs()I
    .registers 2

    const/4 v0, -0x1

    return v0
.end method

.method public getVersionString()Ljava/lang/String;
    .registers 3

    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "FakeCronet/"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {}, Laegon/chrome/net/impl/ImplVersion;->getCronetVersionWithLastChange()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public newBidirectionalStreamBuilder(Ljava/lang/String;Laegon/chrome/net/BidirectionalStream$Callback;Ljava/util/concurrent/Executor;)Laegon/chrome/net/ExperimentalBidirectionalStream$Builder;
    .registers 7

    iget-object v1, p0, Laegon/chrome/net/test/FakeCronetEngine;->mLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-boolean v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mIsShutdown:Z

    if-eqz v0, :cond_12

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v2, "This instance of CronetEngine has been shutdown and can no longer be used."

    invoke-direct {v0, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :catchall_f
    move-exception v0

    monitor-exit v1
    :try_end_11
    .catchall {:try_start_3 .. :try_end_11} :catchall_f

    throw v0

    :cond_12
    :try_start_12
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v2, "The bidirectional stream API is not supported by the Fake implementation of CronetEngine."

    invoke-direct {v0, v2}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_1a
    .catchall {:try_start_12 .. :try_end_1a} :catchall_f
.end method

.method onRequestDestroyed()V
    .registers 4

    iget-object v1, p0, Laegon/chrome/net/test/FakeCronetEngine;->mLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-boolean v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mIsShutdown:Z

    if-eqz v0, :cond_12

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v2, "This instance of CronetEngine was shutdown. All requests must have been complete."

    invoke-direct {v0, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :catchall_f
    move-exception v0

    monitor-exit v1
    :try_end_11
    .catchall {:try_start_3 .. :try_end_11} :catchall_f

    throw v0

    :cond_12
    :try_start_12
    iget v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mActiveRequestCount:I

    add-int/lit8 v0, v0, -0x1

    iput v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mActiveRequestCount:I

    monitor-exit v1
    :try_end_19
    .catchall {:try_start_12 .. :try_end_19} :catchall_f

    return-void
.end method

.method public openConnection(Ljava/net/URL;)Ljava/net/URLConnection;
    .registers 4

    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "The openConnection API is not supported by the Fake implementation of CronetEngine."

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public openConnection(Ljava/net/URL;Ljava/net/Proxy;)Ljava/net/URLConnection;
    .registers 5

    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "The openConnection API is not supported by the Fake implementation of CronetEngine."

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public removeRequestFinishedListener(Laegon/chrome/net/RequestFinishedInfo$Listener;)V
    .registers 2

    return-void
.end method

.method public removeRttListener(Laegon/chrome/net/NetworkQualityRttListener;)V
    .registers 2

    return-void
.end method

.method public removeThroughputListener(Laegon/chrome/net/NetworkQualityThroughputListener;)V
    .registers 2

    return-void
.end method

.method public shutdown()V
    .registers 4

    iget-object v1, p0, Laegon/chrome/net/test/FakeCronetEngine;->mLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mActiveRequestCount:I

    if-eqz v0, :cond_12

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v2, "Cannot shutdown with active requests."

    invoke-direct {v0, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :catchall_f
    move-exception v0

    monitor-exit v1
    :try_end_11
    .catchall {:try_start_3 .. :try_end_11} :catchall_f

    throw v0

    :cond_12
    const/4 v0, 0x1

    :try_start_13
    iput-boolean v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mIsShutdown:Z

    monitor-exit v1
    :try_end_16
    .catchall {:try_start_13 .. :try_end_16} :catchall_f

    invoke-static {p0}, Laegon/chrome/net/test/FakeCronetController;->removeFakeCronetEngine(Laegon/chrome/net/CronetEngine;)V

    return-void
.end method

.method public startNetLogToDisk(Ljava/lang/String;ZI)V
    .registers 4

    return-void
.end method

.method public startNetLogToFile(Ljava/lang/String;Z)V
    .registers 3

    return-void
.end method

.method startRequest()Z
    .registers 3

    iget-object v1, p0, Laegon/chrome/net/test/FakeCronetEngine;->mLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-boolean v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mIsShutdown:Z

    if-nez v0, :cond_10

    iget v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mActiveRequestCount:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Laegon/chrome/net/test/FakeCronetEngine;->mActiveRequestCount:I

    const/4 v0, 0x1

    monitor-exit v1

    :goto_f
    return v0

    :cond_10
    const/4 v0, 0x0

    monitor-exit v1

    goto :goto_f

    :catchall_13
    move-exception v0

    monitor-exit v1
    :try_end_15
    .catchall {:try_start_3 .. :try_end_15} :catchall_13

    throw v0
.end method

.method public stopNetLog()V
    .registers 1

    return-void
.end method