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

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
graszka22 committed Jun 14, 2024
1 parent 07ffe5c commit f86eb37
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,15 @@ class CameraService : Service() {
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(mChannel)
}
val notification = NotificationCompat.Builder(this, channelID)
// Create the notification to display while the service is running
.setContentTitle("Fishjam is running")
.build()
val notification =
NotificationCompat.Builder(this, channelID)
// Create the notification to display while the service is running
.setContentTitle("Fishjam is running")
.build()
ServiceCompat.startForeground(
/* service = */
this,
/* id = */
100, // Cannot be 0
/* notification = */
100,
notification,
/* foregroundServiceType = */
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA
} else {
Expand All @@ -68,10 +65,15 @@ class CameraService : Service() {
}
}

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

override fun onBind(intent: Intent): IBinder? {
return null
}
Expand Down

0 comments on commit f86eb37

Please sign in to comment.