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 | |||
311 | 311 | ||
312 | public void startForeground() | 312 | public void startForeground() |
313 | { | 313 | { |
314 | if (instance != null) | 314 | /* |
315 | { | 315 | * Send the notification. |
316 | /* | 316 | * We use a layout id because it is a unique number. |
317 | * Send the notification. | 317 | * We use it later to cancel. |
318 | * We use a layout id because it is a unique number. | 318 | */ |
319 | * We use it later to cancel. | 319 | mNM.notify(R.string.notification, instance.notification); |
320 | */ | 320 | /* |
321 | instance.mNM.notify(R.string.notification, instance.notification); | 321 | * this call makes the service run as foreground, which |
322 | /* | 322 | * provides enough cpu time to do music decoding in the |
323 | * this call makes the service run as foreground, which | 323 | * background |
324 | * provides enough cpu time to do music decoding in the | 324 | */ |
325 | * background | 325 | startForegroundCompat(R.string.notification, notification); |
326 | */ | ||
327 | instance.startForegroundCompat(R.string.notification, | ||
328 | instance.notification); | ||
329 | } | ||
330 | } | 326 | } |
331 | 327 | ||
332 | public void stopForeground() | 328 | public void stopForeground() |
333 | { | 329 | { |
334 | if (instance.notification != null) | 330 | if (notification != null) |
335 | { | 331 | { |
336 | instance.stopForegroundCompat(R.string.notification); | 332 | stopForegroundCompat(R.string.notification); |
337 | instance.mNM.cancel(R.string.notification); | 333 | mNM.cancel(R.string.notification); |
338 | } | 334 | } |
339 | } | 335 | } |
340 | 336 | ||