mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-09-09 22:35:59 +00:00
Added comments
This commit is contained in:
@@ -85,6 +85,7 @@ class NotificationWorker(
|
|||||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||||
.setContentTitle(applicationContext.getString(R.string.feed_notification_loading))
|
.setContentTitle(applicationContext.getString(R.string.feed_notification_loading))
|
||||||
.build()
|
.build()
|
||||||
|
// ServiceInfo constants are not used below Android Q, so 0 is set here
|
||||||
val serviceType = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC else 0
|
val serviceType = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC else 0
|
||||||
setForegroundAsync(ForegroundInfo(FeedLoadService.NOTIFICATION_ID, notification, serviceType))
|
setForegroundAsync(ForegroundInfo(FeedLoadService.NOTIFICATION_ID, notification, serviceType))
|
||||||
}
|
}
|
||||||
|
@@ -173,6 +173,7 @@ public final class NotificationUtil {
|
|||||||
}
|
}
|
||||||
updateNotification();
|
updateNotification();
|
||||||
|
|
||||||
|
// ServiceInfo constants are not used below Android Q, so 0 is set here
|
||||||
final int serviceType = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
|
final int serviceType = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
|
||||||
? ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK : 0;
|
? ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK : 0;
|
||||||
ServiceCompat.startForeground(player.getService(), NOTIFICATION_ID,
|
ServiceCompat.startForeground(player.getService(), NOTIFICATION_ID,
|
||||||
|
Reference in New Issue
Block a user