Fix abnormal consumption of mobile data

Problem: When user is watching http live streaming video, user does some
operation to let browser run in the background, but mobile data is still
consumed abnormally.

Root cause: When browser runs in the background, browser will call
mediaplayer pause function, which would pause video renderer. But if network
speed is fast and buffered data is more than PlaylistFecher::
kMinBufferedDurationUs, data can't be consumed and it will call
postMonitorQueue() frequently after delayUS time's up. At this time, if http
server returns error when refreshPlaylist, delayUs will be 0 because
mLastPlaylistFetchTimeUs is not updated, which will cause postMonitorQueue
and refreshPlaylist more frequently, and consumes more mobile data.

Solution: On PlaylistFetcher::onMonitorQueue(), if refreshPlaylist returns
error, it calls notifyError and then end this playback.

Bug: 123665682
Test: play http live streaming video, pause this playback, then close Wi-Fi
to simulate accessing http server error

Change-Id: Ic30d446d1ab6e34ac3e5ef414c2e71a09c296f92
(cherry picked from commit 4ae6a2ab791fc3d4b3f9f481ffca65c292be2fd3)
2 files changed