You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "byronaltice (via GitHub)" <gi...@apache.org> on 2024/08/13 19:33:16 UTC
[PR] (android) catch RecoverableSecurityException [cordova-plugin-camera]
byronaltice opened a new pull request, #896:
URL: https://github.com/apache/cordova-plugin-camera/pull/896
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
Android
### Motivation and Context
#679 #660 #656 Closes #679 Closes #660 Closes #679
### Description
Catch the RecoverableSecurityException and Requests permission to delete the media from the media store. see https://developer.android.com/training/data-storage/shared/media#update-other-apps-files
### Testing
Using a Ulefone Armor 8, Android 10, api 29
### Checklist
* [x] I've run the tests to see all new and existing tests pass
* [x] I added automated test coverage as appropriate for this change
* [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
* [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
* [x] I've updated the documentation if necessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] (android) catch RecoverableSecurityException [cordova-plugin-camera]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek closed pull request #896: (android) catch RecoverableSecurityException
URL: https://github.com/apache/cordova-plugin-camera/pull/896
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] (android) catch RecoverableSecurityException [cordova-plugin-camera]
Posted by "cfrank19 (via GitHub)" <gi...@apache.org>.
cfrank19 commented on PR #896:
URL: https://github.com/apache/cordova-plugin-camera/pull/896#issuecomment-2415346785
I believe my team is running into this issue - any way we can get a release with this update?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] (android) catch RecoverableSecurityException [cordova-plugin-camera]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on PR #896:
URL: https://github.com/apache/cordova-plugin-camera/pull/896#issuecomment-2442133867
This is made obsolete by #907 which removed the code that required handling `RecoverablySecurityException`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] (android) catch RecoverableSecurityException [cordova-plugin-camera]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on PR #896:
URL: https://github.com/apache/cordova-plugin-camera/pull/896#issuecomment-2439044503
@byronaltice
Looking for some opinions... I have drafted https://github.com/apache/cordova-plugin-camera/pull/907 (https://github.com/apache/cordova-plugin-camera/pull/907/commits/242cd45be8e81bece437902176160ebc24a4119e for the actual changes specific to that PR) which completely removes `checkForDuplicateImage` and tracking the `numpics`. The details are in #907 but I'll summarise the rationale here.
The code obviously is attempting to determine if capturing an image is resulting in a duplicate entry in the gallery. I'm assuming this is if the user is also using `saveToPhotoAlbum` option on image captures, but the camera intent also stores the captured image in the gallery. It's also ancient, this was in the code base since the initial commit, so it's hard to say for certain. I can say in my testing, I'm not seeing any duplicates.
Overall the code works is it queries the media store and counts how many images are available when you start capturing a picture. And then it does it again at the end of processing the captured photo to determine if there was a duplicate.
The problem I have though is if you think about it logically, any app at any time can insert images or media into the gallery. If this occurs, it will obviously trip up these count checks. I don't see how this guarantees that it is even selecting the "duplicate" image to delete. I think it is possible that the camera could be attempting to delete a completely unrelated photo. Even if some camera apps insert the captured photo themselves, which would cause a duplicate if `saveToPhotoAlbum` is used, the way this handling that "duplicate" is unsafe, in my opinion.
Wondering if you have some time to analyse and see if you can come to the same conclusion?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org