|
@@ -68,14 +68,14 @@ class RadioService : MediaBrowserServiceCompat() {
|
68
|
68
|
// This *should* work in any case...
|
69
|
69
|
when (intent.getIntExtra("state", -1)) {
|
70
|
70
|
0 -> {
|
71
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is unplugged")
|
|
71
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is unplugged")
|
72
|
72
|
}
|
73
|
73
|
1 -> {
|
74
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is plugged")
|
|
74
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is plugged")
|
75
|
75
|
headsetPluggedIn = true
|
76
|
76
|
}
|
77
|
77
|
else -> {
|
78
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "I have no idea what the headset state is")
|
|
78
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "I have no idea what the headset state is")
|
79
|
79
|
}
|
80
|
80
|
}
|
81
|
81
|
/*
|
|
@@ -91,7 +91,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
91
|
91
|
}
|
92
|
92
|
else
|
93
|
93
|
{
|
94
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Can't get state?")
|
|
94
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Can't get state?")
|
95
|
95
|
}
|
96
|
96
|
|
97
|
97
|
*/
|
|
@@ -205,7 +205,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
205
|
205
|
startForeground(radioServiceId, nowPlayingNotification.notification)
|
206
|
206
|
|
207
|
207
|
PlayerStore.instance.isServiceStarted.value = true
|
208
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "created")
|
|
208
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "created")
|
209
|
209
|
}
|
210
|
210
|
|
211
|
211
|
private val handler = Handler()
|
|
@@ -246,7 +246,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
246
|
246
|
Actions.CANCEL_FADE_OUT.name -> { handler.removeCallbacks(lowerVolumeRunnable) }
|
247
|
247
|
Actions.SNOOZE.name -> { RadioAlarm.instance.snooze(this) }
|
248
|
248
|
}
|
249
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action"))
|
|
249
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action"))
|
250
|
250
|
super.onStartCommand(intent, flags, startId)
|
251
|
251
|
// The service must be re-created if it is destroyed by the system. This allows the user to keep actions like Bluetooth and headphones plug available.
|
252
|
252
|
return START_STICKY
|
|
@@ -258,7 +258,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
258
|
258
|
stopSelf()
|
259
|
259
|
}
|
260
|
260
|
super.onTaskRemoved(rootIntent)
|
261
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "task removed")
|
|
261
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "task removed")
|
262
|
262
|
}
|
263
|
263
|
|
264
|
264
|
override fun onDestroy() {
|
|
@@ -290,7 +290,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
290
|
290
|
}
|
291
|
291
|
|
292
|
292
|
apiTicker.cancel() // stops the timer.
|
293
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "destroyed")
|
|
293
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "destroyed")
|
294
|
294
|
// if the service is destroyed, the application had become useless.
|
295
|
295
|
exitProcess(0)
|
296
|
296
|
}
|
|
@@ -361,10 +361,10 @@ class RadioService : MediaBrowserServiceCompat() {
|
361
|
361
|
for (i in 0 until it.length()) {
|
362
|
362
|
val entry = it.get(i)
|
363
|
363
|
if (entry is IcyHeaders) {
|
364
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
|
|
364
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
|
365
|
365
|
}
|
366
|
366
|
if (entry is IcyInfo) {
|
367
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
|
|
367
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
|
368
|
368
|
// Note : Kotlin supports UTF-8 by default.
|
369
|
369
|
numberOfSongs++
|
370
|
370
|
val data = entry.title!!
|
|
@@ -439,7 +439,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
439
|
439
|
{
|
440
|
440
|
Thread.sleep(1000)
|
441
|
441
|
i++
|
442
|
|
- //[REMOVE LOG CALLS]Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
|
|
442
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
|
443
|
443
|
}
|
444
|
444
|
}
|
445
|
445
|
val post: (Any?) -> Unit = {
|
|
@@ -512,7 +512,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
512
|
512
|
SystemClock.elapsedRealtime()
|
513
|
513
|
)
|
514
|
514
|
mediaSession.setPlaybackState(playbackStateBuilder.build())
|
515
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
|
|
515
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
|
516
|
516
|
}
|
517
|
517
|
|
518
|
518
|
private fun pausePlaying()
|
|
@@ -541,7 +541,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
541
|
541
|
1.0f,
|
542
|
542
|
SystemClock.elapsedRealtime()
|
543
|
543
|
)
|
544
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "stopped")
|
|
544
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "stopped")
|
545
|
545
|
|
546
|
546
|
mediaSession.setPlaybackState(playbackStateBuilder.build())
|
547
|
547
|
}
|
|
@@ -629,7 +629,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
629
|
629
|
Player.STATE_ENDED -> state = "Player.STATE_ENDED"
|
630
|
630
|
Player.STATE_READY -> state = "Player.STATE_READY"
|
631
|
631
|
}
|
632
|
|
- //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.")
|
|
632
|
+ //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.")
|
633
|
633
|
}
|
634
|
634
|
}
|
635
|
635
|
|