1892 lines
50 KiB
Smali
1892 lines
50 KiB
Smali
.class public Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;
|
|
.super Ljava/lang/Object;
|
|
.source "DefaultHttpDataSource.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/google/android/exoplayer2/upstream/HttpDataSource;
|
|
|
|
|
|
# static fields
|
|
.field private static final CONTENT_RANGE_HEADER:Ljava/util/regex/Pattern;
|
|
|
|
.field public static final DEFAULT_CONNECT_TIMEOUT_MILLIS:I = 0x1f40
|
|
|
|
.field public static final DEFAULT_READ_TIMEOUT_MILLIS:I = 0x1f40
|
|
|
|
.field private static final MAX_BYTES_TO_DRAIN:J = 0x800L
|
|
|
|
.field private static final MAX_REDIRECTS:I = 0x14
|
|
|
|
.field private static final TAG:Ljava/lang/String; = "DefaultHttpDataSource"
|
|
|
|
.field private static final skipBufferReference:Ljava/util/concurrent/atomic/AtomicReference;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/atomic/AtomicReference<",
|
|
"[B>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# instance fields
|
|
.field private final allowCrossProtocolRedirects:Z
|
|
|
|
.field private bytesRead:J
|
|
|
|
.field private bytesSkipped:J
|
|
|
|
.field private bytesToRead:J
|
|
|
|
.field private bytesToSkip:J
|
|
|
|
.field private final connectTimeoutMillis:I
|
|
|
|
.field private connection:Ljava/net/HttpURLConnection;
|
|
|
|
.field private final contentTypePredicate:Lcom/google/android/exoplayer2/util/Predicate;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/google/android/exoplayer2/util/Predicate<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private dataSpec:Lcom/google/android/exoplayer2/upstream/DataSpec;
|
|
|
|
.field private final defaultRequestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
.field private inputStream:Ljava/io/InputStream;
|
|
|
|
.field private final listener:Lcom/google/android/exoplayer2/upstream/TransferListener;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/google/android/exoplayer2/upstream/TransferListener<",
|
|
"-",
|
|
"Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private opened:Z
|
|
|
|
.field private final readTimeoutMillis:I
|
|
|
|
.field private final requestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
.field private final userAgent:Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const-string v0, "^bytes (\\d+)-(\\d+)/(\\d+)$"
|
|
|
|
.line 1
|
|
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->CONTENT_RANGE_HEADER:Ljava/util/regex/Pattern;
|
|
|
|
.line 2
|
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
|
|
|
|
sput-object v0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->skipBufferReference:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Lcom/google/android/exoplayer2/util/Predicate;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Lcom/google/android/exoplayer2/util/Predicate<",
|
|
"Ljava/lang/String;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;-><init>(Ljava/lang/String;Lcom/google/android/exoplayer2/util/Predicate;Lcom/google/android/exoplayer2/upstream/TransferListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Lcom/google/android/exoplayer2/util/Predicate;Lcom/google/android/exoplayer2/upstream/TransferListener;)V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Lcom/google/android/exoplayer2/util/Predicate<",
|
|
"Ljava/lang/String;",
|
|
">;",
|
|
"Lcom/google/android/exoplayer2/upstream/TransferListener<",
|
|
"-",
|
|
"Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/16 v4, 0x1f40
|
|
|
|
const/16 v5, 0x1f40
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v2, p2
|
|
|
|
move-object v3, p3
|
|
|
|
.line 2
|
|
invoke-direct/range {v0 .. v5}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;-><init>(Ljava/lang/String;Lcom/google/android/exoplayer2/util/Predicate;Lcom/google/android/exoplayer2/upstream/TransferListener;II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Lcom/google/android/exoplayer2/util/Predicate;Lcom/google/android/exoplayer2/upstream/TransferListener;II)V
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Lcom/google/android/exoplayer2/util/Predicate<",
|
|
"Ljava/lang/String;",
|
|
">;",
|
|
"Lcom/google/android/exoplayer2/upstream/TransferListener<",
|
|
"-",
|
|
"Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;",
|
|
">;II)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v2, p2
|
|
|
|
move-object v3, p3
|
|
|
|
move v4, p4
|
|
|
|
move v5, p5
|
|
|
|
.line 3
|
|
invoke-direct/range {v0 .. v7}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;-><init>(Ljava/lang/String;Lcom/google/android/exoplayer2/util/Predicate;Lcom/google/android/exoplayer2/upstream/TransferListener;IIZLcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Lcom/google/android/exoplayer2/util/Predicate;Lcom/google/android/exoplayer2/upstream/TransferListener;IIZLcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Lcom/google/android/exoplayer2/util/Predicate<",
|
|
"Ljava/lang/String;",
|
|
">;",
|
|
"Lcom/google/android/exoplayer2/upstream/TransferListener<",
|
|
"-",
|
|
"Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;",
|
|
">;IIZ",
|
|
"Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 4
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 5
|
|
invoke-static {p1}, Lcom/google/android/exoplayer2/util/Assertions;->checkNotEmpty(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->userAgent:Ljava/lang/String;
|
|
|
|
.line 6
|
|
iput-object p2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->contentTypePredicate:Lcom/google/android/exoplayer2/util/Predicate;
|
|
|
|
.line 7
|
|
iput-object p3, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->listener:Lcom/google/android/exoplayer2/upstream/TransferListener;
|
|
|
|
.line 8
|
|
new-instance p1, Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
invoke-direct {p1}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->requestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
.line 9
|
|
iput p4, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connectTimeoutMillis:I
|
|
|
|
.line 10
|
|
iput p5, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->readTimeoutMillis:I
|
|
|
|
.line 11
|
|
iput-boolean p6, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->allowCrossProtocolRedirects:Z
|
|
|
|
.line 12
|
|
iput-object p7, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->defaultRequestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private closeConnectionQuietly()V
|
|
.locals 3
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
:try_start_0
|
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
const-string v1, "DefaultHttpDataSource"
|
|
|
|
const-string v2, "Unexpected error while disconnecting"
|
|
|
|
.line 3
|
|
invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:goto_0
|
|
const/4 v0, 0x0
|
|
|
|
.line 4
|
|
iput-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private static getContentLength(Ljava/net/HttpURLConnection;)J
|
|
.locals 10
|
|
|
|
const-string v0, "Content-Length"
|
|
|
|
.line 1
|
|
invoke-virtual {p0, v0}, Ljava/net/HttpURLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
const-string v2, "]"
|
|
|
|
const-string v3, "DefaultHttpDataSource"
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
.line 3
|
|
:try_start_0
|
|
invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
|
|
|
|
move-result-wide v4
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 4
|
|
:catch_0
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v4, "Unexpected Content-Length ["
|
|
|
|
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_0
|
|
const-wide/16 v4, -0x1
|
|
|
|
:goto_0
|
|
const-string v1, "Content-Range"
|
|
|
|
.line 5
|
|
invoke-virtual {p0, v1}, Ljava/net/HttpURLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 6
|
|
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
.line 7
|
|
sget-object v1, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->CONTENT_RANGE_HEADER:Ljava/util/regex/Pattern;
|
|
|
|
invoke-virtual {v1, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
|
|
|
|
move-result-object v1
|
|
|
|
.line 8
|
|
invoke-virtual {v1}, Ljava/util/regex/Matcher;->find()Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_2
|
|
|
|
const/4 v6, 0x2
|
|
|
|
.line 9
|
|
:try_start_1
|
|
invoke-virtual {v1, v6}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-static {v6}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
|
|
|
|
move-result-wide v6
|
|
|
|
const/4 v8, 0x1
|
|
|
|
invoke-virtual {v1, v8}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
|
|
|
|
move-result-wide v8
|
|
|
|
sub-long/2addr v6, v8
|
|
|
|
const-wide/16 v8, 0x1
|
|
|
|
add-long/2addr v6, v8
|
|
|
|
const-wide/16 v8, 0x0
|
|
|
|
cmp-long v1, v4, v8
|
|
|
|
if-gez v1, :cond_1
|
|
|
|
move-wide v4, v6
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
cmp-long v1, v4, v6
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 10
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v8, "Inconsistent headers ["
|
|
|
|
invoke-virtual {v1, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "] ["
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v3, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
.line 11
|
|
invoke-static {v4, v5, v6, v7}, Ljava/lang/Math;->max(JJ)J
|
|
|
|
move-result-wide v0
|
|
:try_end_1
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
move-wide v4, v0
|
|
|
|
goto :goto_1
|
|
|
|
.line 12
|
|
:catch_1
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Unexpected Content-Range ["
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v3, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return-wide v4
|
|
.end method
|
|
|
|
.method private static handleRedirect(Ljava/net/URL;Ljava/lang/String;)Ljava/net/URL;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 1
|
|
new-instance v0, Ljava/net/URL;
|
|
|
|
invoke-direct {v0, p0, p1}, Ljava/net/URL;-><init>(Ljava/net/URL;Ljava/lang/String;)V
|
|
|
|
.line 2
|
|
invoke-virtual {v0}, Ljava/net/URL;->getProtocol()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "https"
|
|
|
|
.line 3
|
|
invoke-virtual {p1, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
const-string p1, "http"
|
|
|
|
invoke-virtual {p1, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 4
|
|
:cond_0
|
|
new-instance p1, Ljava/net/ProtocolException;
|
|
|
|
const-string v0, "Unsupported protocol redirect: "
|
|
|
|
invoke-static {v0, p0}, Lc/g;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {p1, p0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-object v0
|
|
|
|
.line 5
|
|
:cond_2
|
|
new-instance p0, Ljava/net/ProtocolException;
|
|
|
|
const-string p1, "Null location redirect"
|
|
|
|
invoke-direct {p0, p1}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private makeConnection(Lcom/google/android/exoplayer2/upstream/DataSpec;)Ljava/net/HttpURLConnection;
|
|
.locals 19
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
.line 1
|
|
new-instance v1, Ljava/net/URL;
|
|
|
|
iget-object v2, v0, Lcom/google/android/exoplayer2/upstream/DataSpec;->uri:Landroid/net/Uri;
|
|
|
|
invoke-virtual {v2}, Landroid/net/Uri;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 2
|
|
iget-object v2, v0, Lcom/google/android/exoplayer2/upstream/DataSpec;->postBody:[B
|
|
|
|
.line 3
|
|
iget-wide v12, v0, Lcom/google/android/exoplayer2/upstream/DataSpec;->position:J
|
|
|
|
.line 4
|
|
iget-wide v14, v0, Lcom/google/android/exoplayer2/upstream/DataSpec;->length:J
|
|
|
|
const/4 v3, 0x1
|
|
|
|
.line 5
|
|
invoke-virtual {v0, v3}, Lcom/google/android/exoplayer2/upstream/DataSpec;->isFlagSet(I)Z
|
|
|
|
move-result v16
|
|
|
|
move-object/from16 v11, p0
|
|
|
|
.line 6
|
|
iget-boolean v0, v11, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->allowCrossProtocolRedirects:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v8, 0x1
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move-wide v3, v12
|
|
|
|
move-wide v5, v14
|
|
|
|
move/from16 v7, v16
|
|
|
|
.line 7
|
|
invoke-direct/range {v0 .. v8}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->makeConnection(Ljava/net/URL;[BJJZZ)Ljava/net/HttpURLConnection;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
add-int/lit8 v10, v0, 0x1
|
|
|
|
const/16 v3, 0x14
|
|
|
|
if-gt v0, v3, :cond_3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
move-object/from16 v3, p0
|
|
|
|
move-object v4, v1
|
|
|
|
move-object v5, v2
|
|
|
|
move-wide v6, v12
|
|
|
|
move-wide v8, v14
|
|
|
|
move-wide/from16 v17, v12
|
|
|
|
move v12, v10
|
|
|
|
move/from16 v10, v16
|
|
|
|
move v11, v0
|
|
|
|
.line 8
|
|
invoke-direct/range {v3 .. v11}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->makeConnection(Ljava/net/URL;[BJJZZ)Ljava/net/HttpURLConnection;
|
|
|
|
move-result-object v0
|
|
|
|
.line 9
|
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getResponseCode()I
|
|
|
|
move-result v3
|
|
|
|
const/16 v4, 0x12c
|
|
|
|
if-eq v3, v4, :cond_2
|
|
|
|
const/16 v4, 0x12d
|
|
|
|
if-eq v3, v4, :cond_2
|
|
|
|
const/16 v4, 0x12e
|
|
|
|
if-eq v3, v4, :cond_2
|
|
|
|
const/16 v4, 0x12f
|
|
|
|
if-eq v3, v4, :cond_2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
const/16 v2, 0x133
|
|
|
|
if-eq v3, v2, :cond_2
|
|
|
|
const/16 v2, 0x134
|
|
|
|
if-ne v3, v2, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
return-object v0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
const/4 v2, 0x0
|
|
|
|
const-string v3, "Location"
|
|
|
|
.line 10
|
|
invoke-virtual {v0, v3}, Ljava/net/HttpURLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
.line 11
|
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V
|
|
|
|
.line 12
|
|
invoke-static {v1, v3}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->handleRedirect(Ljava/net/URL;Ljava/lang/String;)Ljava/net/URL;
|
|
|
|
move-result-object v1
|
|
|
|
move-object/from16 v11, p0
|
|
|
|
move v0, v12
|
|
|
|
move-wide/from16 v12, v17
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
move v12, v10
|
|
|
|
.line 13
|
|
new-instance v0, Ljava/net/NoRouteToHostException;
|
|
|
|
const-string v1, "Too many redirects: "
|
|
|
|
invoke-static {v1, v12}, Landroid/support/v4/media/b;->a(Ljava/lang/String;I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/net/NoRouteToHostException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private makeConnection(Ljava/net/URL;[BJJZZ)Ljava/net/HttpURLConnection;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 14
|
|
invoke-virtual {p1}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/net/HttpURLConnection;
|
|
|
|
.line 15
|
|
iget v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connectTimeoutMillis:I
|
|
|
|
invoke-virtual {p1, v0}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V
|
|
|
|
.line 16
|
|
iget v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->readTimeoutMillis:I
|
|
|
|
invoke-virtual {p1, v0}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V
|
|
|
|
.line 17
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->defaultRequestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 18
|
|
invoke-virtual {v0}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;->getSnapshot()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Map$Entry;
|
|
|
|
.line 19
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
|
|
invoke-virtual {p1, v2, v1}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 20
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->requestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
invoke-virtual {v0}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;->getSnapshot()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_1
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Map$Entry;
|
|
|
|
.line 21
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
|
|
invoke-virtual {p1, v2, v1}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long v0, p3, v0
|
|
|
|
const-wide/16 v1, -0x1
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
cmp-long v0, p5, v1
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
:cond_2
|
|
const-string v0, "bytes="
|
|
|
|
const-string v3, "-"
|
|
|
|
.line 22
|
|
invoke-static {v0, p3, p4, v3}, Landroidx/concurrent/futures/a;->a(Ljava/lang/String;JLjava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
cmp-long v1, p5, v1
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
.line 23
|
|
invoke-static {v0}, Landroid/support/v4/media/d;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
add-long/2addr p3, p5
|
|
|
|
const-wide/16 p5, 0x1
|
|
|
|
sub-long/2addr p3, p5
|
|
|
|
invoke-virtual {v0, p3, p4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_3
|
|
const-string p3, "Range"
|
|
|
|
.line 24
|
|
invoke-virtual {p1, p3, v0}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 25
|
|
:cond_4
|
|
iget-object p3, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->userAgent:Ljava/lang/String;
|
|
|
|
const-string p4, "User-Agent"
|
|
|
|
invoke-virtual {p1, p4, p3}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
if-nez p7, :cond_5
|
|
|
|
const-string p3, "Accept-Encoding"
|
|
|
|
const-string p4, "identity"
|
|
|
|
.line 26
|
|
invoke-virtual {p1, p3, p4}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 27
|
|
:cond_5
|
|
invoke-virtual {p1, p8}, Ljava/net/HttpURLConnection;->setInstanceFollowRedirects(Z)V
|
|
|
|
if-eqz p2, :cond_6
|
|
|
|
const/4 p3, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
const/4 p3, 0x0
|
|
|
|
.line 28
|
|
:goto_2
|
|
invoke-virtual {p1, p3}, Ljava/net/HttpURLConnection;->setDoOutput(Z)V
|
|
|
|
if-eqz p2, :cond_8
|
|
|
|
const-string p3, "POST"
|
|
|
|
.line 29
|
|
invoke-virtual {p1, p3}, Ljava/net/HttpURLConnection;->setRequestMethod(Ljava/lang/String;)V
|
|
|
|
.line 30
|
|
array-length p3, p2
|
|
|
|
if-nez p3, :cond_7
|
|
|
|
.line 31
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->connect()V
|
|
|
|
goto :goto_3
|
|
|
|
.line 32
|
|
:cond_7
|
|
array-length p3, p2
|
|
|
|
invoke-virtual {p1, p3}, Ljava/net/HttpURLConnection;->setFixedLengthStreamingMode(I)V
|
|
|
|
.line 33
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->connect()V
|
|
|
|
.line 34
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->getOutputStream()Ljava/io/OutputStream;
|
|
|
|
move-result-object p3
|
|
|
|
.line 35
|
|
invoke-virtual {p3, p2}, Ljava/io/OutputStream;->write([B)V
|
|
|
|
.line 36
|
|
invoke-virtual {p3}, Ljava/io/OutputStream;->close()V
|
|
|
|
goto :goto_3
|
|
|
|
.line 37
|
|
:cond_8
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->connect()V
|
|
|
|
:goto_3
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private static maybeTerminateInputStream(Ljava/net/HttpURLConnection;J)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
sget v0, Lcom/google/android/exoplayer2/util/Util;->SDK_INT:I
|
|
|
|
const/16 v1, 0x13
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
const/16 v1, 0x14
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
:try_start_0
|
|
invoke-virtual {p0}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;
|
|
|
|
move-result-object p0
|
|
|
|
const-wide/16 v0, -0x1
|
|
|
|
cmp-long v0, p1, v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 3
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->read()I
|
|
|
|
move-result p1
|
|
|
|
const/4 p2, -0x1
|
|
|
|
if-ne p1, p2, :cond_2
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-wide/16 v0, 0x800
|
|
|
|
cmp-long p1, p1, v0
|
|
|
|
if-gtz p1, :cond_2
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_2
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "com.android.okhttp.internal.http.HttpTransport$ChunkedInputStream"
|
|
|
|
.line 5
|
|
invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p2
|
|
|
|
if-nez p2, :cond_3
|
|
|
|
const-string p2, "com.android.okhttp.internal.http.HttpTransport$FixedLengthInputStream"
|
|
|
|
.line 6
|
|
invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
.line 7
|
|
:cond_3
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "unexpectedEndOfInput"
|
|
|
|
const/4 v0, 0x0
|
|
|
|
new-array v1, v0, [Ljava/lang/Class;
|
|
|
|
.line 8
|
|
invoke-virtual {p1, p2, v1}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 p2, 0x1
|
|
|
|
.line 9
|
|
invoke-virtual {p1, p2}, Ljava/lang/reflect/Method;->setAccessible(Z)V
|
|
|
|
new-array p2, v0, [Ljava/lang/Object;
|
|
|
|
.line 10
|
|
invoke-virtual {p1, p0, p2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method private readInternal([BII)I
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
|
|
.line 1
|
|
:cond_0
|
|
iget-wide v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToRead:J
|
|
|
|
const-wide/16 v2, -0x1
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
const/4 v5, -0x1
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
.line 2
|
|
iget-wide v6, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesRead:J
|
|
|
|
sub-long/2addr v0, v6
|
|
|
|
const-wide/16 v6, 0x0
|
|
|
|
cmp-long v4, v0, v6
|
|
|
|
if-nez v4, :cond_1
|
|
|
|
return v5
|
|
|
|
:cond_1
|
|
int-to-long v6, p3
|
|
|
|
.line 3
|
|
invoke-static {v6, v7, v0, v1}, Ljava/lang/Math;->min(JJ)J
|
|
|
|
move-result-wide v0
|
|
|
|
long-to-int p3, v0
|
|
|
|
.line 4
|
|
:cond_2
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->inputStream:Ljava/io/InputStream;
|
|
|
|
invoke-virtual {v0, p1, p2, p3}, Ljava/io/InputStream;->read([BII)I
|
|
|
|
move-result p1
|
|
|
|
if-ne p1, v5, :cond_4
|
|
|
|
.line 5
|
|
iget-wide p1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToRead:J
|
|
|
|
cmp-long p1, p1, v2
|
|
|
|
if-nez p1, :cond_3
|
|
|
|
return v5
|
|
|
|
.line 6
|
|
:cond_3
|
|
new-instance p1, Ljava/io/EOFException;
|
|
|
|
invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
|
|
|
|
throw p1
|
|
|
|
.line 7
|
|
:cond_4
|
|
iget-wide p2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesRead:J
|
|
|
|
int-to-long v0, p1
|
|
|
|
add-long/2addr p2, v0
|
|
|
|
iput-wide p2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesRead:J
|
|
|
|
.line 8
|
|
iget-object p2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->listener:Lcom/google/android/exoplayer2/upstream/TransferListener;
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
.line 9
|
|
invoke-interface {p2, p0, p1}, Lcom/google/android/exoplayer2/upstream/TransferListener;->onBytesTransferred(Ljava/lang/Object;I)V
|
|
|
|
:cond_5
|
|
return p1
|
|
.end method
|
|
|
|
.method private skipInternal()V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-wide v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesSkipped:J
|
|
|
|
iget-wide v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToSkip:J
|
|
|
|
cmp-long v0, v0, v2
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
sget-object v0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->skipBufferReference:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;->getAndSet(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [B
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const/16 v0, 0x1000
|
|
|
|
new-array v0, v0, [B
|
|
|
|
.line 3
|
|
:cond_1
|
|
:goto_0
|
|
iget-wide v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesSkipped:J
|
|
|
|
iget-wide v3, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToSkip:J
|
|
|
|
cmp-long v5, v1, v3
|
|
|
|
if-eqz v5, :cond_4
|
|
|
|
sub-long/2addr v3, v1
|
|
|
|
.line 4
|
|
array-length v1, v0
|
|
|
|
int-to-long v1, v1
|
|
|
|
invoke-static {v3, v4, v1, v2}, Ljava/lang/Math;->min(JJ)J
|
|
|
|
move-result-wide v1
|
|
|
|
long-to-int v1, v1
|
|
|
|
.line 5
|
|
iget-object v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->inputStream:Ljava/io/InputStream;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {v2, v0, v3, v1}, Ljava/io/InputStream;->read([BII)I
|
|
|
|
move-result v1
|
|
|
|
.line 6
|
|
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_3
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-eq v1, v2, :cond_2
|
|
|
|
.line 7
|
|
iget-wide v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesSkipped:J
|
|
|
|
int-to-long v4, v1
|
|
|
|
add-long/2addr v2, v4
|
|
|
|
iput-wide v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesSkipped:J
|
|
|
|
.line 8
|
|
iget-object v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->listener:Lcom/google/android/exoplayer2/upstream/TransferListener;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 9
|
|
invoke-interface {v2, p0, v1}, Lcom/google/android/exoplayer2/upstream/TransferListener;->onBytesTransferred(Ljava/lang/Object;I)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 10
|
|
:cond_2
|
|
new-instance v0, Ljava/io/EOFException;
|
|
|
|
invoke-direct {v0}, Ljava/io/EOFException;-><init>()V
|
|
|
|
throw v0
|
|
|
|
.line 11
|
|
:cond_3
|
|
new-instance v0, Ljava/io/InterruptedIOException;
|
|
|
|
invoke-direct {v0}, Ljava/io/InterruptedIOException;-><init>()V
|
|
|
|
throw v0
|
|
|
|
.line 12
|
|
:cond_4
|
|
sget-object v1, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->skipBufferReference:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/util/concurrent/atomic/AtomicReference;->set(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final bytesRead()J
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-wide v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesRead:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public final bytesRemaining()J
|
|
.locals 4
|
|
|
|
.line 1
|
|
iget-wide v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToRead:J
|
|
|
|
const-wide/16 v2, -0x1
|
|
|
|
cmp-long v2, v0, v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-wide v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesRead:J
|
|
|
|
sub-long/2addr v0, v2
|
|
|
|
:goto_0
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public final bytesSkipped()J
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-wide v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesSkipped:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public clearAllRequestProperties()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->requestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
invoke-virtual {v0}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;->clear()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public clearRequestProperty(Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-static {p1}, Lcom/google/android/exoplayer2/util/Assertions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->requestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;->remove(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public close()V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
iget-object v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->inputStream:Ljava/io/InputStream;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 2
|
|
iget-object v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesRemaining()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v2, v3, v4}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->maybeTerminateInputStream(Ljava/net/HttpURLConnection;J)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 3
|
|
:try_start_1
|
|
iget-object v2, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->inputStream:Ljava/io/InputStream;
|
|
|
|
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v2
|
|
|
|
.line 4
|
|
:try_start_2
|
|
new-instance v3, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;
|
|
|
|
iget-object v4, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->dataSpec:Lcom/google/android/exoplayer2/upstream/DataSpec;
|
|
|
|
const/4 v5, 0x3
|
|
|
|
invoke-direct {v3, v2, v4, v5}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;-><init>(Ljava/io/IOException;Lcom/google/android/exoplayer2/upstream/DataSpec;I)V
|
|
|
|
throw v3
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
.line 5
|
|
:cond_0
|
|
:goto_0
|
|
iput-object v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->inputStream:Ljava/io/InputStream;
|
|
|
|
.line 6
|
|
invoke-direct {p0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->closeConnectionQuietly()V
|
|
|
|
.line 7
|
|
iget-boolean v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->opened:Z
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 8
|
|
iput-boolean v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->opened:Z
|
|
|
|
.line 9
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->listener:Lcom/google/android/exoplayer2/upstream/TransferListener;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 10
|
|
invoke-interface {v0, p0}, Lcom/google/android/exoplayer2/upstream/TransferListener;->onTransferEnd(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v2
|
|
|
|
.line 11
|
|
iput-object v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->inputStream:Ljava/io/InputStream;
|
|
|
|
.line 12
|
|
invoke-direct {p0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->closeConnectionQuietly()V
|
|
|
|
.line 13
|
|
iget-boolean v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->opened:Z
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 14
|
|
iput-boolean v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->opened:Z
|
|
|
|
.line 15
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->listener:Lcom/google/android/exoplayer2/upstream/TransferListener;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 16
|
|
invoke-interface {v0, p0}, Lcom/google/android/exoplayer2/upstream/TransferListener;->onTransferEnd(Ljava/lang/Object;)V
|
|
|
|
:cond_2
|
|
throw v2
|
|
.end method
|
|
|
|
.method public final getConnection()Ljava/net/HttpURLConnection;
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getResponseHeaders()Ljava/util/Map;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getHeaderFields()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getUri()Landroid/net/Uri;
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getURL()Ljava/net/URL;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/net/URL;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public open(Lcom/google/android/exoplayer2/upstream/DataSpec;)J
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "Unable to connect to "
|
|
|
|
.line 1
|
|
iput-object p1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->dataSpec:Lcom/google/android/exoplayer2/upstream/DataSpec;
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
.line 2
|
|
iput-wide v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesRead:J
|
|
|
|
.line 3
|
|
iput-wide v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesSkipped:J
|
|
|
|
const/4 v3, 0x1
|
|
|
|
.line 4
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->makeConnection(Lcom/google/android/exoplayer2/upstream/DataSpec;)Ljava/net/HttpURLConnection;
|
|
|
|
move-result-object v4
|
|
|
|
iput-object v4, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
|
|
|
|
.line 5
|
|
:try_start_1
|
|
invoke-virtual {v4}, Ljava/net/HttpURLConnection;->getResponseCode()I
|
|
|
|
move-result v0
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
const/16 v4, 0xc8
|
|
|
|
if-lt v0, v4, :cond_8
|
|
|
|
const/16 v5, 0x12b
|
|
|
|
if-le v0, v5, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 6
|
|
:cond_0
|
|
iget-object v5, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
invoke-virtual {v5}, Ljava/net/HttpURLConnection;->getContentType()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
.line 7
|
|
iget-object v6, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->contentTypePredicate:Lcom/google/android/exoplayer2/util/Predicate;
|
|
|
|
if-eqz v6, :cond_2
|
|
|
|
invoke-interface {v6, v5}, Lcom/google/android/exoplayer2/util/Predicate;->evaluate(Ljava/lang/Object;)Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
.line 8
|
|
:cond_1
|
|
invoke-direct {p0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->closeConnectionQuietly()V
|
|
|
|
.line 9
|
|
new-instance v0, Lcom/google/android/exoplayer2/upstream/HttpDataSource$InvalidContentTypeException;
|
|
|
|
invoke-direct {v0, v5, p1}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$InvalidContentTypeException;-><init>(Ljava/lang/String;Lcom/google/android/exoplayer2/upstream/DataSpec;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
:goto_0
|
|
if-ne v0, v4, :cond_3
|
|
|
|
.line 10
|
|
iget-wide v4, p1, Lcom/google/android/exoplayer2/upstream/DataSpec;->position:J
|
|
|
|
cmp-long v0, v4, v1
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
move-wide v1, v4
|
|
|
|
:cond_3
|
|
iput-wide v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToSkip:J
|
|
|
|
.line 11
|
|
invoke-virtual {p1, v3}, Lcom/google/android/exoplayer2/upstream/DataSpec;->isFlagSet(I)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_6
|
|
|
|
.line 12
|
|
iget-wide v0, p1, Lcom/google/android/exoplayer2/upstream/DataSpec;->length:J
|
|
|
|
const-wide/16 v4, -0x1
|
|
|
|
cmp-long v2, v0, v4
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
.line 13
|
|
iput-wide v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToRead:J
|
|
|
|
goto :goto_1
|
|
|
|
.line 14
|
|
:cond_4
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
invoke-static {v0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->getContentLength(Ljava/net/HttpURLConnection;)J
|
|
|
|
move-result-wide v0
|
|
|
|
cmp-long v2, v0, v4
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
.line 15
|
|
iget-wide v4, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToSkip:J
|
|
|
|
sub-long v4, v0, v4
|
|
|
|
:cond_5
|
|
iput-wide v4, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToRead:J
|
|
|
|
goto :goto_1
|
|
|
|
.line 16
|
|
:cond_6
|
|
iget-wide v0, p1, Lcom/google/android/exoplayer2/upstream/DataSpec;->length:J
|
|
|
|
iput-wide v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToRead:J
|
|
|
|
.line 17
|
|
:goto_1
|
|
:try_start_2
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->inputStream:Ljava/io/InputStream;
|
|
:try_end_2
|
|
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
|
|
|
|
.line 18
|
|
iput-boolean v3, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->opened:Z
|
|
|
|
.line 19
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->listener:Lcom/google/android/exoplayer2/upstream/TransferListener;
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
.line 20
|
|
invoke-interface {v0, p0, p1}, Lcom/google/android/exoplayer2/upstream/TransferListener;->onTransferStart(Ljava/lang/Object;Lcom/google/android/exoplayer2/upstream/DataSpec;)V
|
|
|
|
.line 21
|
|
:cond_7
|
|
iget-wide v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->bytesToRead:J
|
|
|
|
return-wide v0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
.line 22
|
|
invoke-direct {p0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->closeConnectionQuietly()V
|
|
|
|
.line 23
|
|
new-instance v1, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;
|
|
|
|
invoke-direct {v1, v0, p1, v3}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;-><init>(Ljava/io/IOException;Lcom/google/android/exoplayer2/upstream/DataSpec;I)V
|
|
|
|
throw v1
|
|
|
|
.line 24
|
|
:cond_8
|
|
:goto_2
|
|
iget-object v1, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->connection:Ljava/net/HttpURLConnection;
|
|
|
|
invoke-virtual {v1}, Ljava/net/HttpURLConnection;->getHeaderFields()Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
.line 25
|
|
invoke-direct {p0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->closeConnectionQuietly()V
|
|
|
|
.line 26
|
|
new-instance v2, Lcom/google/android/exoplayer2/upstream/HttpDataSource$InvalidResponseCodeException;
|
|
|
|
invoke-direct {v2, v0, v1, p1}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$InvalidResponseCodeException;-><init>(ILjava/util/Map;Lcom/google/android/exoplayer2/upstream/DataSpec;)V
|
|
|
|
const/16 p1, 0x1a0
|
|
|
|
if-ne v0, p1, :cond_9
|
|
|
|
.line 27
|
|
new-instance p1, Lcom/google/android/exoplayer2/upstream/DataSourceException;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p1, v0}, Lcom/google/android/exoplayer2/upstream/DataSourceException;-><init>(I)V
|
|
|
|
invoke-virtual {v2, p1}, Ljava/io/IOException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
|
|
|
|
.line 28
|
|
:cond_9
|
|
throw v2
|
|
|
|
:catch_1
|
|
move-exception v1
|
|
|
|
.line 29
|
|
invoke-direct {p0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->closeConnectionQuietly()V
|
|
|
|
.line 30
|
|
new-instance v2, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;
|
|
|
|
invoke-static {v0}, Landroid/support/v4/media/d;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v4, p1, Lcom/google/android/exoplayer2/upstream/DataSpec;->uri:Landroid/net/Uri;
|
|
|
|
invoke-virtual {v4}, Landroid/net/Uri;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v2, v0, v1, p1, v3}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;-><init>(Ljava/lang/String;Ljava/io/IOException;Lcom/google/android/exoplayer2/upstream/DataSpec;I)V
|
|
|
|
throw v2
|
|
|
|
:catch_2
|
|
move-exception v1
|
|
|
|
.line 31
|
|
new-instance v2, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;
|
|
|
|
invoke-static {v0}, Landroid/support/v4/media/d;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v4, p1, Lcom/google/android/exoplayer2/upstream/DataSpec;->uri:Landroid/net/Uri;
|
|
|
|
invoke-virtual {v4}, Landroid/net/Uri;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v2, v0, v1, p1, v3}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;-><init>(Ljava/lang/String;Ljava/io/IOException;Lcom/google/android/exoplayer2/upstream/DataSpec;I)V
|
|
|
|
throw v2
|
|
.end method
|
|
|
|
.method public read([BII)I
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-direct {p0}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->skipInternal()V
|
|
|
|
.line 2
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->readInternal([BII)I
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return p1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 3
|
|
new-instance p2, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;
|
|
|
|
iget-object p3, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->dataSpec:Lcom/google/android/exoplayer2/upstream/DataSpec;
|
|
|
|
const/4 v0, 0x2
|
|
|
|
invoke-direct {p2, p1, p3, v0}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$HttpDataSourceException;-><init>(Ljava/io/IOException;Lcom/google/android/exoplayer2/upstream/DataSpec;I)V
|
|
|
|
throw p2
|
|
.end method
|
|
|
|
.method public setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-static {p1}, Lcom/google/android/exoplayer2/util/Assertions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 2
|
|
invoke-static {p2}, Lcom/google/android/exoplayer2/util/Assertions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 3
|
|
iget-object v0, p0, Lcom/google/android/exoplayer2/upstream/DefaultHttpDataSource;->requestProperties:Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/google/android/exoplayer2/upstream/HttpDataSource$RequestProperties;->set(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|