Change fragment's onCreateView() and onStart() to make it resumable
Fragment is detached from the activity when user says "OKG, set a timer for 1 minute", or use swipe from edge to "close" the player. When it is attached back to activity by clicking on home view's tile, onCreateView() and onStart() will be called again, but cast views and CastWebContentsSurfaceHelper already attached with current WebContents should be reused. Change-Id: Ibc6dc3a31cd0ff3fc31e16c879537db43185b2f4 Bug: b/72838507 Test: 1. Say "OKG, play a video" and see cast fragment shown; 2. Say "OKG, set a timer for 1 minute" and dismiss the timer page, see cast fragment recovered correctly and video could be resume; 3. Check log output and see 2nd call of onCreateView() and onStart() won't recreate new fragment view and reset webconent. TODO(vincentli): Add a test case to cover CastWebContentsFragment's lifecycle Change-Id: Ibc6dc3a31cd0ff3fc31e16c879537db43185b2f4 Reviewed-on: https://chromium-review.googlesource.com/898602 Commit-Queue: Zhiheng(Vincent) Li <vincentli@google.com> Reviewed-by:Stephen Lanham <slan@chromium.org> Cr-Commit-Position: refs/heads/master@{#534131}
Showing
Please register or sign in to comment