Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit e27f4e244229735503c5e0482d4d800dcc3f8977
Author: Dustin Lam <dustinlam@google.com>
Date: Fri Mar 12 10:44:22 2021
Use a placeholder PagingSource to prevent running DataSource.Factory on main thread
Paging3 introduced InitialPagedList which requires a PagingSource which
was previous provided by synchronously calling PagingSourceFactory() on
the main thread. This breaks the back-compat requirement from paging2's
DataSource.Factory#create() to be called on fetchDispatcher, so instead
of using a real PagingSource, we can simply substitute a placeholder
PagingSource implementation which only ever loads empty pages and provides
null keys.
Fixes: 182798948
Test: ./gradlew paging:paging-runtime:cC
Change-Id: I638d2149a9e8b78884b4f82315d0b1d3d5066d44
M paging/common/src/main/kotlin/androidx/paging/InitialPagedList.kt
A paging/common/src/main/kotlin/androidx/paging/InitialPagingSource.kt
M paging/runtime/src/androidTest/java/androidx/paging/LivePagedListTest.kt
M paging/runtime/src/main/java/androidx/paging/LivePagedList.kt
M paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.kt
M paging/rxjava2/src/test/java/androidx/paging/RxPagedListBuilderTest.kt
https://android-review.googlesource.com/1633725
Branch: androidx-main
commit e27f4e244229735503c5e0482d4d800dcc3f8977
Author: Dustin Lam <dustinlam@google.com>
Date: Fri Mar 12 10:44:22 2021
Use a placeholder PagingSource to prevent running DataSource.Factory on main thread
Paging3 introduced InitialPagedList which requires a PagingSource which
was previous provided by synchronously calling PagingSourceFactory() on
the main thread. This breaks the back-compat requirement from paging2's
DataSource.Factory#create() to be called on fetchDispatcher, so instead
of using a real PagingSource, we can simply substitute a placeholder
PagingSource implementation which only ever loads empty pages and provides
null keys.
Fixes: 182798948
Test: ./gradlew paging:paging-runtime:cC
Change-Id: I638d2149a9e8b78884b4f82315d0b1d3d5066d44
M paging/common/src/main/kotlin/androidx/paging/InitialPagedList.kt
A paging/common/src/main/kotlin/androidx/paging/InitialPagingSource.kt
M paging/runtime/src/androidTest/java/androidx/paging/LivePagedListTest.kt
M paging/runtime/src/main/java/androidx/paging/LivePagedList.kt
M paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.kt
M paging/rxjava2/src/test/java/androidx/paging/RxPagedListBuilderTest.kt
Description
No description yet.