Use the payload size as the base to calculate download overhead
The download_overhead_percentage was calculated based on the bytes
downloaded during the current update attempt. This may leads to large
number when the update is interrupted; and the resumed update attempt
only downloads a small portion of the payload. For example, for a 10M
payload; if we download 9M, interrupt, and resume to download the
remaining 1M; the current code will report the overhead as (10-1)/1*100%
as 900. We should switch to use the payload size as it was the intention
of the metrics.
Test: run update engine, interrupt and check the metrics
Change-Id: Ic3e1c0a0a4671ee6e7751d53fc40fd2dc8072d63
2 files changed