Skip to content

Commit ea82592

Browse files
committed
Analysis: Resolve deprecated coroutines thread module scope warnings
Warning Messages: "'UI/DEFAULT_SCOPE: String' is deprecated. Implement CoroutineScope interface and cancel all child coroutines in onCleared/onDestroy/.."ª It seems that both, the deprecated named 'UI_SCOPE' and 'DEFAULT_SCOPE' coroutine scopes, that are being provided by the [ThreadModule] module, are no longer being utilized within this codebase and thus, they can be now safely removed. There was no need for any migration either.
1 parent 0ab8933 commit ea82592

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

WordPress/src/main/java/org/wordpress/android/modules/ThreadModule.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ import kotlinx.coroutines.Dispatchers
1010
import org.wordpress.android.util.helpers.Debouncer
1111
import javax.inject.Named
1212

13-
@Deprecated(message = "Implement CoroutineScope interface and cancel all child coroutines in onCleared/onDestroy/..")
14-
const val UI_SCOPE = "UI_SCOPE"
15-
@Deprecated(message = "Implement CoroutineScope interface and cancel all child coroutines in onCleared/onDestroy/..")
16-
const val DEFAULT_SCOPE = "DEFAULT_SCOPE"
1713
const val APPLICATION_SCOPE = "APPLICATION_SCOPE"
1814
const val UI_THREAD = "UI_THREAD"
1915
const val BG_THREAD = "BG_THREAD"
@@ -22,28 +18,12 @@ const val IO_THREAD = "IO_THREAD"
2218
@InstallIn(SingletonComponent::class)
2319
@Module
2420
class ThreadModule {
25-
@Provides
26-
@Named(UI_SCOPE)
27-
fun provideUiScope(): CoroutineScope {
28-
return CoroutineScope(Dispatchers.Main)
29-
}
30-
3121
@Provides
3222
@Named(UI_THREAD)
3323
fun provideUiDispatcher(): CoroutineDispatcher {
3424
return Dispatchers.Main
3525
}
3626

37-
@Provides
38-
@Named(DEFAULT_SCOPE)
39-
@Deprecated(
40-
message = "CoroutineScope should be provided by an object which implements CoroutineScope",
41-
replaceWith = ReplaceWith("Inject dispatcher and implement CoroutineScope interface")
42-
)
43-
fun provideBackgroundScope(): CoroutineScope {
44-
return CoroutineScope(Dispatchers.Default)
45-
}
46-
4727
@Provides
4828
@Named(APPLICATION_SCOPE)
4929
fun provideApplicationScope(): CoroutineScope {

0 commit comments

Comments
 (0)