Skip to content

Commit

Permalink
Reduce lines of code
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Oct 30, 2024
1 parent 78efb8a commit 661b0f2
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,8 @@ class ReadingListSyncAdapter(context: Context, params: WorkerParameters) : Corou
}

private fun createForegroundInfo(notification: Notification): ForegroundInfo {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
ForegroundInfo(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
} else {
ForegroundInfo(NOTIFICATION_ID, notification)
}
val type = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC else 0
return ForegroundInfo(NOTIFICATION_ID, notification, type)
}

private fun getNotificationBuilder(
Expand Down

0 comments on commit 661b0f2

Please sign in to comment.