Status Update
Comments
vi...@google.com <vi...@google.com>
vi...@google.com <vi...@google.com> #2
Android 5.0, 5.1: it shows context menu at top of screen, not as popup. See screenshots.
Android framework doesn't support floating toolbar before 23. So this is intended behavior.
The crash information suggests that this is an error from Snapshot. chuckj@ can you please take a look? I don't know what exactly caused the readError
in Snapshot, any suggestions? Thanks a lot!
fi...@gmail.com <fi...@gmail.com> #3
This looks like another instance of 193006595 which I am looking at now.
al...@gmail.com <al...@gmail.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit beeb84e7be604088ad40e080a8d0adb1bacbf695
Author: Chuck Jazdzewski <chuckj@google.com>
Date: Thu Jul 08 10:04:28 2021
Remove updating the transparent snapshot
A transparent snapshot is create for the block exeucted by
`Snapshot.observe()` which registers read and write observers
but without creating a snapshot. The code to advance the
global snapshot, however, created a new transparent snapshot in
an attempt to update it to the new global snapshot it just
created. This is not necessary, however, as the transparent
snapshot will retrieve the current global snapshot from
`currentGlobalSnapshot` instead of `previousSnapshot` if
`previousSnapshot` is `null`. With the previous code, if the
global snapshot is advanced by applying a new snapshot the
"updated" transparent snapshot will be left referring to an
older snapshot instead of the most recent global snapshot.
Any snapshot object created in the newly applied snapshot
will throw an exception when it is accessed, as reported in
the bugs. The solution is to remove the apparent vetiagal code.
Test: ./gradlew :compose:r:r:tDUT
Fixes: b/193006595 , b/192570897
Change-Id: I2c0d0b8f57bf70e5a98ea36ed141d97142a5e53e
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/Snapshot.kt
M compose/runtime/runtime/src/test/kotlin/androidx/compose/runtime/snapshots/SnapshotTests.kt
https://android-review.googlesource.com/1760301
Branch: androidx-main
commit beeb84e7be604088ad40e080a8d0adb1bacbf695
Author: Chuck Jazdzewski <chuckj@google.com>
Date: Thu Jul 08 10:04:28 2021
Remove updating the transparent snapshot
A transparent snapshot is create for the block exeucted by
`Snapshot.observe()` which registers read and write observers
but without creating a snapshot. The code to advance the
global snapshot, however, created a new transparent snapshot in
an attempt to update it to the new global snapshot it just
created. This is not necessary, however, as the transparent
snapshot will retrieve the current global snapshot from
`currentGlobalSnapshot` instead of `previousSnapshot` if
`previousSnapshot` is `null`. With the previous code, if the
global snapshot is advanced by applying a new snapshot the
"updated" transparent snapshot will be left referring to an
older snapshot instead of the most recent global snapshot.
Any snapshot object created in the newly applied snapshot
will throw an exception when it is accessed, as reported in
the bugs. The solution is to remove the apparent vetiagal code.
Test: ./gradlew :compose:r:r:tDUT
Fixes:
Change-Id: I2c0d0b8f57bf70e5a98ea36ed141d97142a5e53e
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/Snapshot.kt
M compose/runtime/runtime/src/test/kotlin/androidx/compose/runtime/snapshots/SnapshotTests.kt
gi...@googlemail.com <gi...@googlemail.com> #5
Android build and device used are irrelevant for this issue, it will occur on every device and every Android version that uses the Compat implementation of Android Biometrics. Sample project or APK would be possible but way too much effort for this rather simple developer problem. Bug capturing is not possible, because this is a library flaw. Please hand this issue over to the BiometricPrompt developing folks (the ones who produced biometric-1.0.0-alpha03), they'll immediately understand the problem. Cheers, Gisbert
Description
biometric-1.0.0-alpha03
- Steps to reproduce the problem (including sample code if appropriate).
Create two instances of BiometricPrompt for the same FragmentActivity with different callbacks (i.e. for encryption and decryption).
- What happened.
After calling authenticate() on either BiometricPrompt instance, always the first callback is called.
- What you think the correct behavior should be.
The proper callback should be called for each BiometricPrompt instance.
- Analysis
The problem is here:
// Create the connection to FingerprintManager
if (mFingerprintHelperFragment == null) {
mFingerprintHelperFragment = FingerprintHelperFragment.newInstance();
mFingerprintHelperFragment.setCallback(mExecutor, mAuthenticationCallback);
}
mFingerprintHelperFragment.setHandler(mFingerprintDialogFragment.getHandler());
mFingerprintHelperFragment.setCryptoObject(crypto);
If there still is a FingerprintHelperFragment, the callback won't be set.
The line
mFingerprintHelperFragment.setCallback(mExecutor, mAuthenticationCallback);
should be outside of the block
if (mFingerprintHelperFragment == null) {}
Otherwise, if the FingerprintHelperFragment is obtained from the FragmentManager and therefore not null, the callback will not be set. In effect the Fragment will call the wrong callback.
As a workaround, I remove the FingerprintHelperFragment in the callback to make sure the correct callback is set next time (ugly, but works).