diff options
author | Antoine Cellerier <dionoea@videolan.org> | 2011-03-09 18:46:55 +0000 |
---|---|---|
committer | Antoine Cellerier <dionoea@videolan.org> | 2011-03-09 18:46:55 +0000 |
commit | fd7375c307a2bf99847b5de180efe98e829f2439 (patch) | |
tree | d35aaf32387efe6e78fbb3dd7a81ca9d1b2564f1 /android/src/org/rockbox/Helper | |
parent | 64cf0dd765dc11058a02024032784a9f2eb494b5 (diff) | |
download | rockbox-fd7375c307a2bf99847b5de180efe98e829f2439.tar.gz rockbox-fd7375c307a2bf99847b5de180efe98e829f2439.zip |
Ask for track information to be resent after creating a new widget.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29553 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android/src/org/rockbox/Helper')
-rw-r--r-- | android/src/org/rockbox/Helper/RunForegroundManager.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/android/src/org/rockbox/Helper/RunForegroundManager.java b/android/src/org/rockbox/Helper/RunForegroundManager.java index c08e742aba..6ecb16a408 100644 --- a/android/src/org/rockbox/Helper/RunForegroundManager.java +++ b/android/src/org/rockbox/Helper/RunForegroundManager.java @@ -23,6 +23,7 @@ public class RunForegroundManager private NotificationManager mNM; private IRunForeground api; private Service mCurrentService; + private Intent mWidgetUpdate; public RunForegroundManager(Service service) { @@ -48,10 +49,12 @@ public class RunForegroundManager api = new oldForegroundApi(); } } + private void LOG(CharSequence text) { Log.d("Rockbox", (String)text); } + private void LOG(CharSequence text, Throwable tr) { Log.d("Rockbox", (String)text, tr); @@ -80,6 +83,7 @@ public class RunForegroundManager */ mNM.cancel(R.string.notification); api.stopForeground(); + mWidgetUpdate = null; } public void updateNotification(String title, String artist, String album, String albumart) @@ -93,12 +97,18 @@ public class RunForegroundManager mNotification.tickerText = title+" - "+artist; mNM.notify(R.string.notification, mNotification); - Intent widgetUpdate = new Intent("org.rockbox.TrackUpdateInfo"); - widgetUpdate.putExtra("title", title); - widgetUpdate.putExtra("artist", artist); - widgetUpdate.putExtra("album", album); - widgetUpdate.putExtra("albumart", albumart); - mCurrentService.sendBroadcast(widgetUpdate); + mWidgetUpdate = new Intent("org.rockbox.TrackUpdateInfo"); + mWidgetUpdate.putExtra("title", title); + mWidgetUpdate.putExtra("artist", artist); + mWidgetUpdate.putExtra("album", album); + mWidgetUpdate.putExtra("albumart", albumart); + mCurrentService.sendBroadcast(mWidgetUpdate); + } + + public void resendUpdateNotification() + { + if (mWidgetUpdate != null) + mCurrentService.sendBroadcast(mWidgetUpdate); } public void finishNotification() |