[Android] Command UI update in events listener
Geoffrey Métais
git at videolan.org
Mon Nov 7 16:08:39 CET 2016
vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov 7 15:56:27 2016 +0100| [8d63c67977417f27d7d5854c2ad9e46a6fff52a0] | committer: Geoffrey Métais
Command UI update in events listener
(cherry picked from commit c4ad53aa021461a3c01d50269a09d8598fc43757)
> https://code.videolan.org/videolan/vlc-android/commit/8d63c67977417f27d7d5854c2ad9e46a6fff52a0
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index b0f6e19..759fa08 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -605,6 +605,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
executeUpdate();
publishState(event.type);
executeUpdateProgress();
+ mHandler.sendEmptyMessage(SHOW_PROGRESS);
final MediaWrapper mw = mMediaList.getMedia(mCurrentIndex);
if (mw != null) {
@@ -639,6 +640,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
publishState(event.type);
executeUpdateProgress();
showNotification();
+ mHandler.removeMessages(SHOW_PROGRESS);
if (mWakeLock.isHeld())
mWakeLock.release();
break;
@@ -952,22 +954,14 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
public void pause() {
if (mPausable) {
savePosition();
- mHandler.removeMessages(SHOW_PROGRESS);
- // hideNotification(); <-- see event handler
mMediaPlayer.pause();
- broadcastMetadata();
}
}
@MainThread
public void play() {
- if(hasCurrentMedia()) {
+ if (hasCurrentMedia())
mMediaPlayer.play();
- mHandler.sendEmptyMessage(SHOW_PROGRESS);
- updateMetadata();
- updateWidget();
- broadcastMetadata();
- }
}
@MainThread
More information about the Android
mailing list