diff options
-rw-r--r-- | android/src/org/rockbox/RockboxService.java | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/android/src/org/rockbox/RockboxService.java b/android/src/org/rockbox/RockboxService.java index bbcdfec4a7..63ebd27566 100644 --- a/android/src/org/rockbox/RockboxService.java +++ b/android/src/org/rockbox/RockboxService.java @@ -311,30 +311,26 @@ public class RockboxService extends Service public void startForeground() { - if (instance != null) - { - /* - * Send the notification. - * We use a layout id because it is a unique number. - * We use it later to cancel. - */ - instance.mNM.notify(R.string.notification, instance.notification); - /* - * this call makes the service run as foreground, which - * provides enough cpu time to do music decoding in the - * background - */ - instance.startForegroundCompat(R.string.notification, - instance.notification); - } + /* + * Send the notification. + * We use a layout id because it is a unique number. + * We use it later to cancel. + */ + mNM.notify(R.string.notification, instance.notification); + /* + * this call makes the service run as foreground, which + * provides enough cpu time to do music decoding in the + * background + */ + startForegroundCompat(R.string.notification, notification); } public void stopForeground() { - if (instance.notification != null) + if (notification != null) { - instance.stopForegroundCompat(R.string.notification); - instance.mNM.cancel(R.string.notification); + stopForegroundCompat(R.string.notification); + mNM.cancel(R.string.notification); } } |