Skip to content

Commit

Permalink
🚨 Fix annoying deprecation issues
Browse files Browse the repository at this point in the history
They were very annoying...
  • Loading branch information
igorescodro committed Oct 12, 2022
1 parent 2e44588 commit cf84b67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ internal class NotificationFlowTest : FlakyTest(), KoinTest {
// Validate the notification info
with(notificationManager!!.activeNotifications.first()) {
assertEquals(id.toInt(), this.id)
assertEquals(name, this.notification.extras[Notification.EXTRA_TEXT])
assertEquals(appName, this.notification.extras[Notification.EXTRA_TITLE])
assertEquals(name, this.notification.extras.getString(Notification.EXTRA_TEXT))
assertEquals(appName, this.notification.extras.getString(Notification.EXTRA_TITLE))
}
}

Expand All @@ -77,7 +77,6 @@ internal class NotificationFlowTest : FlakyTest(), KoinTest {
// Insert a task
val id = 13L
val name = "Click here for a surprise"
val appName = context.getString(com.escodro.core.R.string.app_name)
insertTask(id, name)

// Wait until the notification is launched
Expand Down Expand Up @@ -109,7 +108,7 @@ internal class NotificationFlowTest : FlakyTest(), KoinTest {

// Validate the notification has the updated title
with(notificationManager!!.activeNotifications.first()) {
assertEquals(updatedTitle, this.notification.extras[Notification.EXTRA_TEXT])
assertEquals(updatedTitle, this.notification.extras.getString(Notification.EXTRA_TEXT))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package com.escodro.alkaa.fake

import com.escodro.core.coroutines.CoroutineDebouncer
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

@Suppress("GlobalCoroutineUsage")
internal class CoroutinesDebouncerFake : CoroutineDebouncer {

@OptIn(DelicateCoroutinesApi::class)
override fun invoke(delay: Long, coroutineScope: CoroutineScope, function: suspend () -> Unit) {
GlobalScope.launch { function() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ fun Context.openUrl(url: String) {
*
* @return the version name of the application.
*/
@Suppress("Deprecation") // SDK below Tiramisu needs to access the deprecated version
fun Context.getVersionName(): String {
var packageInfo: PackageInfo? = null
packageName.let {
Expand Down

0 comments on commit cf84b67

Please sign in to comment.