Fixed
Status Update
Comments
ad...@google.com <ad...@google.com>
ad...@google.com <ad...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 93dc6213fe2e74aa9c9d3dcdb4551c6ad3a85ba4
Author: sanura <sanura@google.com>
Date: Thu Mar 16 01:59:33 2023
Add private initViewTreeOwners() to AppCompatDialog
Ensure that AppCompatDialog also sets initial view
tree owners, since it does not call through to
super.setContentView(), which would set them via
ComponentDialog.
RelNote: "`AppCompatDialog` now correctly sets the `LifecycleOwner`, `SavedStateRegistryOwner`, and `OnBackPressedDispatcherOwner` on the dialog's decor view via the ViewTree APIs, fixing issues when hosting a ComposeView within an AppCompatDialog. AppCompat now depends on Activity 1.7.0."
Bug: 261314581
Test: AppComptaDialogTest
Change-Id: Ib28abb12cc3c617b9ffed9e1450e48308dc7c3df
M appcompat/appcompat/build.gradle
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatDialogTest.kt
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialog.java
https://android-review.googlesource.com/2493316
Branch: androidx-main
commit 93dc6213fe2e74aa9c9d3dcdb4551c6ad3a85ba4
Author: sanura <sanura@google.com>
Date: Thu Mar 16 01:59:33 2023
Add private initViewTreeOwners() to AppCompatDialog
Ensure that AppCompatDialog also sets initial view
tree owners, since it does not call through to
super.setContentView(), which would set them via
ComponentDialog.
RelNote: "`AppCompatDialog` now correctly sets the `LifecycleOwner`, `SavedStateRegistryOwner`, and `OnBackPressedDispatcherOwner` on the dialog's decor view via the ViewTree APIs, fixing issues when hosting a ComposeView within an AppCompatDialog. AppCompat now depends on Activity 1.7.0."
Bug: 261314581
Test: AppComptaDialogTest
Change-Id: Ib28abb12cc3c617b9ffed9e1450e48308dc7c3df
M appcompat/appcompat/build.gradle
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatDialogTest.kt
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialog.java
xe...@gmail.com <xe...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 6b7a0f963d43aa6a06b461d62743ed81adddce40
Author: sanura <sanura@google.com>
Date: Thu Mar 16 23:01:38 2023
Open up initViewTreeOwners() API for ComponentDialog and ComponentActivity
Making initViewTreeOwners() a public API in ComponentDialog
and ComponentActivity so it can be used by AppCompat.
RelNote: "`ComponentDialog` and `ComponentActivity` now
contain public API `initViewTreeOwners()` to be used to
initialize all view tree owners before setting the
content view."
Bug: 261314581
Test: all tests pass
Change-Id: Ibdce0a994b0daddc090e4ff58583ccba71612870
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/ComponentDialog.kt
https://android-review.googlesource.com/2493317
Branch: androidx-main
commit 6b7a0f963d43aa6a06b461d62743ed81adddce40
Author: sanura <sanura@google.com>
Date: Thu Mar 16 23:01:38 2023
Open up initViewTreeOwners() API for ComponentDialog and ComponentActivity
Making initViewTreeOwners() a public API in ComponentDialog
and ComponentActivity so it can be used by AppCompat.
RelNote: "`ComponentDialog` and `ComponentActivity` now
contain public API `initViewTreeOwners()` to be used to
initialize all view tree owners before setting the
content view."
Bug: 261314581
Test: all tests pass
Change-Id: Ibdce0a994b0daddc090e4ff58583ccba71612870
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/ComponentDialog.kt
xe...@gmail.com <xe...@gmail.com> #4
This has been fixed internally and will be available in the Activity 1.8.0-alpha03
release.
ad...@google.com <ad...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.appcompat:appcompat:1.7.0-alpha03
kc...@google.com <kc...@google.com> #6
Coco73g11@gmail.com
Galaxy 3571881034
199001
On Wed, Mar 29, 2023, 11:36 PM <buganizer-system@google.com> wrote:
Galaxy 3571881034
199001
On Wed, Mar 29, 2023, 11:36 PM <buganizer-system@google.com> wrote:
ch...@gmail.com <ch...@gmail.com> #7
This bug is actually a duplicate of https://issuetracker.google.com/issues/121117380 . This issue happens because the new AuthenticationCallback is not being supplied to the biometric prompt fragments if they already exist in the FragmentManager.
Until this is fixed, users of this library MUST manually check for and remove any biometric prompt fragments from the FragmentManager before attempting to call BiometricPrompt#authenticate().
Until this is fixed, users of this library MUST manually check for and remove any biometric prompt fragments from the FragmentManager before attempting to call BiometricPrompt#authenticate().
ma...@zentity.com <ma...@zentity.com> #8
#7
I think that:
1. BiometricPrompt#authenticateInternal should call mFingerprintHelperFragment.setCallback method even if mFingerprintHelperFragment was existed before.
2. FingerprintHelperFragment#cleanup has to set mClientAuthenticationCallback and mExecutor to null to prevent leaking.
I think that:
1. BiometricPrompt#authenticateInternal should call mFingerprintHelperFragment.setCallback method even if mFingerprintHelperFragment was existed before.
2. FingerprintHelperFragment#cleanup has to set mClientAuthenticationCallback and mExecutor to null to prevent leaking.
ma...@zentity.com <ma...@zentity.com> #9
My mistake in point one:
1. Biometric#mLifecycleObserver#onResume should call mFingerprintHelperFragment.setCallback(...) even if mFingerprintDialogFragment is null.
Here is my temporary fix. Just place it in androidx.biometric package and use it like BiometricPrompt:
package androidx.biometric
import android.annotation.SuppressLint
import androidx.fragment.app.FragmentActivity
import java.util.concurrent.Executor
/**
* Fix for isssuehttps://issuetracker.google.com/issues/123857949
*/
@SuppressLint("RestrictedApi")
class FixedBiometricPrompt(
private val fragmentActivity: FragmentActivity,
executor: Executor,
callback: BiometricPrompt.AuthenticationCallback
) {
private val delegate: BiometricPrompt
init {
// set executor and callback to helper fragment
(fragmentActivity.supportFragmentManager.findFragmentByTag("FingerprintHelperFragment") as? FingerprintHelperFragment)?.setCallback(
executor,
callback
)
delegate = BiometricPrompt(fragmentActivity, executor, callback)
}
fun authenticate(info: BiometricPrompt.PromptInfo, crypto: BiometricPrompt.CryptoObject) {
delegate.authenticate(info, crypto)
}
fun authenticate(info: BiometricPrompt.PromptInfo) {
delegate.authenticate(info)
}
fun cancelAuthentication() {
delegate.cancelAuthentication()
}
fun cleanup() {
// remove executor and callback from helper fragment to prevent memory leak
(fragmentActivity.supportFragmentManager.findFragmentByTag("FingerprintHelperFragment") as? FingerprintHelperFragment)?.setCallback(
null,
null
)
}
}
1. Biometric#mLifecycleObserver#onResume should call mFingerprintHelperFragment.setCallback(...) even if mFingerprintDialogFragment is null.
Here is my temporary fix. Just place it in androidx.biometric package and use it like BiometricPrompt:
package androidx.biometric
import android.annotation.SuppressLint
import androidx.fragment.app.FragmentActivity
import java.util.concurrent.Executor
/**
* Fix for isssue
*/
@SuppressLint("RestrictedApi")
class FixedBiometricPrompt(
private val fragmentActivity: FragmentActivity,
executor: Executor,
callback: BiometricPrompt.AuthenticationCallback
) {
private val delegate: BiometricPrompt
init {
// set executor and callback to helper fragment
(fragmentActivity.supportFragmentManager.findFragmentByTag("FingerprintHelperFragment") as? FingerprintHelperFragment)?.setCallback(
executor,
callback
)
delegate = BiometricPrompt(fragmentActivity, executor, callback)
}
fun authenticate(info: BiometricPrompt.PromptInfo, crypto: BiometricPrompt.CryptoObject) {
delegate.authenticate(info, crypto)
}
fun authenticate(info: BiometricPrompt.PromptInfo) {
delegate.authenticate(info)
}
fun cancelAuthentication() {
delegate.cancelAuthentication()
}
fun cleanup() {
// remove executor and callback from helper fragment to prevent memory leak
(fragmentActivity.supportFragmentManager.findFragmentByTag("FingerprintHelperFragment") as? FingerprintHelperFragment)?.setCallback(
null,
null
)
}
}
ma...@zentity.com <ma...@zentity.com> #10
...
Then call function cleanup() in onDestroyView...
override fun onDestroyView() {
super.onDestroyView()
biometricPrompt.cleanup()
}
Then call function cleanup() in onDestroyView...
override fun onDestroyView() {
super.onDestroyView()
biometricPrompt.cleanup()
}
sb...@doximity.com <sb...@doximity.com> #11
the proper fix (on google's side) is pretty simple
on line 498
if (mFingerprintHelperFragment == null) {
mFingerprintHelperFragment = FingerprintHelperFragment.newInstance();
mFingerprintHelperFragment.setCallback(mExecutor, mAuthenticationCallback); // <-- this line should be moved out side the if statement
}
on line 498
if (mFingerprintHelperFragment == null) {
mFingerprintHelperFragment = FingerprintHelperFragment.newInstance();
mFingerprintHelperFragment.setCallback(mExecutor, mAuthenticationCallback); // <-- this line should be moved out side the if statement
}
kc...@google.com <kc...@google.com> #12
Hmm we already fixed this. Just need to cut a new build for alpha04 now.
The bug was referenced in this CL but somehow buganizer didn't close it
https://android-review.googlesource.com/c/platform/frameworks/support/+/917882/
The bug was referenced in this CL but somehow buganizer didn't close it
Description
Version used: 1.0.0-alpha03
Devices/Android versions reproduced on: Emulator API 24
if used in more than one Fragment inside the same activity, BiometricPrompt only listens for callbacks in the first BiometricPrompt.AuthenticationCallback provided
no matter if you create a new instance of the prompt in another fragment
This only happens in API level below P
In P works fine,
I tested in 24 and P