Fixed
Status Update
Comments
vi...@google.com <vi...@google.com>
ma...@bokhorst.biz <ma...@bokhorst.biz> #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.
vi...@google.com <vi...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
ma...@bokhorst.biz <ma...@bokhorst.biz> #4
I think the crash is pretty obvious and doesn't require any additional information, so I am not going to put time into this.
ru...@gmail.com <ru...@gmail.com> #5
I can't agree more "The crash is PRETTY OBVIOUS" .On emulator Pixel XL API 28 ,the bug occures each time i press negative Button which I can customize the name of it .I will upload my Demo next.You can also check my code by visiting my github repository https://github.com/runfengai/Biometric 。
vi...@google.com <vi...@google.com> #6
Moving the issue to (androidx) > Biometric component to check this issue and provide inputs.
kc...@google.com <kc...@google.com>
cu...@google.com <cu...@google.com>
eu...@gmail.com <eu...@gmail.com> #7
Another instance of this was reported here:
Library version: androidx.biometric:biometric:1.1.0-alpha01
Device info:
Device: Samsung Galaxy S8
Android version: 9 (SDK 28)
Android build ID: PPR1.180610.011.G950WVLS7CTC1
Device brand: samsung
Device manufacturer: samsung
Device name: dreamqltecan
Device model: SM-G950W
Device product name: dreamqltevl
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b525b6ebf4687dc789e4825be85a0458529d2309
Author: Curtis Belmonte <curtislb@google.com>
Date: Mon Jul 06 15:53:14 2020
Ensure biometric LiveData updates run on main thread
MutableLiveData requires value updates triggered by setValue() to run on
the main thread. Currently, the androidx.biometric library doesn't
enforce this, leading to runtime crashes. This commit changes the
behavior of BiometricViewModel to check whether the update occurs on the
main thread and, if not, to instead call postValue().
Test: Biometric integration test app on API 27-30.
Test: ./gradlew biometric:biometric:test
Test: ./gradlew biometric:biometric:connectedAndroidTest
Fixes: 159983244
Change-Id: Iec79da704651b7ce4c065b6f12471a50756e54b0
M biometric/biometric/build.gradle
M biometric/biometric/src/main/java/androidx/biometric/BiometricViewModel.java
A biometric/biometric/src/test/java/androidx/biometric/BiometricViewModelTest.java
https://android-review.googlesource.com/1356284
Branch: androidx-master-dev
commit b525b6ebf4687dc789e4825be85a0458529d2309
Author: Curtis Belmonte <curtislb@google.com>
Date: Mon Jul 06 15:53:14 2020
Ensure biometric LiveData updates run on main thread
MutableLiveData requires value updates triggered by setValue() to run on
the main thread. Currently, the androidx.biometric library doesn't
enforce this, leading to runtime crashes. This commit changes the
behavior of BiometricViewModel to check whether the update occurs on the
main thread and, if not, to instead call postValue().
Test: Biometric integration test app on API 27-30.
Test: ./gradlew biometric:biometric:test
Test: ./gradlew biometric:biometric:connectedAndroidTest
Fixes: 159983244
Change-Id: Iec79da704651b7ce4c065b6f12471a50756e54b0
M biometric/biometric/build.gradle
M biometric/biometric/src/main/java/androidx/biometric/BiometricViewModel.java
A biometric/biometric/src/test/java/androidx/biometric/BiometricViewModelTest.java
Description
java.lang.IllegalStateException: Cannot invoke setValue on a background thread at androidx.lifecycle.LiveData.assertMainThread(SourceFile:462) at androidx.lifecycle.LiveData.setValue(SourceFile:304) at androidx.lifecycle.MutableLiveData.setValue(SourceFile:50) at androidx.biometric.BiometricViewModel.setNegativeButtonPressPending(SourceFile:408) at androidx.biometric.BiometricViewModel$4.onClick(SourceFile:280) at android.hardware.biometrics.BiometricPrompt$1.lambda$onDialogDismissed$1(BiometricPrompt.java:231) at android.hardware.biometrics.-$$Lambda$BiometricPrompt$1$J5PqpiT8xZNiNN1gy9VraVgknaQ.run(Unknown:2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)