package com.github.libretube.services

import android.app.Service
import android.content.Intent
import android.os.IBinder

class OnClearFromRecentService : Service() {
    override fun onBind(p0: Intent?): IBinder? = null

    override fun onStartCommand(
        intent: Intent?,
        flags: Int,
        startId: Int,
    ): Int {
        return START_NOT_STICKY
    }

    override fun onTaskRemoved(rootIntent: Intent?) {
        // Clearing the UI from Recents must not stop an active media session. The player service
        // owns its foreground notification and decides when playback is actually finished/stopped.
        stopSelf()
    }
}
