-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix issue 665 #700
Bugfix issue 665 #700
Conversation
@breautek @jcesarmobile @erisu Is anybody able to review this PR? Kind regards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
make even
…Instance) and restore it back.
35ea4c9
to
db4be57
Compare
Co-authored-by: Tim Brust <[email protected]>
@timbru31 thanks for the review. I did commit your suggestion. |
Generally I like to have 2 green checks, but I'll merge sometime Monday assuming there are no objections. Sooner if I get another green check from a PMC member. |
Tests are green, and haven't had any objections so merging! Thank you for your contribution @PieterVanPoyer |
Hi there, |
Any chance for a merge or at least a comment on #712 ? |
Bugfix issue 665 (apache#700)
I've also updated the latest plugin 5.0.2, but the same problems occur on Android 10 (device - redmi note 7pro). The plugin 5.0.2. Forcefully close the application once we capture a photo. This happens on some specific devices. Please update the new version I'm waiting for the new version I'm waiting for your response, thanks |
Hi all, Cordova 9.0.0 |
* apacheGH-665 - store the imageFilePath when the app is paused (onSaveInstance) and restore it back. * Update src/android/CameraLauncher.java whitespace layout Co-authored-by: Tim Brust <[email protected]> Co-authored-by: Tim Brust <[email protected]> (cherry picked from commit f704689)
Platforms affected
Android
Motivation and Context
Fixes #665
Fixes #696
Description
In the processResultFromCamera method, the imageFilePath is used.
https://github.com/apache/cordova-plugin-camera/blob/master/src/android/CameraLauncher.java#L475
It was not restored when the activity was destroyed.
cordova-plugin-camera/src/android/CameraLauncher.java
Line 1356 in b43c78b
This resulted in a NullPointerException because the resulting sourcePath was null.
cordova-plugin-camera/src/android/CameraLauncher.java
Line 473 in b43c78b
So I've added the imageFilePath to the state Bundle in the saveInstance and the restoreInstance methods.
You can install and test the plugin (on Android) with next command.
You could test it with next reproduction repo:
https://github.com/PieterVanPoyer/cordova-camera-plugin-testing-app
Testing
Tested it on an Android 10 emulator.
I enabled the developers mode on the emulator and made the activity destroy everytime the camera is shown.
So I forced the resume flow on Android
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)