Fix location handling for gallery uploads in Nearby flow#6739
Open
devendrachoudharycodes wants to merge 1 commit intocommons-app:mainfrom
Open
Fix location handling for gallery uploads in Nearby flow#6739devendrachoudharycodes wants to merge 1 commit intocommons-app:mainfrom
devendrachoudharycodes wants to merge 1 commit intocommons-app:mainfrom
Conversation
Contributor
Shoaibkhalid65
left a comment
There was a problem hiding this comment.
The fix looks correct. Combining isInAppCameraUpload && locationDifference > 100 properly gates the distance check to camera-only uploads. One thought: since LOCATION_BEFORE_IMAGE_CAPTURE is never passed in the intent for gallery uploads, it might be worth adding a brief inline comment on this condition explaining why the distance check is skipped for gallery — makes the intent clearer for future contributors. Otherwise the logic is sound and the fix addresses the root cause cleanly.
…images since capture location is not passed in intent from Nearby to Upload screeand comments to the code for future ref
b0b4346 to
462d29c
Compare
Contributor
Author
|
@Shoaibkhalid65 thanks for pointing it out just did that 😊.. please check this out |
|
✅ Generated APK variants! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When selecting an image from the gallery for Nearby uploads, the selected place location was not automatically applied.
This happened because the previous condition contained
!isInAppCameraUpload. Since gallery images are not captured using the in-app camera,!isInAppCameraUploadevaluated totrue, causing the location validation block to always execute and preventing the selected nearby location from being applied.Additionally, the location difference check relies on
LOCATION_BEFORE_IMAGE_CAPTUREi.e.prevLocation, which is only passed in the intent when an image is captured using the in-app camera. For gallery uploads this value is not available, so the distance validation is not applicable.Fixes #5073
The condition was updated to remove
!isInAppCameraUploadand instead apply the distance validation only when the image is captured using the in-app camera:(isInAppCameraUpload && locationDifference > 100)This ensures that:
LOCATION_BEFORE_IMAGE_CAPTUREis not passed in the intent.Tested ProdDebug on Pixel 5 emulator with API level 33.
Steps tested:
Screenshot

Before
After
