Settings.smali

.class public final Lcom/squareup/okhttp/internal/framed/Settings;
.super Ljava/lang/Object;
.source "Settings.java"


# static fields
.field static final CLIENT_CERTIFICATE_VECTOR_SIZE:I = 0x8

.field static final COUNT:I = 0xa

.field static final CURRENT_CWND:I = 0x5

.field static final DEFAULT_INITIAL_WINDOW_SIZE:I = 0x10000

.field static final DOWNLOAD_BANDWIDTH:I = 0x2

.field static final DOWNLOAD_RETRANS_RATE:I = 0x6

.field static final ENABLE_PUSH:I = 0x2

.field static final FLAG_CLEAR_PREVIOUSLY_PERSISTED_SETTINGS:I = 0x1

.field static final FLOW_CONTROL_OPTIONS:I = 0xa

.field static final FLOW_CONTROL_OPTIONS_DISABLED:I = 0x1

.field static final HEADER_TABLE_SIZE:I = 0x1

.field static final INITIAL_WINDOW_SIZE:I = 0x7

.field static final MAX_CONCURRENT_STREAMS:I = 0x4

.field static final MAX_FRAME_SIZE:I = 0x5

.field static final MAX_HEADER_LIST_SIZE:I = 0x6

.field static final PERSISTED:I = 0x2

.field static final PERSIST_VALUE:I = 0x1

.field static final ROUND_TRIP_TIME:I = 0x3

.field static final UPLOAD_BANDWIDTH:I = 0x1


# instance fields
.field private persistValue:I

.field private persisted:I

.field private set:I

