diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2017-05-17 08:36:43 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-05-17 08:36:43 +0000 |
| commit | fe64f2c3113cd0b3e0a93be104e7cebd2fc6ebc6 (patch) | |
| tree | bfbdc0c1bab615858eaad4789715e5df00413136 | |
| parent | c55ed4a30243ddaeed0966707e5bdf6e8e1451e5 (diff) | |
| parent | 538c69661f30d126b6f95fe82713da429ac148b1 (diff) | |
| download | platform_packages_apps_Car_LocalMediaPlayer-oreo-dr3-release.tar.gz platform_packages_apps_Car_LocalMediaPlayer-oreo-dr3-release.tar.bz2 platform_packages_apps_Car_LocalMediaPlayer-oreo-dr3-release.zip | |
release-request-3605d486-97ee-488a-9bef-b52de93b00b5-for-git_oc-dr1-release-4017239 snap-temp-L53000000064886993android-8.0.0_r34android-8.0.0_r33android-8.0.0_r27android-8.0.0_r26android-8.0.0_r25android-8.0.0_r24android-8.0.0_r23android-8.0.0_r22android-8.0.0_r21oreo-dr3-releaseoreo-dr2-releaseoreo-dr1-release
Change-Id: I3924b9f25d08c45d7211761b501db879a702b542
| -rw-r--r-- | proto/proto.proto | 1 | ||||
| -rw-r--r-- | src/com/android/car/media/localmediaplayer/Player.java | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/proto/proto.proto b/proto/proto.proto index aab14fd..979ee72 100644 --- a/proto/proto.proto +++ b/proto/proto.proto @@ -24,6 +24,7 @@ message Playlist { repeated Song songs = 1; optional int64 current_queue_id = 2; optional string name = 3; + optional int32 current_song_position = 4; } message Song { diff --git a/src/com/android/car/media/localmediaplayer/Player.java b/src/com/android/car/media/localmediaplayer/Player.java index 8a6aae9..7f1850f 100644 --- a/src/com/android/car/media/localmediaplayer/Player.java +++ b/src/com/android/car/media/localmediaplayer/Player.java @@ -213,6 +213,7 @@ public class Player extends MediaSession.Callback { idx++; } playlist.currentQueueId = mQueue.get(mCurrentQueueIdx).getQueueId(); + playlist.currentSongPosition = mMediaPlayer.getCurrentPosition(); playlist.name = CURRENT_PLAYLIST_KEY; // Go to Base64 to ensure that we can actually store the string in a sharedpref. This is @@ -277,8 +278,9 @@ public class Player extends MediaSession.Callback { requestAudioFocus(() -> { try { - updatePlaybackStatePlaying(); playCurrentQueueIndex(); + mMediaPlayer.seekTo(playlist.currentSongPosition); + updatePlaybackStatePlaying(); } catch (IOException e) { Log.e(TAG, "Restored queue, but couldn't resume playback."); } |
