Skip to content

Commit 661b0f2

Browse files
Reduce lines of code
1 parent 78efb8a commit 661b0f2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSyncAdapter.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,8 @@ class ReadingListSyncAdapter(context: Context, params: WorkerParameters) : Corou
470470
}
471471

472472
private fun createForegroundInfo(notification: Notification): ForegroundInfo {
473-
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
474-
ForegroundInfo(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
475-
} else {
476-
ForegroundInfo(NOTIFICATION_ID, notification)
477-
}
473+
val type = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC else 0
474+
return ForegroundInfo(NOTIFICATION_ID, notification, type)
478475
}
479476

480477
private fun getNotificationBuilder(

0 commit comments

Comments
 (0)