Notify surface creation and surface change only after playback is requested

Earlier, we were notifying surface creation and surface change to the
CMP as soon as we received the callback from surface holder, which gets
called as soon as the surface gets created when user starts swiping in
the preview. So, after starting a swipe, the CMP has already set the new
surface (for the next media where the user is intended to land once the
swipe is finished) to its player. Now, if the swipe gets cancelled and
user comes back to the media from where the swipe started, the player in
the CMP remains in the incorrect state (surface and media id of next
media has been set).
The implementation in the CL ensures that we notify surface creation and
surface change only when a swipe completes and the user actually lands
on the next media.
This CL also fixes a flicker problem: We were setting both the thumbnail
view and player view VISIBLE initially. Now since the thumbnail view has
transparent background (by default), hence the player was displaying the
media momentarily in a wrong aspect ratio (screen aspect ratio) behind
the thumbnail view (which is effectively transparent till the thumbnail
loads). The problem is fixed by hiding the player view initially and
showing it only when the player has the media aspect ratio.

Test: manual
Bug: 232278881
Change-Id: Id3866e839465b8ccab2af054ee64c68eafcd138b
5 files changed