Fixed
Status Update
Comments
wu...@google.com <wu...@google.com> #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.
bo...@withvector.com <bo...@withvector.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
bo...@withvector.com <bo...@withvector.com> #4
Yes, 1.3.0-alpha06, typo'd
wu...@google.com <wu...@google.com> #5
thanks for the update! We will take a look and update the status here.
ch...@google.com <ch...@google.com>
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit ebd52aac76e1410b9361888a9efc9de6f30cc799
Author: Charcoal Chen <charcoalchen@google.com>
Date: Mon May 15 15:45:07 2023
Fix NullPointerException when the cached output sizes in StreamConfigurationMapCompat are null
Relnote: "Fixed NullPointerException when the cached output sizes in StreamConfigurationMapCompat are null."
Bug: 282025204
Test: StreamConfigurationMapCompatTest
Change-Id: Idf124b2054ca12fa58d66b53e4206ceb49493782
M camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/compat/StreamConfigurationMapCompatTest.kt
M camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/StreamConfigurationMapCompat.java
M camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/StreamConfigurationMapCompatTest.kt
https://android-review.googlesource.com/2588688
Branch: androidx-main
commit ebd52aac76e1410b9361888a9efc9de6f30cc799
Author: Charcoal Chen <charcoalchen@google.com>
Date: Mon May 15 15:45:07 2023
Fix NullPointerException when the cached output sizes in StreamConfigurationMapCompat are null
Relnote: "Fixed NullPointerException when the cached output sizes in StreamConfigurationMapCompat are null."
Bug: 282025204
Test: StreamConfigurationMapCompatTest
Change-Id: Idf124b2054ca12fa58d66b53e4206ceb49493782
M camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/compat/StreamConfigurationMapCompatTest.kt
M camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/StreamConfigurationMapCompat.java
M camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/StreamConfigurationMapCompatTest.kt
ch...@google.com <ch...@google.com>
ju...@google.com <ju...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.camera:camera-camera2:1.3.0-alpha07
Description
Please describe your issue and include details such as the version of CameraX you are using and any relevant logs related to your issue.
// If at all possible, capture an Android logcat (
CAMERAX VERSION 1.0.0.alpha06
CAMERA APPLICATION NAME AND VERSION: Vector (com.convoy.loaddoc) version 10.8.509
ANDROID OS BUILD NUMBER: OPPS27.91-99-9-15
DEVICE NAME: Motorola E5
DESCRIPTION: NullPointerException in cameraProvider.bindToLifecycle on devices that have no high resolution modes.
The problem is if `mImpl.getHighResolutionOutputSizes(format);` returns null (see code fragment below), it will still cache it, and the second invocation will retrieve the null and attempt to call clone(), crashing the app.
The `mCachedFormatHighResolutionOutputSizes.put(format, outputSizes);` line should be moved into the body of the if statement, and/or a null check should be added to the fetch before calling clone().
LIST ANY EXPERIMENTAL FEATURES: (As an example - @ExperimentalCamera2Interop)
none
STEPS TO REPRODUCE:
1. Launch app and login
2. Start a workflow by clicking the + button in the bottom right
3. Find a camera icon and click it.
4. Go through the image capture sequence.
5. Click "add image" to add a second image next to the first
6. Click the image capture (shutter) button
OBSERVED RESULTS:
The app displays a crash alert
EXPECTED RESULTS:
The app should not crash
REPRODUCIBILITY: (5 of 5, 1 of 100, etc)
ADDITIONAL INFORMATION:
CODE FRAGMENTS (this will help us troubleshoot your issues):
@Nullable
public Size[] getHighResolutionOutputSizes(int format) {
if (mCachedFormatHighResolutionOutputSizes.containsKey(format)) {
return mCachedFormatHighResolutionOutputSizes.get(format).clone();
}
Size[] outputSizes = mImpl.getHighResolutionOutputSizes(format);
// High resolution output sizes can be null.
if (outputSizes != null && outputSizes.length > 0) {
outputSizes = mOutputSizesCorrector.applyQuirks(outputSizes, format);
}
mCachedFormatHighResolutionOutputSizes.put(format, outputSizes);
return outputSizes != null ? outputSizes.clone() : null;
}