mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-07 18:10:31 +05:30
Remove notification channel creation from BackgroundMode.
This commit is contained in:
parent
269ef10001
commit
9bbdd9e789
@ -1,8 +1,6 @@
|
|||||||
package com.github.libretube.services
|
package com.github.libretube.services
|
||||||
|
|
||||||
import android.app.Notification
|
import android.app.Notification
|
||||||
import android.app.NotificationChannel
|
|
||||||
import android.app.NotificationManager
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Binder
|
import android.os.Binder
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
@ -100,16 +98,8 @@ class BackgroundMode : LifecycleService() {
|
|||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
val channel = NotificationChannel(
|
|
||||||
BACKGROUND_CHANNEL_ID,
|
|
||||||
getString(R.string.background_mode),
|
|
||||||
NotificationManager.IMPORTANCE_DEFAULT
|
|
||||||
)
|
|
||||||
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
|
||||||
notificationManager.createNotificationChannel(channel)
|
|
||||||
|
|
||||||
// see https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)
|
// see https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)
|
||||||
val notification: Notification = Notification.Builder(this, BACKGROUND_CHANNEL_ID)
|
val notification = Notification.Builder(this, BACKGROUND_CHANNEL_ID)
|
||||||
.setContentTitle(getString(R.string.app_name))
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText(getString(R.string.playingOnBackground))
|
.setContentText(getString(R.string.playingOnBackground))
|
||||||
.setSmallIcon(R.drawable.ic_launcher_lockscreen)
|
.setSmallIcon(R.drawable.ic_launcher_lockscreen)
|
||||||
|
Loading…
Reference in New Issue
Block a user