Browse Source

Merge branch 'devel'

yattoz 5 years ago
parent
commit
6552b67eba
1 changed files with 4 additions and 3 deletions
  1. 4 3
      app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt

+ 4 - 3
app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt View File

233
             Actions.NOTIFY.name -> nowPlayingNotification.update(this)
233
             Actions.NOTIFY.name -> nowPlayingNotification.update(this)
234
             Actions.PLAY_OR_FALLBACK.name -> beginPlayingOrFallback()
234
             Actions.PLAY_OR_FALLBACK.name -> beginPlayingOrFallback()
235
             Actions.FADE_OUT.name -> {
235
             Actions.FADE_OUT.name -> {
236
-                for (i in 1 until 30) // we schedule 30 "LowerVolumeRunnable" every 2 seconds (i * 2)
236
+                for (i in 1 until 28) // we schedule 28 "LowerVolumeRunnable" every 2 seconds (i * 2)
237
                 {
237
                 {
238
                     // I couldn't find how to send multiple times the same PendingIntent using AlarmManager, so I relied on Handler instead.
238
                     // I couldn't find how to send multiple times the same PendingIntent using AlarmManager, so I relied on Handler instead.
239
                     // I think there's no guarantee of exact time with the Handler, especially when the device is in deep sleep,
239
                     // I think there's no guarantee of exact time with the Handler, especially when the device is in deep sleep,
290
         apiTicker.cancel() // stops the timer.
290
         apiTicker.cancel() // stops the timer.
291
         Log.d(tag, radioTag + "destroyed")
291
         Log.d(tag, radioTag + "destroyed")
292
         // if the service is destroyed, the application had become useless.
292
         // if the service is destroyed, the application had become useless.
293
-        exitProcess(0)
293
+        // exitProcess(0)
294
+        Process.killProcess(Process.myPid())
294
     }
295
     }
295
 
296
 
296
     // ########################################
297
     // ########################################
360
                     Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
361
                     Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
361
                 }
362
                 }
362
                 if (entry is IcyInfo) {
363
                 if (entry is IcyInfo) {
363
-                    Log.e(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
364
+                    Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
364
                     // Note : Kotlin supports UTF-8 by default.
365
                     // Note : Kotlin supports UTF-8 by default.
365
                     numberOfSongs++
366
                     numberOfSongs++
366
                     val data = entry.title!!
367
                     val data = entry.title!!