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
This commit is contained in:
tonihei 2018-11-26 13:21:02 +00:00 committed by Andrew Lewis
parent 3e150b54f4
commit 30e753ea1d

View File

@ -16,6 +16,7 @@
package com.google.android.exoplayer2.ext.cronet;
import android.net.Uri;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
@ -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.
private UrlRequest.Builder buildRequestBuilder(DataSpec dataSpec) throws IOException {