Closed sreejithr closed 8 years ago
Ok. This is what I understand. The phone could be idle (not uploading/downloading anything) and still be connected to the internet. So, a zero byte diff doesn't imply phone is offline. So adding such values to the moving average will pollute the average. Am I correct?
Yes, the zero byte check is for situations where you are idle or for situations where we're getting so few bytes, it doesn't make sense to analyze them directly and we should wait until more data comes to make any calculation.
Regarding offline, we handle the offline connection check separately in our apps since the decisions you need to make when the user is offline are different than if they have a connection and it's just slow.
The connection class doesn't change from what it used to be, when the phone goes offline. I traced the issue to this in
line 91
inConnectionClassManager.java
:Here, when
bytes
is 0 (because there's no byte diff), it just fails to add this bandwidth. Is this by design?P.S: My app is running code from release
1.0.1
(commit).