diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-02-26 20:27:00 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-02-26 20:27:00 +0000 |
commit | e6ae86720659a4e8a1a75d0eadaa495dac9cca8d (patch) | |
tree | b927bf3dc55a09a24e338bd1ba2c4a31cd4e761c /android | |
parent | eb016648045abdb80ee4e98cde405eb0c62b724c (diff) |
Android: Remove notification item on pausing too.
Technically, the difference between stop and pause isn't important enough to keep it when no music is playing. This is how other media apps also act.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29405 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android')
-rw-r--r-- | android/src/org/rockbox/RockboxPCM.java | 13 | ||||
-rw-r--r-- | android/src/org/rockbox/RockboxService.java | 4 |
2 files changed, 10 insertions, 7 deletions
diff --git a/android/src/org/rockbox/RockboxPCM.java b/android/src/org/rockbox/RockboxPCM.java index c1fecbcc15..1ff35f7b68 100644 --- a/android/src/org/rockbox/RockboxPCM.java +++ b/android/src/org/rockbox/RockboxPCM.java @@ -79,22 +79,25 @@ public class RockboxPCM extends AudioTrack } @SuppressWarnings("unused") - private void play_pause(boolean pause) { + private void play_pause(boolean pause) + { + RockboxService service = RockboxService.get_instance(); if (pause) { Intent widgetUpdate = new Intent("org.rockbox.UpdateState"); widgetUpdate.putExtra("state", "pause"); - RockboxService.get_instance().sendBroadcast(widgetUpdate); + service.sendBroadcast(widgetUpdate); + service.stopForeground(); pause(); } else { Intent widgetUpdate = new Intent("org.rockbox.UpdateState"); widgetUpdate.putExtra("state", "play"); - RockboxService.get_instance().sendBroadcast(widgetUpdate); + service.sendBroadcast(widgetUpdate); + service.startForeground(); if (getPlayState() == AudioTrack.PLAYSTATE_STOPPED) { - RockboxService.get_instance().startForeground(); if (getState() == AudioTrack.STATE_INITIALIZED) { if (h == null) @@ -121,10 +124,10 @@ public class RockboxPCM extends AudioTrack } catch (IllegalStateException e) { throw new IllegalStateException(e); } - RockboxService.get_instance().stopForeground(); Intent widgetUpdate = new Intent("org.rockbox.UpdateState"); widgetUpdate.putExtra("state", "stop"); RockboxService.get_instance().sendBroadcast(widgetUpdate); + RockboxService.get_instance().stopForeground(); } @SuppressWarnings("unused") diff --git a/android/src/org/rockbox/RockboxService.java b/android/src/org/rockbox/RockboxService.java index 5465152aa8..d198cb37b7 100644 --- a/android/src/org/rockbox/RockboxService.java +++ b/android/src/org/rockbox/RockboxService.java @@ -309,12 +309,12 @@ public class RockboxService extends Service registerReceiver(batt_monitor, itf); } - public void startForeground() + void startForeground() { fg_runner.startForeground(); } - public void stopForeground() + void stopForeground() { fg_runner.stopForeground(); } |