When internet is not stable, the file is downloading will be turned to success status. The DownloadManager will let the request to be success but actually it's not.
I have found this bug when testing in poor environment internet.
I use Charles to simulate with this setting
Thanks for your PR. I saw you change the condition with totalBytes, but totalBytes sometimes could not get from header, this will cause error downloading.
When internet is not stable, the file is downloading will be turned to success status. The DownloadManager will let the request to be success but actually it's not.
I have found this bug when testing in poor environment internet. I use Charles to simulate with this setting![throtling settings](https://user-images.githubusercontent.com/12933579/44741820-7680e380-ab28-11e8-9b3a-9bb18b33d2f5.png)