Fixed
Status Update
Comments
ha...@vipps.no <ha...@vipps.no> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
ra...@gmail.com <ra...@gmail.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
[Deleted User] <[Deleted User]> #4
Also confirmed.
kc...@google.com <kc...@google.com>
cu...@google.com <cu...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit f66d96a88004a563891986b659f4a7b4199b20d4
Author: Curtis Belmonte <curtislb@google.com>
Date: Thu Jun 27 17:40:40 2019
Extract biometric prompt demo logic to controller
Currently, all of the logic for initializing and launching the prompt
for BiometricPromptDemo lives inside the demo activity. This commit
extracts the majority of this logic to a new BiometricPromptDemoController
class. This will allow it to be shared with the fragment-based demo
implementation that will be introduced in a later commit.
Test: Launch the biometric prompt demo app, try various combinations of
options, and verify everything works as before.
Bug: 131980596
Change-Id: I0e1f9b321c1e9b81e05ed79aa76f0a34e68b7948
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemo.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoController.java
M samples/BiometricDemos/src/main/res/layout/fragment_activity.xml
https://android-review.googlesource.com/1007922
https://goto.google.com/android-sha1/f66d96a88004a563891986b659f4a7b4199b20d4
Branch: androidx-master-dev
commit f66d96a88004a563891986b659f4a7b4199b20d4
Author: Curtis Belmonte <curtislb@google.com>
Date: Thu Jun 27 17:40:40 2019
Extract biometric prompt demo logic to controller
Currently, all of the logic for initializing and launching the prompt
for BiometricPromptDemo lives inside the demo activity. This commit
extracts the majority of this logic to a new BiometricPromptDemoController
class. This will allow it to be shared with the fragment-based demo
implementation that will be introduced in a later commit.
Test: Launch the biometric prompt demo app, try various combinations of
options, and verify everything works as before.
Bug: 131980596
Change-Id: I0e1f9b321c1e9b81e05ed79aa76f0a34e68b7948
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemo.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoController.java
M samples/BiometricDemos/src/main/res/layout/fragment_activity.xml
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 8eb7bd97770c1a8e20995227215793ecda067d9c
Author: Curtis Belmonte <curtislb@google.com>
Date: Fri Jun 28 14:03:26 2019
Allow hosting biometric prompt demo in activity or fragment
Currently, the androidx support biometric prompt demo always launches
the prompt from an activity and hooks into the activity's lifecycle
methods. However, it would be also be useful for testing and
demonstration purposes to launch the prompt from within a fragment as
well.
This commit changes the main screen of the biometric prompt demo app
to prompt the user whether they would like to host the prompt in an
activity or fragment. They can then tap on one of two buttons which then
launches the prompt demo within the appropriate host.
Test: Launch demo app, verify that the first screen presents options to
host the prompt in an activity or fragment. Tap on each of the options,
verify that the demo launches within the appropriate host (as shown in
the label at the top of the screen). Verify all authentication flows
work as before from both the activity and fragment.
Bug: 131980596
Change-Id: I19d520b38a07eba801927d8ce5c12141c40e5839
M samples/BiometricDemos/src/main/AndroidManifest.xml
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemo.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoActivityController.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoActivityHost.java
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoController.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentController.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentHost.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentHostActivity.java
A samples/BiometricDemos/src/main/res/layout/biometric_prompt_demo.xml
M samples/BiometricDemos/src/main/res/layout/biometric_prompt_demo_content.xml
A samples/BiometricDemos/src/main/res/layout/biometric_prompt_demo_fragment_host_activity.xml
M samples/BiometricDemos/src/main/res/values/strings.xml
https://android-review.googlesource.com/1008162
https://goto.google.com/android-sha1/8eb7bd97770c1a8e20995227215793ecda067d9c
Branch: androidx-master-dev
commit 8eb7bd97770c1a8e20995227215793ecda067d9c
Author: Curtis Belmonte <curtislb@google.com>
Date: Fri Jun 28 14:03:26 2019
Allow hosting biometric prompt demo in activity or fragment
Currently, the androidx support biometric prompt demo always launches
the prompt from an activity and hooks into the activity's lifecycle
methods. However, it would be also be useful for testing and
demonstration purposes to launch the prompt from within a fragment as
well.
This commit changes the main screen of the biometric prompt demo app
to prompt the user whether they would like to host the prompt in an
activity or fragment. They can then tap on one of two buttons which then
launches the prompt demo within the appropriate host.
Test: Launch demo app, verify that the first screen presents options to
host the prompt in an activity or fragment. Tap on each of the options,
verify that the demo launches within the appropriate host (as shown in
the label at the top of the screen). Verify all authentication flows
work as before from both the activity and fragment.
Bug: 131980596
Change-Id: I19d520b38a07eba801927d8ce5c12141c40e5839
M samples/BiometricDemos/src/main/AndroidManifest.xml
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemo.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoActivityController.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoActivityHost.java
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoController.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentController.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentHost.java
A samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentHostActivity.java
A samples/BiometricDemos/src/main/res/layout/biometric_prompt_demo.xml
M samples/BiometricDemos/src/main/res/layout/biometric_prompt_demo_content.xml
A samples/BiometricDemos/src/main/res/layout/biometric_prompt_demo_fragment_host_activity.xml
M samples/BiometricDemos/src/main/res/values/strings.xml
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit f6b9bdea083e7b6ba8d74fd373c826a951960b77
Author: Curtis Belmonte <curtislb@google.com>
Date: Mon Jul 01 10:35:24 2019
Add fragment-specific constructor for biometric prompt
Currently, constructing an instance of the androidx support biometric
prompt requires a FragmentActivity. This is because BiometricPrompt
relies on the activity internally for performing fragment transactions
and checking for configuration changes. However, this is causing a crash
when attempting to attach the biometric fragment to the activity via its
fragment manager.
This commit addresses the issue by adding a new constructor for
BiometricPrompt which accepts a Fragment instead of a FragmentActivity.
Then, when performing fragment transactions, BiometricPrompt can use the
child fragment manager of the fragment instead of the activity's
fragment manager. Checking for configuration changes is now handled by
calling the appropriate method on the fragment's host activity (if one
exists).
This commit also updates the existing biometric prompt demo app to use
the new constructor when the biometric prompt is hosted in a Fragment,
rather than directly in a FragmentActivity.
Test: Tested manually using biometric prompt demo app:
1. Repro the crash by changing the authenticate button to show a
custom DialogFragment that launches BiometricPrompt during onResume
2. Re-run app with changes from this commit, and verify crash no longer
repros
3. Verify that all authentication flows work as before when launched
from the DialogFragment, including across configuration changes
4. Verify that the user can dismiss the DialogFragment without error and
that backgrounding the app cancels authentication and dismisses prompt
Fixes: 131980596
Change-Id: I2f868460ab6f81e3a848a89d61b76a97a5d5043e
M biometric/api/1.0.0-alpha05.txt
M biometric/api/current.txt
M biometric/src/main/java/androidx/biometric/BiometricFragment.java
M biometric/src/main/java/androidx/biometric/BiometricPrompt.java
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoActivityController.java
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentController.java
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentHost.java
https://android-review.googlesource.com/1009171
https://goto.google.com/android-sha1/f6b9bdea083e7b6ba8d74fd373c826a951960b77
Branch: androidx-master-dev
commit f6b9bdea083e7b6ba8d74fd373c826a951960b77
Author: Curtis Belmonte <curtislb@google.com>
Date: Mon Jul 01 10:35:24 2019
Add fragment-specific constructor for biometric prompt
Currently, constructing an instance of the androidx support biometric
prompt requires a FragmentActivity. This is because BiometricPrompt
relies on the activity internally for performing fragment transactions
and checking for configuration changes. However, this is causing a crash
when attempting to attach the biometric fragment to the activity via its
fragment manager.
This commit addresses the issue by adding a new constructor for
BiometricPrompt which accepts a Fragment instead of a FragmentActivity.
Then, when performing fragment transactions, BiometricPrompt can use the
child fragment manager of the fragment instead of the activity's
fragment manager. Checking for configuration changes is now handled by
calling the appropriate method on the fragment's host activity (if one
exists).
This commit also updates the existing biometric prompt demo app to use
the new constructor when the biometric prompt is hosted in a Fragment,
rather than directly in a FragmentActivity.
Test: Tested manually using biometric prompt demo app:
1. Repro the crash by changing the authenticate button to show a
custom DialogFragment that launches BiometricPrompt during onResume
2. Re-run app with changes from this commit, and verify crash no longer
repros
3. Verify that all authentication flows work as before when launched
from the DialogFragment, including across configuration changes
4. Verify that the user can dismiss the DialogFragment without error and
that backgrounding the app cancels authentication and dismisses prompt
Fixes: 131980596
Change-Id: I2f868460ab6f81e3a848a89d61b76a97a5d5043e
M biometric/api/1.0.0-alpha05.txt
M biometric/api/current.txt
M biometric/src/main/java/androidx/biometric/BiometricFragment.java
M biometric/src/main/java/androidx/biometric/BiometricPrompt.java
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoActivityController.java
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentController.java
M samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemoFragmentHost.java
ma...@zentity.com <ma...@zentity.com> #8
When you plan to release alpha-05 with this fix?
mk...@mobiquityinc.com <mk...@mobiquityinc.com> #9
I am also getting this, let us know when you are planning to fix this.
Description
Version used: androidx.biometric:biometric:1.0.0-alpha04
Devices/Android versions reproduced on: Pixel 3/9.0
Steps to reproduce:
In a fragment call biometricPrompt.authenticate(..)
Expected result:
Prompt is shown
Actual result:
App crashes with "FragmentManager is already executing transactions". The BiometricPrompt is initalized with a standard main thread executor:
private class MainThreadExecutor : Executor {
private val mainThreadHandler = Handler(Looper.getMainLooper())
override fun execute(command: Runnable) {
mainThreadHandler.post(command)
}
}