Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
the sample in the bug is actually great, it keeps printing repeatedly, does not even stop :/
yb...@google.com <yb...@google.com> #3
oh nevermind, i wrote the test wrong, thats why it went into a loop.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b9e8c46f4b3151d119058c5224471a913f0b92ac
Author: Nicklas Ansman Giertz <nicklas@ansman.se>
Date: Thu Sep 17 15:45:10 2020
Make PausingDispatcher behave like the main dispatcher when yielding
The default android main dispatcher supports yielding inside the
immediate dispatcher (seehttps://github.com/Kotlin/kotlinx.coroutines/commit/3ab34d808b5aa2c8673754bd43e4879b9d4af8c9 ).
The pausing dispatcher has not worked liked this and yield() calls are
essentially a no-op. This change fixes this and will respect yield()
calls.
Fixes: 168777346
Test: PausingDispatcherTest
Change-Id: Iffa89a264f8566e584eccc1a6ce844863cca2ad9
M lifecycle/lifecycle-runtime-ktx/src/androidTest/java/androidx/lifecycle/Expectations.kt
M lifecycle/lifecycle-runtime-ktx/src/androidTest/java/androidx/lifecycle/PausingDispatcherTest.kt
M lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/DispatchQueue.kt
M lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/PausingDispatcher.kt
https://android-review.googlesource.com/1430830
Branch: androidx-master-dev
commit b9e8c46f4b3151d119058c5224471a913f0b92ac
Author: Nicklas Ansman Giertz <nicklas@ansman.se>
Date: Thu Sep 17 15:45:10 2020
Make PausingDispatcher behave like the main dispatcher when yielding
The default android main dispatcher supports yielding inside the
immediate dispatcher (see
The pausing dispatcher has not worked liked this and yield() calls are
essentially a no-op. This change fixes this and will respect yield()
calls.
Fixes: 168777346
Test: PausingDispatcherTest
Change-Id: Iffa89a264f8566e584eccc1a6ce844863cca2ad9
M lifecycle/lifecycle-runtime-ktx/src/androidTest/java/androidx/lifecycle/Expectations.kt
M lifecycle/lifecycle-runtime-ktx/src/androidTest/java/androidx/lifecycle/PausingDispatcherTest.kt
M lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/DispatchQueue.kt
M lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/PausingDispatcher.kt
Description
Component used:
lifecycle-runtime-ktx
Version used:
2.2.0-alpha01 up to 2.3.0-alpha07
The following example should print "1", "2" then "3" but prints "1", "3", "2":
A similar problem existed inhttps://github.com/Kotlin/kotlinx.coroutines/issues/1474
Dispatchers.Main
but was fixed: