Commit 30e753ea by tonihei Committed by Andrew Lewis

Provide Cronet request and response data for subclasses.

Subclasses may want to analyze, log and react to the Cronet-specific
connection data.

Issue:#5134
PiperOrigin-RevId: 222809441
parent 3e150b54
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.google.android.exoplayer2.ext.cronet; package com.google.android.exoplayer2.ext.cronet;
import android.net.Uri; import android.net.Uri;
import android.support.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayerLibraryInfo; import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
...@@ -455,6 +456,18 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource { ...@@ -455,6 +456,18 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
} }
} }
/** Returns current {@link UrlRequest}. May be null if the data source is not opened. */
@Nullable
protected UrlRequest getCurrentUrlRequest() {
return currentUrlRequest;
}
/** Returns current {@link UrlResponseInfo}. May be null if the data source is not opened. */
@Nullable
protected UrlResponseInfo getCurrentUrlResponseInfo() {
return responseInfo;
}
// Internal methods. // Internal methods.
private UrlRequest.Builder buildRequestBuilder(DataSpec dataSpec) throws IOException { private UrlRequest.Builder buildRequestBuilder(DataSpec dataSpec) throws IOException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment