Skip to content
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

Inapproproate way of sending locations is used #13375

Closed
fynngodau opened this issue Jan 22, 2024 · 0 comments
Closed

Inapproproate way of sending locations is used #13375

fynngodau opened this issue Jan 22, 2024 · 0 comments

Comments

@fynngodau
Copy link
Contributor

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.

  1. Load Google Map.
  2. Wait for Google Map to finish loading.
  3. Take snapshot of Google Map.
  4. Remove Google Map and replace it with its snapshot.
  5. Once the user hits send, send this snapshot as an image.

This is implemented in the following snippet:

public static ListenableFuture<Bitmap> snapshot(final LatLng place, @NonNull final MapView mapView) {
final SettableFuture<Bitmap> future = new SettableFuture<>();
mapView.onCreate(null);
mapView.onStart();
mapView.onResume();
mapView.setVisibility(View.VISIBLE);
mapView.getMapAsync(googleMap -> {
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(place, 13));
googleMap.addMarker(new MarkerOptions().position(place));
googleMap.setBuildingsEnabled(true);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.getUiSettings().setAllGesturesEnabled(false);
googleMap.setOnMapLoadedCallback(() -> googleMap.snapshot(bitmap -> {
future.set(bitmap);
mapView.setVisibility(View.GONE);
mapView.onPause();
mapView.onStop();
mapView.onDestroy();
}));
});

The two issues are:


Previous: #13006

@cody-signal cody-signal closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants