Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit adc51a26519cb6ed39f88c6da749798c209bad66
Author: Dustin Lam <dustinlam@google.com>
Date: Mon Apr 25 15:59:38 2022
Prioritize getRefreshKey if it returns null on invalidate
It is currently documents for the result of `.getRefreshKey()` to be
respected, even if it returns `null` in cases where a non-null
`initialKey` is passed to `Pager`. This resolves an errant use of elivs
operator which incorrectly prioritized `initialKey` in those cases.
Relnote: "The result of `PagingSource.getRefreshKey()` is now correctly
priotized over `initialKey` in cases where it would return `null, but a
non-null `initialKey` was set."
Bug: 189492631
Fixes: 230391606
Test: ./gradlew paging:paging-common:test
Change-Id: Ic9542c0062f9a72e5cfa15469bcf0c204a0934bd
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/paging-common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
M paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
M testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
M paging/paging-runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt
M paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
https://android-review.googlesource.com/2075372
Branch: androidx-main
commit adc51a26519cb6ed39f88c6da749798c209bad66
Author: Dustin Lam <dustinlam@google.com>
Date: Mon Apr 25 15:59:38 2022
Prioritize getRefreshKey if it returns null on invalidate
It is currently documents for the result of `.getRefreshKey()` to be
respected, even if it returns `null` in cases where a non-null
`initialKey` is passed to `Pager`. This resolves an errant use of elivs
operator which incorrectly prioritized `initialKey` in those cases.
Relnote: "The result of `PagingSource.getRefreshKey()` is now correctly
priotized over `initialKey` in cases where it would return `null, but a
non-null `initialKey` was set."
Bug: 189492631
Fixes: 230391606
Test: ./gradlew paging:paging-common:test
Change-Id: Ic9542c0062f9a72e5cfa15469bcf0c204a0934bd
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/paging-common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
M paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
M testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
M paging/paging-runtime/src/androidTest/java/androidx/paging/AsyncPagingDataDifferTest.kt
M paging/paging-common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
Description
PagingSource.getRefreshKey()
result is ignored for REFRESH on subsequent generations if a non-nullinitialKey
was passed toPager
, but it is not documented to work this way.