-
Notifications
You must be signed in to change notification settings - Fork 319
[WIP] Add network interceptor and listener for tile download progress #1753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1a2c8c6 to
f4da5f5
Compare
Codecov Report
@@ Coverage Diff @@
## master #1753 +/- ##
============================================
- Coverage 35.04% 34.96% -0.09%
Complexity 1060 1060
============================================
Files 261 263 +2
Lines 8848 8870 +22
Branches 667 669 +2
============================================
Hits 3101 3101
- Misses 5475 5497 +22
Partials 272 272 |
| } | ||
|
|
||
| @Override | ||
| public Response intercept(@NonNull Chain chain) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care about RequestBody#contentLength()?
| private BufferedSource bufferedSource; | ||
|
|
||
| NetworkResponseBody(ResponseBody responseBody, NetworkProgressListener listener) { | ||
| this.responseBody = responseBody; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responseBody can be null here..
|
#1741 was closed as Offline feature is being re-implemented. Let's make sure the new version includes support for this. |
Closes #1741
This PR adds a
NetworkProgressListenerthat will allow us to get progress of a TAR (or any) API request.This is currently blocked upstream by the TAR download API not returning
content-length, so we aren't able to do the math for current progress of the download. Once the lands, we will also need to addInterceptorsupport for theMapboxRouteTilesso we can add the interceptor itself for the network request.TODO:
Interceptorsupportcontent-lengthis being providedcc @kevinkreiser @akitchen