[Clank MR] Fix several issues in FlingingControllerAdapter

RemoteMediaClient.getApproximateStreamPosition() is expensive for
polling as it has an internal lock. This CL will calculate the
approximate stream position in Clank, so we only read from
RemoteMediaClient upon status update. A new class
(StreamPositionExtrapolator) is migrated from the non-CAF code,
which is used as a helper class for position calculation.

Also the loaded state is cleared if the player state is idle and
finished, which solves the "seek after finished" issue.

Bug: 711860
Change-Id: I95b1fe67f3ae12ef7012c6ce1f5e7fe7af2d13be
Reviewed-on: https://chromium-review.googlesource.com/c/1364065
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Zhiqiang Zhang <zqzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614527}
3 files changed