[Android] PlaybackService: mode code
Thomas Guillem
git at videolan.org
Mon Jul 6 17:14:05 CEST 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jul 6 16:56:26 2015 +0200| [1c81f54ff3f8e150f82c7fe74a59ef12e694fd09] | committer: Thomas Guillem
PlaybackService: mode code
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=1c81f54ff3f8e150f82c7fe74a59ef12e694fd09
---
.../src/org/videolan/vlc/PlaybackService.java | 52 ++++++++++----------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 94b46c5..12e85b3 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1051,32 +1051,6 @@ public class PlaybackService extends Service {
}
}
- @MainThread
- public void next() {
- mPrevious.push(mCurrentIndex);
- mCurrentIndex = mNextIndex;
-
- int size = mMediaList.size();
- if (size == 0 || mCurrentIndex < 0 || mCurrentIndex >= size) {
- if (mCurrentIndex < 0)
- saveCurrentMedia();
- Log.w(TAG, "Warning: invalid next index, aborted !");
- stop();
- return;
- }
-
- playIndex(mCurrentIndex, 0);
-
- mHandler.sendEmptyMessage(SHOW_PROGRESS);
- showNotification();
- updateWidget();
- broadcastMetadata();
- updateRemoteControlClientMetadata();
- saveCurrentMedia();
-
- determinePrevAndNextIndices();
- }
-
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
private void updateRemoteControlClientMetadata() {
if (!AndroidUtil.isICSOrLater()) // NOP check
@@ -1117,6 +1091,32 @@ public class PlaybackService extends Service {
}
@MainThread
+ public void next() {
+ mPrevious.push(mCurrentIndex);
+ mCurrentIndex = mNextIndex;
+
+ int size = mMediaList.size();
+ if (size == 0 || mCurrentIndex < 0 || mCurrentIndex >= size) {
+ if (mCurrentIndex < 0)
+ saveCurrentMedia();
+ Log.w(TAG, "Warning: invalid next index, aborted !");
+ stop();
+ return;
+ }
+
+ playIndex(mCurrentIndex, 0);
+
+ mHandler.sendEmptyMessage(SHOW_PROGRESS);
+ showNotification();
+ updateWidget();
+ broadcastMetadata();
+ updateRemoteControlClientMetadata();
+ saveCurrentMedia();
+
+ determinePrevAndNextIndices();
+ }
+
+ @MainThread
public void previous() {
mCurrentIndex = mPrevIndex;
if (mPrevious.size() > 0)
More information about the Android
mailing list