Fixed
Status Update
Comments
du...@google.com <du...@google.com> #2
Note: I know alpha-02 has a fix for a biometric related leak:
However that change did not fix the leak reported here, as BiometricViewModel is still tied to the activity lifecycle no matter what and will hold the clientCallback reference until the activity is destroyed.
du...@google.com <du...@google.com> #3
Any news/possible for this issue?
cc...@google.com <cc...@google.com>
le...@gmail.com <le...@gmail.com> #4
Can confirm that it still happens in 1.1.0-beta01
du...@google.com <du...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit fcbbd9368d75b736de4b92d067be84421376b294
Author: Curtis Belmonte <curtislb@google.com>
Date: Wed Jan 20 15:54:34 2021
Reset BiometricViewModel callback in Fragment#onDestroy()
Currently, the client callback reference held by BiometricViewModel is
retained for the lifecycle of the hosting activity. In the (likely) case
that a client is using a fragment within that activity to host
BiometricPrompt and passes an AuthenticationCallback with a reference to
that fragment, this will cause the fragment to leak.
This commit applies a minimal fix for the issue by resetting the
callback reference held by the view model when the host fragment is
destroyed (via a LifecycleObserver). This shouldn't affect the prompt's
behavior across configuration changes such as device rotation, since the
callback should be reinitialized by the client in onCreate() or similar.
Test: Biometric integration test app on API 27-30.
Test: ./gradlew biometric:biometric:test
Test: ./gradlew biometric:biometric:connectedAndroidTest
Test: ./gradlew biometric:integration-tests:testapp:connectedAndroidTest
Bug: 167014923
Change-Id: I7086460fac3921a490f4e2abf0671adec5c146bd
M biometric/biometric/src/main/java/androidx/biometric/BiometricPrompt.java
M biometric/biometric/src/main/java/androidx/biometric/BiometricViewModel.java
https://android-review.googlesource.com/1555701
Branch: androidx-main
commit fcbbd9368d75b736de4b92d067be84421376b294
Author: Curtis Belmonte <curtislb@google.com>
Date: Wed Jan 20 15:54:34 2021
Reset BiometricViewModel callback in Fragment#onDestroy()
Currently, the client callback reference held by BiometricViewModel is
retained for the lifecycle of the hosting activity. In the (likely) case
that a client is using a fragment within that activity to host
BiometricPrompt and passes an AuthenticationCallback with a reference to
that fragment, this will cause the fragment to leak.
This commit applies a minimal fix for the issue by resetting the
callback reference held by the view model when the host fragment is
destroyed (via a LifecycleObserver). This shouldn't affect the prompt's
behavior across configuration changes such as device rotation, since the
callback should be reinitialized by the client in onCreate() or similar.
Test: Biometric integration test app on API 27-30.
Test: ./gradlew biometric:biometric:test
Test: ./gradlew biometric:biometric:connectedAndroidTest
Test: ./gradlew biometric:integration-tests:testapp:connectedAndroidTest
Bug: 167014923
Change-Id: I7086460fac3921a490f4e2abf0671adec5c146bd
M biometric/biometric/src/main/java/androidx/biometric/BiometricPrompt.java
M biometric/biometric/src/main/java/androidx/biometric/BiometricViewModel.java
Description
Could it be possible to transform the signature of PagingData extension function like
map
andflatMap
to accept suspending transform function ?For example :
fun <R : Any> map(transform: (T) -> R): PagingData<R> = transform { it.map(transform) }
tofun <R : Any> map(transform: **suspend** (T) -> R): PagingData<R> = transform { it.map(transform) }
For instance, i'm observing a Room table with a Pager that contains Entity ids in other Room tables (like a polymorphic table), and I would like to query them inside a map in a suspending way and not using runBlocking.