Skip to content

Commit 08f51ab

Browse files
Added comments
1 parent ef29c31 commit 08f51ab

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/src/main/java/org/schabi/newpipe/local/feed/notifications/NotificationWorker.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class NotificationWorker(
8585
.setPriority(NotificationCompat.PRIORITY_LOW)
8686
.setContentTitle(applicationContext.getString(R.string.feed_notification_loading))
8787
.build()
88+
// ServiceInfo constants are not used below Android Q, so 0 is set here
8889
val serviceType = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC else 0
8990
setForegroundAsync(ForegroundInfo(FeedLoadService.NOTIFICATION_ID, notification, serviceType))
9091
}

app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public void createNotificationAndStartForeground() {
173173
}
174174
updateNotification();
175175

176+
// ServiceInfo constants are not used below Android Q, so 0 is set here
176177
final int serviceType = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
177178
? ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK : 0;
178179
ServiceCompat.startForeground(player.getService(), NOTIFICATION_ID,

0 commit comments

Comments
 (0)