Skip to content

Commit fece074

Browse files
Suppress NewApi
1 parent b9b47fc commit fece074

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package org.schabi.newpipe.local.feed.notifications
22

33
import android.content.Context
44
import android.content.pm.ServiceInfo
5-
import android.os.Build
65
import android.util.Log
76
import androidx.core.app.NotificationCompat
87
import androidx.work.Constraints
@@ -85,7 +84,8 @@ class NotificationWorker(
8584
.setPriority(NotificationCompat.PRIORITY_LOW)
8685
.setContentTitle(applicationContext.getString(R.string.feed_notification_loading))
8786
.build()
88-
val serviceType = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC else 0
87+
@Suppress("NewApi") // ServiceInfo constant is inlined
88+
val serviceType = ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
8989
setForegroundAsync(ForegroundInfo(FeedLoadService.NOTIFICATION_ID, notification, serviceType))
9090
}
9191

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public boolean shouldUpdateBufferingSlot() {
167167
&& notificationBuilder.mActions.get(2).actionIntent != null);
168168
}
169169

170-
170+
@SuppressLint("NewApi") // ServiceInfo constant is inlined
171171
public void createNotificationAndStartForeground() {
172172
if (notificationBuilder == null) {
173173
notificationBuilder = createNotification();

0 commit comments

Comments
 (0)