5196: Fix in-app camera location loss (#5249)

Merging as this is a great improvement, additional issues/bugs can be filed as GitHub issues.

* fix in-app camera location loss

* fix failing unit tests

* UploadMediaDetailFragmentUnitTest: modify testOnActivityResultAddLocationDialog to have null location

* reintroduce removed variable

* enable prePopulateCategoriesAndDepictionsBy for current user location

* add relevant comment and fix failing test

* modify dialog and disable location tag redaction from EXIF

* modify in-app camera dialog flow and change location to inAppPictureLocation

* change location to inAppPictureLocation

* fix location flow

* preferences.xml: remove redundant default value

* inform users about location loss happening for first upload

* FileProcessor.kt: remove commented-out code

* prevent user location from getting attached to images with no EXIF location in normal and custom selector

* handle onPermissionDenied for location permission

* remove last location when the user turns the GPS off

* disable photo picker and in app camera preferences in settings for logged-out users

* remove debug statements and add toast inside runnables
This commit is contained in:
Ritika Pahwa 2023-09-01 12:15:50 +05:30 committed by GitHub
parent 1cab938d81
commit 5073ca08c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 537 additions and 92 deletions

View file

@ -190,6 +190,8 @@
<string name="read_storage_permission_rationale">Required permission: Read external storage. App cannot access your gallery without this.</string>
<string name="write_storage_permission_rationale">Required permission: Write external storage. App cannot access your camera/gallery without this.</string>
<string name="location_permission_title">Requesting Location Permission</string>
<string name="in_app_camera_location_permission_title">Record location for in-app shots</string>
<string name="in_app_camera_location_switch_pref_summary">Enable this to record location with in-app shots in case the device camera does not record it</string>
<string name="ok">OK</string>
<string name="warning">Warning</string>
<string name="duplicate_file_name">Duplicate File Name found</string>
@ -440,6 +442,13 @@ Upload your first media by tapping on the add button.</string>
<string name="ends_on">Ends on:</string>
<string name="display_campaigns">Display campaigns</string>
<string name="display_campaigns_explanation">See the ongoing campaigns</string>
<string name="in_app_camera_location_access_explanation">Allow the app to fetch location in case the camera does not record it. Some device cameras do not record location. In such cases, letting the app fetch and attach location to it makes your contribution more useful. You may change this any time from the Settings</string>
<string name="option_allow">Allow</string>
<string name="option_dismiss">Dismiss</string>
<string name="in_app_camera_needs_location">Please turn on location access from the Settings and try again. \n\nNote: The upload may not have location if app is unable to retrieve location from device within a short interval.</string>
<string name="in_app_camera_location_permission_rationale">In-app camera needs location permission to attach it to your images in case location is not available in EXIF. Please allow the app to access your location and try again.\n\nNote: The upload may not have location if app is unable to retrieve location from device within a short interval.</string>
<string name="in_app_camera_location_permission_denied">The app would not record location along with in-shots due to lack of location permission</string>
<string name="in_app_camera_location_unavailable">The app would not record location along with in-shots as the GPS is turned off</string>
<string name="open_document_photo_picker_title">Use document based photo picker</string>
<string name="open_document_photo_picker_explanation">The new Android photo picker risks losing location information. Enable if you seem to be using it.</string>
<string name="location_loss_warning">Turning this off could trigger the new Android photo picker. It risks losing location information.\n\nTap on \'Read more\' for more information.</string>