signalapp / signalapp/Signal-Android
Inappropriate way of sending locations is used
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 29.4k
- Forks
- 6.9k
- PR merge metrics
- No merged PRs in 30d
Description
The Signal app currently uses the following method of sharing a user's location, after the user has selected a location on the in-app map.
- Load Google Map.
- Wait for Google Map to finish loading.
- Take snapshot of Google Map.
- Remove Google Map and replace it with its snapshot.
- Once the user hits send, send this snapshot as an image.
This is implemented in the following snippet:
The two issues are:
- 1.-4. is an inappropriate way of generating a snapshot. It is better to use a lite mode map instead, because this implements exactly what is needed (non-interactive snapshot of a map).
- An instance in which the current implementation is inappropriate is when
onMapLoadedandonSnapshotReadyhave not yet been called, but the activity hosting the map is destroyed. In this case, the activity'sonDestroymethod must call the map'sonDestroymethod (which is not implemented). Lite mode maps do not expect lifecycle methods to be called, except foronCreate. - In fact, Signal currently forgets to call a few of the lifecycle methods. See https://github.com/signalapp/Signal-Android/pull/13008.
- Additional info: this is also related to https://github.com/signalapp/Signal-Android/issues/12723#issuecomment-1595810834, because microG does not implement
GoogleMap.OnMapLoadedCallbackcorrectly (https://github.com/microg/GmsCore/issues/1960).
- An instance in which the current implementation is inappropriate is when
- 5. is in violation of the contract of the
snapshotAPI, and by extension likely also of the terms of usage of the Google Maps API.Note: Images of the map must not be transmitted to your servers, or otherwise used outside of the application. If you need to send a map to another application or user, send data that allows them to reconstruct the map for the new user instead of a snapshot.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read SignalMapView.java around lines 77-96 and the linked Google Maps Lite mode lifecycle guidance. Compare the current snapshot flow with the location-send path and review PR #13008 for related lifecycle omissions. Done means the map-sharing flow no longer transmits a map snapshot and follows the documented API constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100