.field private final values:[I


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

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

    const/16 v0, 0xa

    .line 2
    new-array v0, v0, [I

    iput-object v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    return-void
.end method


# virtual methods
.method clear()V
    .registers 3

    const/4 v0, 0x0

    .line 1
    iput v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persisted:I

    iput v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persistValue:I

    iput v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    .line 2
    iget-object v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    invoke-static {v1, v0}, Ljava/util/Arrays;->fill([II)V

    return-void
.end method

.method flags(I)I
    .registers 3

    .line 1
    invoke-virtual {p0, p1}, Lcom/squareup/okhttp/internal/framed/Settings;->isPersisted(I)Z

    move-result v0

    if-eqz v0, :cond_8

    const/4 v0, 0x2

    goto :goto_9

    :cond_8
    const/4 v0, 0x0

    .line 2
    :goto_9
    invoke-virtual {p0, p1}, Lcom/squareup/okhttp/internal/framed/Settings;->persistValue(I)Z

    move-result p1

    if-eqz p1, :cond_11

    or-int/lit8 v0, v0, 0x1

    :cond_11
    return v0
.end method

.method get(I)I
    .registers 3

    .line 1
    iget-object v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    aget p1, v0, p1

    return p1
.end method

.method getClientCertificateVectorSize(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit16 v0, v0, 0x100

    if-eqz v0, :cond_c

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/16 v0, 0x8

    aget p1, p1, v0

    :cond_c
    return p1
.end method

.method getCurrentCwnd(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x20

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x5

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method getDownloadBandwidth(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x4

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x2

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method getDownloadRetransRate(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x40

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x6

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method getEnablePush(Z)Z
    .registers 5

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x4

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-eqz v0, :cond_e

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x2

    aget p1, p1, v0

    goto :goto_13

    :cond_e
    if-eqz p1, :cond_12

    const/4 p1, 0x1

    goto :goto_13

    :cond_12
    const/4 p1, 0x0

    :goto_13
    if-ne p1, v2, :cond_16

    const/4 v1, 0x1

    :cond_16
    return v1
.end method

.method getHeaderTableSize()I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x2

    if-eqz v0, :cond_c

    iget-object v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v1, 0x1

    aget v0, v0, v1

    goto :goto_d

    :cond_c
    const/4 v0, -0x1

    :goto_d
    return v0
.end method

.method getInitialWindowSize(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit16 v0, v0, 0x80

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x7

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method getMaxConcurrentStreams(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x10

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x4

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method getMaxFrameSize(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x20

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x5

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method getMaxHeaderListSize(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x40

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x6

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method getRoundTripTime(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x8

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x3

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method getUploadBandwidth(I)I
    .registers 3

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v0, v0, 0x2

    if-eqz v0, :cond_b

    iget-object p1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/4 v0, 0x1

    aget p1, p1, v0

    :cond_b
    return p1
.end method

.method isFlowControlDisabled()Z
    .registers 4

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit16 v0, v0, 0x400

    const/4 v1, 0x0

    if-eqz v0, :cond_e

    iget-object v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    const/16 v2, 0xa

    aget v0, v0, v2

    goto :goto_f

    :cond_e
    const/4 v0, 0x0

    :goto_f
    const/4 v2, 0x1

    and-int/2addr v0, v2

    if-eqz v0, :cond_14

    const/4 v1, 0x1

    :cond_14
    return v1
.end method

.method isPersisted(I)Z
    .registers 4

    const/4 v0, 0x1

    shl-int p1, v0, p1

    .line 1
    iget v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persisted:I

    and-int/2addr p1, v1

    if-eqz p1, :cond_9

    goto :goto_a

    :cond_9
    const/4 v0, 0x0

    :goto_a
    return v0
.end method

.method isSet(I)Z
    .registers 4

    const/4 v0, 0x1

    shl-int p1, v0, p1

    .line 1
    iget v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/2addr p1, v1

    if-eqz p1, :cond_9

    goto :goto_a

    :cond_9
    const/4 v0, 0x0

    :goto_a
    return v0
.end method

.method merge(Lcom/squareup/okhttp/internal/framed/Settings;)V
    .registers 5

    const/4 v0, 0x0

    :goto_1
    const/16 v1, 0xa

    if-ge v0, v1, :cond_1a

    .line 1
    invoke-virtual {p1, v0}, Lcom/squareup/okhttp/internal/framed/Settings;->isSet(I)Z

    move-result v1

    if-nez v1, :cond_c

    goto :goto_17

    .line 2
    :cond_c
    invoke-virtual {p1, v0}, Lcom/squareup/okhttp/internal/framed/Settings;->flags(I)I

    move-result v1

    invoke-virtual {p1, v0}, Lcom/squareup/okhttp/internal/framed/Settings;->get(I)I

    move-result v2

    invoke-virtual {p0, v0, v1, v2}, Lcom/squareup/okhttp/internal/framed/Settings;->set(III)Lcom/squareup/okhttp/internal/framed/Settings;

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

    goto :goto_1

    :cond_1a
    return-void
.end method

.method persistValue(I)Z
    .registers 4

    const/4 v0, 0x1

    shl-int p1, v0, p1

    .line 1
    iget v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persistValue:I

    and-int/2addr p1, v1

    if-eqz p1, :cond_9

    goto :goto_a

    :cond_9
    const/4 v0, 0x0

    :goto_a
    return v0
.end method

.method set(III)Lcom/squareup/okhttp/internal/framed/Settings;
    .registers 7

    .line 1
    iget-object v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    array-length v0, v0

    if-lt p1, v0, :cond_6

    return-object p0

    :cond_6
    const/4 v0, 0x1

    shl-int/2addr v0, p1

    .line 2
    iget v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    or-int/2addr v1, v0

    iput v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    and-int/lit8 v1, p2, 0x1

    if-eqz v1, :cond_17

    .line 3
    iget v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persistValue:I

    or-int/2addr v1, v0

    iput v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persistValue:I

    goto :goto_1e

    .line 4
    :cond_17
    iget v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persistValue:I

    xor-int/lit8 v2, v0, -0x1

    and-int/2addr v1, v2

    iput v1, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persistValue:I

    :goto_1e
    and-int/lit8 p2, p2, 0x2

    if-eqz p2, :cond_28

    .line 5
    iget p2, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persisted:I

    or-int/2addr p2, v0

    iput p2, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persisted:I

    goto :goto_2f

    .line 6
    :cond_28
    iget p2, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persisted:I

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

    and-int/2addr p2, v0

    iput p2, p0, Lcom/squareup/okhttp/internal/framed/Settings;->persisted:I

    .line 7
    :goto_2f
    iget-object p2, p0, Lcom/squareup/okhttp/internal/framed/Settings;->values:[I

    aput p3, p2, p1

    return-object p0
.end method

.method size()I
    .registers 2

    .line 1
    iget v0, p0, Lcom/squareup/okhttp/internal/framed/Settings;->set:I

    invoke-static {v0}, Ljava/lang/Integer;->bitCount(I)I

    move-result v0

    return v0
.end method