Skip to content

Commit 465e926

Browse files
author
Doris Ling
committed
Fix animation video render issue when Settings->Moves is resumed from
screen off. Re-initialize the animation video if necessary when the preference is visible to the user. Fixes: 31023261 Test: manual - 1. Go to Settings -> Moves and verify that the animation video are displayed correctly on load. 2. Press power button to turn screen off, then on again. Verify when Moves settings resumes, the animation video is displayed correctly. 3. Repeat #2 above but let display time out instead of turning off screen by power button. Change-Id: I0ee21d23a4c402b3a8463dca3b36fce67d651993 (cherry picked from commit 008ba4e)
1 parent 1330f13 commit 465e926

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/com/android/settings/gestures/GesturePreference.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ void loadPreview(LoaderManager manager, int id) {
185185
Loader<Bitmap> loader = manager.initLoader(id, Bundle.EMPTY, this);
186186
}
187187

188+
void onViewVisible() {
189+
if (mVideoReady && mMediaPlayer != null && !mMediaPlayer.isPlaying()) {
190+
mMediaPlayer.seekTo(0);
191+
}
192+
}
193+
188194
private static final class PreviewRetriever extends AsyncLoader<Bitmap> {
189195
private Uri mVideoPath;
190196

src/com/android/settings/gestures/GestureSettings.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
118118
return view;
119119
}
120120

121+
@Override
122+
public void onStart() {
123+
super.onStart();
124+
for (GesturePreference preference : mPreferences) {
125+
preference.onViewVisible();
126+
}
127+
}
128+
121129
@Override
122130
public boolean onPreferenceChange(Preference preference, Object newValue) {
123131
boolean enabled = (boolean) newValue;

0 commit comments

Comments
 (0)