Update kotlin-coroutines to 1.3.4
Test: ./gradlew bOS
Change-Id: Icdfe1249e302f2774ca8746ae28d0249a28bc149
diff --git a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
index a3bf24f..a067d51 100644
--- a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
@@ -62,7 +62,7 @@
const val KOTLIN_METADATA = "me.eugeniomarletti.kotlin.metadata:kotlin-metadata:1.4.0"
const val KOTLIN_METADATA_JVM = "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.1.0"
-private const val KOTLIN_COROUTINES_VERSION = "1.3.0"
+private const val KOTLIN_COROUTINES_VERSION = "1.3.4"
const val KOTLIN_COROUTINES_ANDROID =
"org.jetbrains.kotlinx:kotlinx-coroutines-android:$KOTLIN_COROUTINES_VERSION"
const val KOTLIN_COROUTINES_CORE =
diff --git a/concurrent/futures-ktx/src/test/java/androidx/concurrent/futures/ListenableFutureTest.kt b/concurrent/futures-ktx/src/test/java/androidx/concurrent/futures/ListenableFutureTest.kt
index 21a9530..11147a0 100644
--- a/concurrent/futures-ktx/src/test/java/androidx/concurrent/futures/ListenableFutureTest.kt
+++ b/concurrent/futures-ktx/src/test/java/androidx/concurrent/futures/ListenableFutureTest.kt
@@ -18,7 +18,6 @@
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineStart
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
@@ -84,7 +83,6 @@
}
}
- @ExperimentalCoroutinesApi
@Test
fun testAwaitWithCancellation() = runBlockingTest {
val future = ResolvableFuture.create<Int>()
@@ -99,7 +97,6 @@
}
}
- @ExperimentalCoroutinesApi
@Test
fun testCancellableAwait() = runBlocking {
expect(1)
diff --git a/inspection/inspection-testing/src/androidTest/java/androidx/inspection/testing/EchoInspectionTest.kt b/inspection/inspection-testing/src/androidTest/java/androidx/inspection/testing/EchoInspectionTest.kt
index 26db274..460efcc 100644
--- a/inspection/inspection-testing/src/androidTest/java/androidx/inspection/testing/EchoInspectionTest.kt
+++ b/inspection/inspection-testing/src/androidTest/java/androidx/inspection/testing/EchoInspectionTest.kt
@@ -21,7 +21,6 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
@@ -31,7 +30,6 @@
// This test actually tests our InspectorTester infrastructure
@MediumTest
@RunWith(AndroidJUnit4::class)
-@ExperimentalCoroutinesApi
class EchoInspectionTest {
@Test
diff --git a/leanback/leanback/src/androidTest/java/androidx/leanback/widget/ControlBarTest.java b/leanback/leanback/src/androidTest/java/androidx/leanback/widget/ControlBarTest.java
index 1d64d90..d72bbcc 100644
--- a/leanback/leanback/src/androidTest/java/androidx/leanback/widget/ControlBarTest.java
+++ b/leanback/leanback/src/androidTest/java/androidx/leanback/widget/ControlBarTest.java
@@ -38,7 +38,6 @@
@SmallTest
@RunWith(AndroidJUnit4.class)
-
public class ControlBarTest {
@Test
diff --git a/leanback/leanback/src/androidTest/java/androidx/leanback/widget/MediaNowPlayingViewTest.java b/leanback/leanback/src/androidTest/java/androidx/leanback/widget/MediaNowPlayingViewTest.java
index ff1338d..868992d 100644
--- a/leanback/leanback/src/androidTest/java/androidx/leanback/widget/MediaNowPlayingViewTest.java
+++ b/leanback/leanback/src/androidTest/java/androidx/leanback/widget/MediaNowPlayingViewTest.java
@@ -30,7 +30,6 @@
*/
@SmallTest
@RunWith(AndroidJUnit4.class)
-
public class MediaNowPlayingViewTest {
private Context mContext;
diff --git a/leanback/leanback/src/androidTest/java/androidx/leanback/widget/ThumbsBarTest.java b/leanback/leanback/src/androidTest/java/androidx/leanback/widget/ThumbsBarTest.java
index 9a675a6..188c503 100644
--- a/leanback/leanback/src/androidTest/java/androidx/leanback/widget/ThumbsBarTest.java
+++ b/leanback/leanback/src/androidTest/java/androidx/leanback/widget/ThumbsBarTest.java
@@ -34,7 +34,6 @@
@LargeTest
@RunWith(AndroidJUnit4.class)
-
public class ThumbsBarTest {
private Context mContext;
private ThumbsBar mBar;
diff --git a/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleCoroutineScopeAndroidTest.kt b/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleCoroutineScopeAndroidTest.kt
index 0fc0157..77d4db8 100644
--- a/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleCoroutineScopeAndroidTest.kt
+++ b/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleCoroutineScopeAndroidTest.kt
@@ -17,12 +17,10 @@
package androidx.lifecycle
import androidx.test.ext.junit.runners.AndroidJUnit4
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.junit.runner.RunWith
/**
* To ensure consistent behavior, we run these tests both on androidTest and test
*/
-@ExperimentalCoroutinesApi
@RunWith(AndroidJUnit4::class)
class LifecycleCoroutineScopeAndroidTest : LifecycleCoroutineScopeTestBase()
\ No newline at end of file
diff --git a/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleScopeIntegrationTest.kt b/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleScopeIntegrationTest.kt
index b130056..3821ea9 100644
--- a/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleScopeIntegrationTest.kt
+++ b/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleScopeIntegrationTest.kt
@@ -27,7 +27,6 @@
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.async
import kotlinx.coroutines.cancel
@@ -40,7 +39,6 @@
import org.junit.Test
import org.junit.runner.RunWith
-@ExperimentalCoroutinesApi
@LargeTest
@RunWith(AndroidJUnit4::class)
class LifecycleScopeIntegrationTest {
diff --git a/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/LifecycleCoroutineScopeTestBase.kt b/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/LifecycleCoroutineScopeTestBase.kt
index f582ae0..66cade5 100644
--- a/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/LifecycleCoroutineScopeTestBase.kt
+++ b/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/LifecycleCoroutineScopeTestBase.kt
@@ -19,7 +19,6 @@
import androidx.lifecycle.testing.TestLifecycleOwner
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.async
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
@@ -30,7 +29,6 @@
import org.junit.Test
import java.util.concurrent.CancellationException
-@ExperimentalCoroutinesApi
abstract class LifecycleCoroutineScopeTestBase {
@Test
fun initialization() {
diff --git a/lifecycle/integration-tests/kotlintestapp/src/test/java/androidx/lifecycle/LifecycleCoroutineScopeTest.kt b/lifecycle/integration-tests/kotlintestapp/src/test/java/androidx/lifecycle/LifecycleCoroutineScopeTest.kt
index fbf948e..8eaae40 100644
--- a/lifecycle/integration-tests/kotlintestapp/src/test/java/androidx/lifecycle/LifecycleCoroutineScopeTest.kt
+++ b/lifecycle/integration-tests/kotlintestapp/src/test/java/androidx/lifecycle/LifecycleCoroutineScopeTest.kt
@@ -17,7 +17,6 @@
package androidx.lifecycle
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.setMain
@@ -31,7 +30,6 @@
/**
* To ensure consistent behavior, we run these tests both on androidTest and test
*/
-@ExperimentalCoroutinesApi
@RunWith(JUnit4::class)
class LifecycleCoroutineScopeTest : LifecycleCoroutineScopeTestBase() {
private val mainExecutor = Executors.newSingleThreadExecutor()
diff --git a/lifecycle/lifecycle-livedata-core-ktx/src/test/java/androidx/lifecycle/LiveDataTest.kt b/lifecycle/lifecycle-livedata-core-ktx/src/test/java/androidx/lifecycle/LiveDataTest.kt
index d777ee7..c264829 100644
--- a/lifecycle/lifecycle-livedata-core-ktx/src/test/java/androidx/lifecycle/LiveDataTest.kt
+++ b/lifecycle/lifecycle-livedata-core-ktx/src/test/java/androidx/lifecycle/LiveDataTest.kt
@@ -19,7 +19,6 @@
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.lifecycle.testing.TestLifecycleOwner
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineDispatcher
import org.junit.Rule
import org.junit.Test
@@ -29,7 +28,6 @@
@get:Rule
val mInstantTaskExecutorRule = InstantTaskExecutorRule()
- @ExperimentalCoroutinesApi
@Test
fun observe() {
val lifecycleOwner = TestLifecycleOwner(coroutineDispatcher = TestCoroutineDispatcher())
diff --git a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/BuildLiveDataTest.kt b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/BuildLiveDataTest.kt
index b692804..e23b763 100644
--- a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/BuildLiveDataTest.kt
+++ b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/BuildLiveDataTest.kt
@@ -19,7 +19,6 @@
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineExceptionHandler
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
@@ -34,7 +33,6 @@
import java.util.concurrent.atomic.AtomicReference
import kotlin.coroutines.coroutineContext
-@ExperimentalCoroutinesApi
@RunWith(JUnit4::class)
class BuildLiveDataTest {
@get:Rule
diff --git a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/FlowAsLiveDataTest.kt b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/FlowAsLiveDataTest.kt
index d12c446..d46b44fb 100644
--- a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/FlowAsLiveDataTest.kt
+++ b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/FlowAsLiveDataTest.kt
@@ -19,7 +19,6 @@
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineExceptionHandler
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.cancel
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.delay
@@ -36,7 +35,6 @@
import java.util.concurrent.atomic.AtomicBoolean
import kotlin.coroutines.coroutineContext
-@ExperimentalCoroutinesApi
@RunWith(JUnit4::class)
class FlowAsLiveDataTest {
@get:Rule
diff --git a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/LiveDataAsFlowTest.kt b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/LiveDataAsFlowTest.kt
index bd7bc0e..6e2f7c6 100644
--- a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/LiveDataAsFlowTest.kt
+++ b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/LiveDataAsFlowTest.kt
@@ -17,7 +17,6 @@
package androidx.lifecycle
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.first
@@ -29,7 +28,6 @@
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
-@ExperimentalCoroutinesApi
@RunWith(JUnit4::class)
class LiveDataAsFlowTest {
@get:Rule
diff --git a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/ScopesRule.kt b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/ScopesRule.kt
index 9d96fb7..c611d1d 100644
--- a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/ScopesRule.kt
+++ b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/ScopesRule.kt
@@ -20,7 +20,6 @@
import androidx.arch.core.executor.TaskExecutor
import com.google.common.truth.Truth
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
@@ -31,7 +30,6 @@
import org.junit.rules.TestWatcher
import org.junit.runner.Description
-@ExperimentalCoroutinesApi
class ScopesRule : TestWatcher() {
private val mainDispatcher = TestCoroutineDispatcher()
val mainScope = TestCoroutineScope(mainDispatcher)
@@ -113,7 +111,6 @@
}
}
-@ExperimentalCoroutinesApi
fun <T> LiveData<T>.addObserver(scopes: ScopesRule): CollectingObserver<T> {
return scopes.runOnMain {
val observer = CollectingObserver(this, scopes)
@@ -122,7 +119,6 @@
}
}
-@ExperimentalCoroutinesApi
class CollectingObserver<T>(
private val liveData: LiveData<T>,
private val scopes: ScopesRule
diff --git a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/TransformationsTest.kt b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/TransformationsTest.kt
index 82b03da..b3c6ed6 100644
--- a/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/TransformationsTest.kt
+++ b/lifecycle/lifecycle-livedata-ktx/src/test/java/androidx/lifecycle/TransformationsTest.kt
@@ -19,12 +19,10 @@
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.lifecycle.testing.TestLifecycleOwner
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineDispatcher
import org.junit.Rule
import org.junit.Test
-@ExperimentalCoroutinesApi
class TransformationsTest {
@get:Rule
diff --git a/lifecycle/lifecycle-reactivestreams-ktx/src/test/java/androidx/lifecycle/LiveDataReactiveStreamsTest.kt b/lifecycle/lifecycle-reactivestreams-ktx/src/test/java/androidx/lifecycle/LiveDataReactiveStreamsTest.kt
index 3741dd0..d6233a9 100644
--- a/lifecycle/lifecycle-reactivestreams-ktx/src/test/java/androidx/lifecycle/LiveDataReactiveStreamsTest.kt
+++ b/lifecycle/lifecycle-reactivestreams-ktx/src/test/java/androidx/lifecycle/LiveDataReactiveStreamsTest.kt
@@ -21,7 +21,6 @@
import com.google.common.truth.Truth.assertThat
import io.reactivex.processors.PublishProcessor
import io.reactivex.processors.ReplayProcessor
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineDispatcher
import org.junit.Before
import org.junit.Rule
@@ -32,7 +31,6 @@
private lateinit var lifecycleOwner: LifecycleOwner
- @ExperimentalCoroutinesApi
@Before fun init() {
lifecycleOwner = TestLifecycleOwner(coroutineDispatcher = TestCoroutineDispatcher())
}
diff --git a/lifecycle/lifecycle-runtime-ktx/src/androidTest/java/androidx/lifecycle/PausingDispatcherTest.kt b/lifecycle/lifecycle-runtime-ktx/src/androidTest/java/androidx/lifecycle/PausingDispatcherTest.kt
index d985133..e8b67e7e 100644
--- a/lifecycle/lifecycle-runtime-ktx/src/androidTest/java/androidx/lifecycle/PausingDispatcherTest.kt
+++ b/lifecycle/lifecycle-runtime-ktx/src/androidTest/java/androidx/lifecycle/PausingDispatcherTest.kt
@@ -24,7 +24,6 @@
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.asCoroutineDispatcher
@@ -71,7 +70,6 @@
private val expectations = Expectations()
private lateinit var mainThread: Thread
- @ExperimentalCoroutinesApi
@Before
fun updateMainHandlerAndDispatcher() {
Dispatchers.setMain(mainExecutor.asCoroutineDispatcher())
@@ -81,7 +79,6 @@
}
}
- @ExperimentalCoroutinesApi
@After
fun clearHandlerAndDispatcher() {
waitTestingScopeChildren()
diff --git a/lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/DispatchQueue.kt b/lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/DispatchQueue.kt
index 79b46c5..d9813be 100644
--- a/lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/DispatchQueue.kt
+++ b/lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/DispatchQueue.kt
@@ -20,7 +20,6 @@
import androidx.annotation.AnyThread
import androidx.annotation.MainThread
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import java.util.ArrayDeque
import java.util.Queue
import kotlin.coroutines.EmptyCoroutineContext
@@ -84,7 +83,6 @@
private fun canRun() = finished || !paused
@AnyThread
- @ExperimentalCoroutinesApi
@SuppressLint("WrongThread") // false negative, we are checking the thread
fun runOrEnqueue(runnable: Runnable) {
with(Dispatchers.Main.immediate) {
diff --git a/lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/PausingDispatcher.kt b/lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/PausingDispatcher.kt
index b89f701..592afe7 100644
--- a/lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/PausingDispatcher.kt
+++ b/lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/PausingDispatcher.kt
@@ -19,7 +19,6 @@
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.Runnable
import kotlinx.coroutines.withContext
@@ -179,7 +178,6 @@
@JvmField
internal val dispatchQueue = DispatchQueue()
- @ExperimentalCoroutinesApi
override fun dispatch(context: CoroutineContext, block: Runnable) {
dispatchQueue.runOrEnqueue(block)
}
diff --git a/lifecycle/lifecycle-runtime-testing/src/test/java/androidx/lifecycle/testing/LifecycleRegistryTest.kt b/lifecycle/lifecycle-runtime-testing/src/test/java/androidx/lifecycle/testing/LifecycleRegistryTest.kt
index 628230d..93a4c78 100644
--- a/lifecycle/lifecycle-runtime-testing/src/test/java/androidx/lifecycle/testing/LifecycleRegistryTest.kt
+++ b/lifecycle/lifecycle-runtime-testing/src/test/java/androidx/lifecycle/testing/LifecycleRegistryTest.kt
@@ -19,13 +19,11 @@
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineDispatcher
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
-@ExperimentalCoroutinesApi
@RunWith(JUnit4::class)
class LifecycleRegistryTest {
private val lifecycleOwner = TestLifecycleOwner(Lifecycle.State.INITIALIZED,
diff --git a/paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt b/paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt
index 61706529..6f904f6 100644
--- a/paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/CachedPageEventFlow.kt
@@ -19,8 +19,6 @@
import androidx.annotation.VisibleForTesting
import androidx.paging.multicast.Multicaster
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.ClosedSendChannelException
import kotlinx.coroutines.flow.Flow
@@ -40,8 +38,6 @@
* An intermediate flow producer that flattens previous page events and gives any new downstream
* just those events instead of the full history.
*/
-@UseExperimental(ExperimentalCoroutinesApi::class)
-@FlowPreview
internal class CachedPageEventFlow<T : Any>(
src: Flow<PageEvent<T>>,
scope: CoroutineScope
@@ -118,7 +114,6 @@
*
* Each value is indexed to avoid sending the same event multiple times.
*/
-@FlowPreview
private class TemporaryDownstream<T : Any> {
/**
* List of events that sync us to current state + any other events that might arrive while
@@ -146,7 +141,6 @@
}
}
-@FlowPreview
private class FlattenedPageController<T : Any> {
private val list = FlattenedPageEventStorage<T>()
private var snapshots = listOf<TemporaryDownstream<T>>()
diff --git a/paging/common/src/main/kotlin/androidx/paging/CachedPagingData.kt b/paging/common/src/main/kotlin/androidx/paging/CachedPagingData.kt
index 927c00a..f134aca 100644
--- a/paging/common/src/main/kotlin/androidx/paging/CachedPagingData.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/CachedPagingData.kt
@@ -22,8 +22,6 @@
import androidx.paging.ActiveFlowTracker.FlowType.PAGE_EVENT_FLOW
import androidx.paging.multicast.Multicaster
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapNotNull
@@ -31,7 +29,6 @@
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.scan
-@UseExperimental(ExperimentalCoroutinesApi::class, FlowPreview::class)
private class MulticastedPagingData<T : Any>(
val scope: CoroutineScope,
val parent: PagingData<T>,
@@ -52,7 +49,6 @@
receiver = parent.receiver
)
- @FlowPreview
suspend fun close() = accumulated.close()
}
@@ -80,7 +76,6 @@
scope: CoroutineScope
) = cachedIn(scope, null)
-@UseExperimental(ExperimentalCoroutinesApi::class, FlowPreview::class)
internal fun <T : Any> Flow<PagingData<T>>.cachedIn(
scope: CoroutineScope,
// used in tests
diff --git a/paging/common/src/main/kotlin/androidx/paging/CancelableChannelFlow.kt b/paging/common/src/main/kotlin/androidx/paging/CancelableChannelFlow.kt
index 641f0ef..e95c7f5 100644
--- a/paging/common/src/main/kotlin/androidx/paging/CancelableChannelFlow.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/CancelableChannelFlow.kt
@@ -16,14 +16,13 @@
package androidx.paging
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.ProducerScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.channelFlow
import kotlin.experimental.ExperimentalTypeInference
-@UseExperimental(ExperimentalTypeInference::class, ExperimentalCoroutinesApi::class)
+@UseExperimental(ExperimentalTypeInference::class)
internal fun <T> cancelableChannelFlow(
controller: Job,
@BuilderInference block: suspend ProducerScope<T>.() -> Unit
diff --git a/paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt b/paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
index b9b97eb..c8f1629 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
@@ -16,8 +16,6 @@
package androidx.paging
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.channels.ConflatedBroadcastChannel
import kotlinx.coroutines.flow.asFlow
import kotlinx.coroutines.flow.filterNotNull
@@ -25,7 +23,6 @@
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.scan
-@UseExperimental(ExperimentalCoroutinesApi::class)
internal class PageFetcher<Key : Any, Value : Any>(
private val pagingSourceFactory: () -> PagingSource<Key, Value>,
private val initialKey: Key?,
@@ -38,7 +35,6 @@
// The object built by paging builder can maintain the scope so that on rotation we don't stop
// the paging.
- @UseExperimental(FlowPreview::class)
val flow = refreshChannel
.asFlow()
.onStart { emit(Unit) }
diff --git a/paging/common/src/main/kotlin/androidx/paging/Pager.kt b/paging/common/src/main/kotlin/androidx/paging/Pager.kt
index 9de524c..43fad8c 100644
--- a/paging/common/src/main/kotlin/androidx/paging/Pager.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/Pager.kt
@@ -27,8 +27,6 @@
import androidx.paging.PagingSource.LoadParams
import androidx.paging.PagingSource.LoadResult
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.BroadcastChannel
import kotlinx.coroutines.channels.Channel
@@ -55,7 +53,6 @@
* of [Pager] and its corresponding [PagerState] should be launched within a scope that is
* cancelled when [PagingSource.invalidate] is called.
*/
-@UseExperimental(ExperimentalCoroutinesApi::class, FlowPreview::class)
internal class Pager<Key : Any, Value : Any>(
internal val initialKey: Key?,
internal val pagingSource: PagingSource<Key, Value>,
diff --git a/paging/common/src/main/kotlin/androidx/paging/PagerState.kt b/paging/common/src/main/kotlin/androidx/paging/PagerState.kt
index 510bbaa..fa39b43 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PagerState.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PagerState.kt
@@ -25,8 +25,6 @@
import androidx.paging.PageEvent.Insert.Companion.Start
import androidx.paging.PagingSource.LoadResult.Page
import androidx.paging.PagingSource.LoadResult.Page.Companion.COUNT_UNDEFINED
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.consumeAsFlow
@@ -36,7 +34,6 @@
/**
* Internal state of [Pager] whose updates can be consumed as a [Flow]<[PageEvent]<[Value]>>.
*/
-@UseExperimental(ExperimentalCoroutinesApi::class, FlowPreview::class)
internal class PagerState<Key : Any, Value : Any>(
private val pageSize: Int,
private val maxSize: Int
diff --git a/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt b/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
index 615658a..7413a99 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
@@ -19,7 +19,6 @@
import androidx.annotation.RestrictTo
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.withContext
import kotlinx.coroutines.yield
@@ -51,7 +50,6 @@
open fun postEvents(): Boolean = false
- @UseExperimental(ExperimentalCoroutinesApi::class)
suspend fun collectFrom(pagingData: PagingData<T>, callback: PresenterCallback) {
check(collecting.compareAndSet(false, true)) {
"Collecting from multiple PagingData concurrently is an illegal operation."
diff --git a/paging/common/src/main/kotlin/androidx/paging/multicast/ChannelManager.kt b/paging/common/src/main/kotlin/androidx/paging/multicast/ChannelManager.kt
index c32d277..4bce9d5 100644
--- a/paging/common/src/main/kotlin/androidx/paging/multicast/ChannelManager.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/multicast/ChannelManager.kt
@@ -19,7 +19,6 @@
import androidx.paging.multicast.ChannelManager.Message
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.flow.Flow
import java.util.ArrayDeque
@@ -34,7 +33,6 @@
* is no active upstream and there's at least one downstream that has not received a value.
*
*/
-@ExperimentalCoroutinesApi
internal class ChannelManager<T>(
/**
* The scope in which ChannelManager actor runs
@@ -346,7 +344,6 @@
/**
* Buffer implementation for any late arrivals.
*/
-@ExperimentalCoroutinesApi
private interface Buffer<T> {
fun add(item: ChannelManager.Message.Dispatch.Value<T>)
fun isEmpty() = items.isEmpty()
@@ -356,7 +353,6 @@
/**
* Default implementation of buffer which does not buffer anything.
*/
-@ExperimentalCoroutinesApi
private class NoBuffer<T> : Buffer<T> {
override val items: Collection<ChannelManager.Message.Dispatch.Value<T>>
get() = Collections.emptyList()
@@ -369,7 +365,6 @@
* Create a new buffer insteance based on the provided limit.
*/
@Suppress("FunctionName")
-@ExperimentalCoroutinesApi
private fun <T> Buffer(limit: Int): Buffer<T> = if (limit > 0) {
BufferImpl(limit)
} else {
@@ -379,7 +374,6 @@
/**
* A real buffer implementation that has a FIFO queue.
*/
-@ExperimentalCoroutinesApi
private class BufferImpl<T>(private val limit: Int) :
Buffer<T> {
override val items =
@@ -393,6 +387,5 @@
}
}
-@ExperimentalCoroutinesApi
internal fun <T> ChannelManager.Message.Dispatch.Value<T>.markDelivered() =
delivered.complete(Unit)
diff --git a/paging/common/src/main/kotlin/androidx/paging/multicast/Multicaster.kt b/paging/common/src/main/kotlin/androidx/paging/multicast/Multicaster.kt
index 1556137..9196062 100644
--- a/paging/common/src/main/kotlin/androidx/paging/multicast/Multicaster.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/multicast/Multicaster.kt
@@ -17,8 +17,6 @@
package androidx.paging.multicast
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.consumeAsFlow
@@ -33,8 +31,6 @@
* It has one store specific behavior where upstream flow is suspended until at least 1 downstream
* flow emits the value to ensure we don't abuse the upstream flow of downstream cannot keep up.
*/
-@FlowPreview
-@ExperimentalCoroutinesApi
internal class Multicaster<T>(
/**
* The [CoroutineScope] to use for upstream subscription
diff --git a/paging/common/src/main/kotlin/androidx/paging/multicast/SharedFlowProducer.kt b/paging/common/src/main/kotlin/androidx/paging/multicast/SharedFlowProducer.kt
index 3c1a6ca..81b4b99 100644
--- a/paging/common/src/main/kotlin/androidx/paging/multicast/SharedFlowProducer.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/multicast/SharedFlowProducer.kt
@@ -18,7 +18,6 @@
import androidx.paging.multicast.ChannelManager.Message.Dispatch.UpstreamFinished
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.channels.ClosedSendChannelException
@@ -37,7 +36,6 @@
* Cancellation of the collection might be triggered by both this producer (e.g. upstream completes)
* or the [ChannelManager] (e.g. all active collectors complete).
*/
-@ExperimentalCoroutinesApi
internal class SharedFlowProducer<T>(
private val scope: CoroutineScope,
private val src: Flow<T>,
diff --git a/paging/common/src/main/kotlin/androidx/paging/multicast/StoreRealActor.kt b/paging/common/src/main/kotlin/androidx/paging/multicast/StoreRealActor.kt
index 7a33e57..30fec47e 100644
--- a/paging/common/src/main/kotlin/androidx/paging/multicast/StoreRealActor.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/multicast/StoreRealActor.kt
@@ -17,7 +17,6 @@
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.channels.actor
import java.util.concurrent.atomic.AtomicBoolean
@@ -26,8 +25,6 @@
* Simple actor implementation abstracting away Coroutine.actor since it is deprecated.
* It also enforces a 0 capacity buffer.
*/
-@Suppress("EXPERIMENTAL_API_USAGE")
-@ExperimentalCoroutinesApi
internal abstract class StoreRealActor<T>(
scope: CoroutineScope
) {
diff --git a/paging/common/src/test/kotlin/androidx/paging/CachedPageEventFlowTest.kt b/paging/common/src/test/kotlin/androidx/paging/CachedPageEventFlowTest.kt
index 1612597..75ddc03 100644
--- a/paging/common/src/test/kotlin/androidx/paging/CachedPageEventFlowTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/CachedPageEventFlowTest.kt
@@ -21,8 +21,6 @@
import androidx.paging.PageEvent.Insert.Companion.Start
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.Flow
@@ -35,8 +33,6 @@
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
-@FlowPreview
-@UseExperimental(ExperimentalCoroutinesApi::class)
@RunWith(JUnit4::class)
class CachedPageEventFlowTest {
private val testScope = TestCoroutineScope()
diff --git a/paging/common/src/test/kotlin/androidx/paging/CachingTest.kt b/paging/common/src/test/kotlin/androidx/paging/CachingTest.kt
index 188e514..113bcfa 100644
--- a/paging/common/src/test/kotlin/androidx/paging/CachingTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/CachingTest.kt
@@ -22,8 +22,6 @@
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancelAndJoin
@@ -46,8 +44,6 @@
import org.junit.runners.JUnit4
import java.util.concurrent.atomic.AtomicInteger
-@FlowPreview
-@ExperimentalCoroutinesApi
@RunWith(JUnit4::class)
class CachingTest {
private val testScope = TestCoroutineScope()
diff --git a/paging/common/src/test/kotlin/androidx/paging/HeaderFooterTest.kt b/paging/common/src/test/kotlin/androidx/paging/HeaderFooterTest.kt
index e2fcd02..fa2ff77 100644
--- a/paging/common/src/test/kotlin/androidx/paging/HeaderFooterTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/HeaderFooterTest.kt
@@ -24,7 +24,6 @@
import androidx.paging.PageEvent.Insert.Companion.End
import androidx.paging.PageEvent.Insert.Companion.Refresh
import androidx.paging.PageEvent.Insert.Companion.Start
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineScope
import kotlinx.coroutines.test.runBlockingTest
import org.junit.Test
@@ -32,7 +31,6 @@
import org.junit.runners.JUnit4
import kotlin.test.assertEquals
-@UseExperimental(ExperimentalCoroutinesApi::class)
@RunWith(JUnit4::class)
class HeaderFooterTest {
private val testScope = TestCoroutineScope()
diff --git a/paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt b/paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
index 9982989..533b4a7f 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
@@ -18,8 +18,6 @@
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.ClosedSendChannelException
@@ -39,8 +37,6 @@
import kotlin.test.assertNotEquals
import kotlin.test.assertTrue
-@FlowPreview
-@ExperimentalCoroutinesApi
@InternalCoroutinesApi
@RunWith(JUnit4::class)
class PageFetcherTest {
@@ -220,8 +216,6 @@
val job: Job
)
-@FlowPreview
-@ExperimentalCoroutinesApi
internal fun CoroutineScope.collectFetcherState(fetcher: PageFetcher<Int, Int>): FetcherState<Int> {
val pagingDataList: ArrayList<PagingData<Int>> = ArrayList()
val pageEventLists: ArrayList<ArrayList<PageEvent<Int>>> = ArrayList()
diff --git a/paging/common/src/test/kotlin/androidx/paging/PagerStateTest.kt b/paging/common/src/test/kotlin/androidx/paging/PagerStateTest.kt
index f21d667..52f724b7 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PagerStateTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PagerStateTest.kt
@@ -20,8 +20,6 @@
import androidx.paging.LoadType.REFRESH
import androidx.paging.LoadType.START
import androidx.paging.PagingSource.LoadResult.Page
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.test.TestCoroutineScope
import kotlinx.coroutines.test.runBlockingTest
import org.junit.Test
@@ -29,8 +27,6 @@
import org.junit.runners.JUnit4
import kotlin.test.assertEquals
-@FlowPreview
-@ExperimentalCoroutinesApi
@RunWith(JUnit4::class)
class PagerStateTest {
private val testScope = TestCoroutineScope()
diff --git a/paging/common/src/test/kotlin/androidx/paging/PagerTest.kt b/paging/common/src/test/kotlin/androidx/paging/PagerTest.kt
index 7eab50e..407a5a8 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PagerTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PagerTest.kt
@@ -31,8 +31,6 @@
import androidx.paging.PagingSource.LoadResult.Page
import androidx.paging.TestPagingSource.Companion.LOAD_ERROR
import androidx.paging.TestPagingSource.Companion.items
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collect
@@ -48,8 +46,6 @@
import kotlin.test.assertTrue
import kotlin.test.fail
-@FlowPreview
-@ExperimentalCoroutinesApi
@InternalCoroutinesApi
@RunWith(JUnit4::class)
class PagerTest {
diff --git a/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt b/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
index f2b0171..9fb01c3 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
@@ -18,8 +18,6 @@
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.launch
import kotlinx.coroutines.suspendCancellableCoroutine
@@ -37,7 +35,6 @@
import kotlin.test.assertFalse
@RunWith(JUnit4::class)
-@UseExperimental(ExperimentalCoroutinesApi::class)
class PagingDataDifferTest {
private val testScope = TestCoroutineScope()
@@ -54,7 +51,6 @@
}
@Test
- @UseExperimental(FlowPreview::class)
fun collectFrom_static() = testScope.runBlockingTest {
pauseDispatcher {
val differ = SimpleDiffer()
@@ -99,7 +95,6 @@
}
@Test
- @UseExperimental(FlowPreview::class)
fun collectFrom_twice() = testScope.runBlockingTest {
val differ = SimpleDiffer()
@@ -110,7 +105,6 @@
}
@Test
- @UseExperimental(FlowPreview::class)
fun collectFrom_twiceConcurrently() = testScope.runBlockingTest {
val differ = SimpleDiffer()
diff --git a/paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt b/paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt
index 85c4166..e2d9173 100644
--- a/paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt
@@ -25,7 +25,6 @@
import androidx.paging.PageEvent.Insert.Companion.End
import androidx.paging.PageEvent.Insert.Companion.Refresh
import androidx.paging.PageEvent.Insert.Companion.Start
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.toList
import kotlinx.coroutines.test.runBlockingTest
@@ -75,7 +74,6 @@
)
}
-@ExperimentalCoroutinesApi
@RunWith(JUnit4::class)
class SeparatorsTest {
@Test
diff --git a/paging/runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt b/paging/runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt
index 21fe0d7..aff568c 100644
--- a/paging/runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt
+++ b/paging/runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt
@@ -33,7 +33,6 @@
import androidx.testutils.MainDispatcherRule
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
@@ -83,7 +82,6 @@
@SmallTest
@RunWith(JUnit4::class)
-@UseExperimental(ExperimentalCoroutinesApi::class)
class AsyncPagingDataDifferTest {
private val testScope = TestCoroutineScope()
diff --git a/paging/runtime/src/androidTest/java/androidx/paging/LivePagedListBuilderTest.kt b/paging/runtime/src/androidTest/java/androidx/paging/LivePagedListBuilderTest.kt
index 13b0d53..90435cb 100644
--- a/paging/runtime/src/androidTest/java/androidx/paging/LivePagedListBuilderTest.kt
+++ b/paging/runtime/src/androidTest/java/androidx/paging/LivePagedListBuilderTest.kt
@@ -29,7 +29,6 @@
import androidx.testutils.TestDispatcher
import androidx.testutils.TestExecutor
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Runnable
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.setMain
@@ -45,7 +44,6 @@
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
-@ExperimentalCoroutinesApi
@SmallTest
@RunWith(JUnit4::class)
class LivePagedListBuilderTest {
@@ -77,7 +75,6 @@
lifecycleOwner.handleLifecycleEvent(Lifecycle.Event.ON_START)
}
- @ExperimentalCoroutinesApi
@After
fun teardown() {
lifecycleOwner.handleLifecycleEvent(Lifecycle.Event.ON_STOP)
diff --git a/paging/samples/src/main/java/androidx/paging/samples/CachedInSample.kt b/paging/samples/src/main/java/androidx/paging/samples/CachedInSample.kt
index 9ffd45a..cf525f5 100644
--- a/paging/samples/src/main/java/androidx/paging/samples/CachedInSample.kt
+++ b/paging/samples/src/main/java/androidx/paging/samples/CachedInSample.kt
@@ -30,7 +30,6 @@
import androidx.paging.PagingDataFlow
import androidx.paging.PagingSource
import androidx.paging.cachedIn
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
@@ -40,7 +39,6 @@
private class MyViewModel : BaseViewModel<UiModel>()
private lateinit var pagingSourceFactory: () -> PagingSource<String, String>
-@ExperimentalCoroutinesApi
@Sampled
@SuppressLint("SyntheticAccessor")
fun cachedInSample() {
diff --git a/paging/samples/src/main/java/androidx/paging/samples/PagingDataAdapterSample.kt b/paging/samples/src/main/java/androidx/paging/samples/PagingDataAdapterSample.kt
index 1a924de..5822642 100644
--- a/paging/samples/src/main/java/androidx/paging/samples/PagingDataAdapterSample.kt
+++ b/paging/samples/src/main/java/androidx/paging/samples/PagingDataAdapterSample.kt
@@ -31,7 +31,6 @@
import androidx.recyclerview.widget.RecyclerView
import io.reactivex.Flowable
import io.reactivex.disposables.CompositeDisposable
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
@@ -82,7 +81,6 @@
internal class UserPagingAdapter : BasePagingAdapter<User>()
internal class UserListViewModel : BaseViewModel<User>()
-@ExperimentalCoroutinesApi
@Sampled
fun presentDataSample() {
class MyFlowActivity : AppCompatActivity() {
@@ -104,7 +102,6 @@
}
}
-@ExperimentalCoroutinesApi
@Sampled
fun submitDataLiveDataSample() {
class MyLiveDataActivity : AppCompatActivity() {
@@ -127,7 +124,6 @@
throw NotImplementedError()
}
-@ExperimentalCoroutinesApi
@Sampled
fun submitDataRxSample() {
class MyRxJava2Activity : AppCompatActivity() {
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/NewThreadDispatcher.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/NewThreadDispatcher.kt
index 9b5b6b6..376823b 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/NewThreadDispatcher.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/NewThreadDispatcher.kt
@@ -17,7 +17,6 @@
package androidx.room.integration.kotlintestapp
import kotlinx.coroutines.CoroutineDispatcher
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.Runnable
import java.util.concurrent.atomic.AtomicInteger
@@ -34,7 +33,6 @@
super.dispatchYield(context, block)
}
- @ExperimentalCoroutinesApi
override fun isDispatchNeeded(context: CoroutineContext) = true
override fun dispatch(context: CoroutineContext, block: Runnable) {
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/FlowQueryTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/FlowQueryTest.kt
index 2753b3d..8e75635 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/FlowQueryTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/FlowQueryTest.kt
@@ -21,8 +21,6 @@
import androidx.test.filters.MediumTest
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.async
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.channels.Channel
@@ -41,8 +39,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@FlowPreview
-@ExperimentalCoroutinesApi
class FlowQueryTest : TestDatabaseTest() {
@After
diff --git a/room/ktx/src/androidTest/java/androidx/room/CoroutineRoomCancellationTest.kt b/room/ktx/src/androidTest/java/androidx/room/CoroutineRoomCancellationTest.kt
index b340852..03f9503 100644
--- a/room/ktx/src/androidTest/java/androidx/room/CoroutineRoomCancellationTest.kt
+++ b/room/ktx/src/androidTest/java/androidx/room/CoroutineRoomCancellationTest.kt
@@ -23,7 +23,6 @@
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.launch
@@ -38,7 +37,6 @@
@SmallTest
@SdkSuppress(minSdkVersion = 16)
-@ExperimentalCoroutinesApi
class CoroutineRoomCancellationTest {
private val testDispatcher = TestCoroutineDispatcher()
diff --git a/room/ktx/src/test/java/androidx/room/CoroutinesRoomTest.kt b/room/ktx/src/test/java/androidx/room/CoroutinesRoomTest.kt
index ad1841f..086b217 100644
--- a/room/ktx/src/test/java/androidx/room/CoroutinesRoomTest.kt
+++ b/room/ktx/src/test/java/androidx/room/CoroutinesRoomTest.kt
@@ -19,7 +19,6 @@
import androidx.sqlite.db.SupportSQLiteOpenHelper
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.async
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.flow.single
@@ -31,7 +30,6 @@
import java.util.concurrent.Callable
import kotlin.coroutines.ContinuationInterceptor
-@FlowPreview
@RunWith(JUnit4::class)
class CoroutinesRoomTest {
diff --git a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/BasicTest.kt b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/BasicTest.kt
index 778bfa8..5bde00f 100644
--- a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/BasicTest.kt
+++ b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/BasicTest.kt
@@ -20,7 +20,6 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
import org.junit.Rule
import org.junit.Test
@@ -28,7 +27,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@ExperimentalCoroutinesApi
class BasicTest {
@get:Rule
val testEnvironment = SqliteInspectorTestEnvironment()
diff --git a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/GetSchemaTest.kt b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/GetSchemaTest.kt
index 96af14a..c92d817 100644
--- a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/GetSchemaTest.kt
+++ b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/GetSchemaTest.kt
@@ -24,7 +24,6 @@
import androidx.test.filters.SdkSuppress
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
import org.junit.Rule
import org.junit.Test
@@ -33,7 +32,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@ExperimentalCoroutinesApi
@SdkSuppress(minSdkVersion = 26)
class GetSchemaTest {
@get:Rule
diff --git a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/QueryTest.kt b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/QueryTest.kt
index ea6b2d6..9865303 100644
--- a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/QueryTest.kt
+++ b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/QueryTest.kt
@@ -27,7 +27,6 @@
import androidx.test.filters.SdkSuppress
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
import org.junit.Assert.fail
import org.junit.ComparisonFailure
@@ -38,7 +37,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@ExperimentalCoroutinesApi
@SdkSuppress(minSdkVersion = 26)
// TODO: add tests for invalid queries: union of unequal number of columns, syntax error, etc.
class QueryTest {
diff --git a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/SqliteInspectorTestEnvironment.kt b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/SqliteInspectorTestEnvironment.kt
index 7db63a6..649be0a 100644
--- a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/SqliteInspectorTestEnvironment.kt
+++ b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/SqliteInspectorTestEnvironment.kt
@@ -24,7 +24,6 @@
import androidx.sqlite.inspection.SqliteInspectorProtocol.Event
import androidx.sqlite.inspection.SqliteInspectorProtocol.Response
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
import org.junit.rules.ExternalResource
@@ -43,7 +42,6 @@
inspectorTester.dispose()
}
- @ExperimentalCoroutinesApi
fun assertNoQueuedEvents() {
assertThat(inspectorTester.channel.isEmpty).isTrue()
}
diff --git a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/TrackDatabasesTest.kt b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/TrackDatabasesTest.kt
index b6a1d50..7f31e47 100644
--- a/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/TrackDatabasesTest.kt
+++ b/sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/test/TrackDatabasesTest.kt
@@ -24,7 +24,6 @@
import androidx.test.filters.MediumTest
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
import org.junit.Rule
import org.junit.Test
@@ -40,7 +39,6 @@
@MediumTest
@RunWith(AndroidJUnit4::class)
-@ExperimentalCoroutinesApi
class TrackDatabasesTest {
@get:Rule
val testEnvironment = SqliteInspectorTestEnvironment()
diff --git a/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild2Test.java b/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild2Test.java
index dd3dc88..1717df6 100644
--- a/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild2Test.java
+++ b/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild2Test.java
@@ -49,7 +49,6 @@
* Small integration tests that verifies correctness of {@link SwipeRefreshLayout}'s
* NestedScrollingChild2 implementation.
*/
-
@RunWith(AndroidJUnit4.class)
@LargeTest
public class SwipeRefreshLayoutNestedScrollingChild2Test {
diff --git a/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent2Test.java b/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent2Test.java
index f5a16c1..fa6c36a 100644
--- a/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent2Test.java
+++ b/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent2Test.java
@@ -50,7 +50,6 @@
* Small integration tests that verifies correctness of {@link SwipeRefreshLayout}'s
* NestedScrollingParent2 implementation.
*/
-
@RunWith(AndroidJUnit4.class)
@LargeTest
public class SwipeRefreshLayoutNestedScrollingParent2Test {
diff --git a/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParentTest.java b/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParentTest.java
index 99f514f..bf60adb 100644
--- a/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParentTest.java
+++ b/swiperefreshlayout/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParentTest.java
@@ -37,7 +37,6 @@
* This test is not complete, and has only been added to as changes have been made that may have
* affected NestedScrollingChild implementation behavior.
*/
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class SwipeRefreshLayoutNestedScrollingParentTest {
diff --git a/testutils/testutils-ktx/src/main/java/androidx/testutils/MainDispatcherRule.kt b/testutils/testutils-ktx/src/main/java/androidx/testutils/MainDispatcherRule.kt
index 7aa0955..9542905 100644
--- a/testutils/testutils-ktx/src/main/java/androidx/testutils/MainDispatcherRule.kt
+++ b/testutils/testutils-ktx/src/main/java/androidx/testutils/MainDispatcherRule.kt
@@ -18,7 +18,6 @@
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.setMain
import org.junit.rules.TestRule
@@ -26,7 +25,6 @@
import org.junit.runners.model.Statement
class MainDispatcherRule(private val dispatcher: CoroutineDispatcher) : TestRule {
- @UseExperimental(ExperimentalCoroutinesApi::class)
override fun apply(base: Statement?, description: Description?) = object : Statement() {
override fun evaluate() {
Dispatchers.setMain(dispatcher)