Monkey crashes (#10440)

* [android] - avoid null map from trackballevent

* [android] - fixup animated marker test activity from monkey runs

* [android] - harden NativeMapView OnMapChangeListener

* [android] - harden against destroyed wrapper activity while moving touch pointers

* [android] - harden bulk marker activity for monkey runner

* [android] - harden scale end gesture event for null velocity tracker

* [android] - invalid mapboxMap invocation

* [android] - reset test setup
This commit is contained in:
Tobrun
2017-11-10 16:33:51 +01:00
committed by GitHub
parent 225fba8a0a
commit a47f8245da
5 changed files with 35 additions and 18 deletions

View File

@@ -236,12 +236,14 @@ public class AnimatedMarkerActivity extends AppCompatActivity {
stopped = true;
// Stop ongoing animations, prevent memory lekas
MarkerViewManager markerViewManager = mapboxMap.getMarkerViewManager();
for (MarkerView markerView : markerViews) {
View view = markerViewManager.getView(markerView);
if (view != null) {
view.animate().cancel();
// Stop ongoing animations, prevent memory leaks
if (mapboxMap != null) {
MarkerViewManager markerViewManager = mapboxMap.getMarkerViewManager();
for (MarkerView markerView : markerViews) {
View view = markerViewManager.getView(markerView);
if (view != null) {
view.animate().cancel();
}
}
}

View File

@@ -100,6 +100,10 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView
}
private void showMarkers(int amount) {
if (mapboxMap == null || locations == null) {
return;
}
mapboxMap.clear();
if (locations.size() < amount) {