From 21bbd3844eb2d4e9a225b2f2f8bc1e99ab1e954f Mon Sep 17 00:00:00 2001 From: Christopher Eby Date: Mon, 22 Feb 2010 17:11:28 -0600 Subject: [PATCH] Clarify if the music is paused in the notification text --- res/values/strings.xml | 1 + src/org/kreed/vanilla/PlaybackService.java | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index c152a8cc..fc959610 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -10,6 +10,7 @@ Open Player Stop Service Connect to Service + (Paused) Headset only Audio only plays when a headset is plugged in diff --git a/src/org/kreed/vanilla/PlaybackService.java b/src/org/kreed/vanilla/PlaybackService.java index fffd60d6..543c6556 100644 --- a/src/org/kreed/vanilla/PlaybackService.java +++ b/src/org/kreed/vanilla/PlaybackService.java @@ -371,6 +371,9 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On int oldState = mState; mState = state; + mNotification = createNotification(); + mNotificationManager.notify(NOTIFICATION_ID, mNotification); + int i = mWatchers.beginBroadcast(); while (--i != -1) { try { @@ -397,9 +400,13 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On { Song song = getSong(0); + String title = song.title; + if (mState != STATE_PLAYING) + title += ' ' + getResources().getString(R.string.paused); + RemoteViews views = new RemoteViews(getPackageName(), R.layout.statusbar); views.setImageViewResource(R.id.icon, R.drawable.status_icon); - views.setTextViewText(R.id.title, song.title); + views.setTextViewText(R.id.title, title); views.setTextViewText(R.id.artist, song.artist); Notification notification = new Notification();