Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
add onTaskRemoved function in ScreencastService
Browse files Browse the repository at this point in the history
  • Loading branch information
karkakol committed Apr 23, 2024
1 parent 2a5cd51 commit 0d5b4d8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import android.os.IBinder
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat

// TODO: this is stolen, consider giving some props to livekit team
internal class ScreencastService : Service() {
private var binder: IBinder = ScreencastBinder()
private var bindCount = 0
Expand Down Expand Up @@ -42,6 +41,11 @@ internal class ScreencastService : Service() {
startForeground(notificationId ?: DEFAULT_NOTIFICATION_ID, properNotification)
}

override fun onTaskRemoved(rootIntent: Intent?) {
stopForeground(true)
stopSelf()
}

@RequiresApi(Build.VERSION_CODES.O)
private fun createNotificationChannel() {
val channel =
Expand Down

0 comments on commit 0d5b4d8

Please sign in to comment.