summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/src/org/rockbox/RockboxPCM.java13
-rw-r--r--android/src/org/rockbox/RockboxService.java4
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();
}