Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[android] - harden offline region creation / update LatLngBounds #8517

Merged
merged 1 commit into from
Mar 24, 2017

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Mar 24, 2017

Closes #8514
Closes #4321

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Mar 24, 2017
@tobrun tobrun added this to the android-v5.1.0 milestone Mar 24, 2017
@tobrun tobrun self-assigned this Mar 24, 2017
@mention-bot
Copy link

@tobrun, thanks for your PR! By analyzing this pull request, we identified @zugaldia to be potential reviewers.

@@ -114,6 +116,7 @@ public void run() {
}).start();
}

@UiThread
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobrun Why are we requiring @UiThread for methods here? I'm thinking of issues if the developer wants to download regions from a background thread, say from a Service.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was a requirement as the manager itself must be loaded from main thread afaik, let me fix this up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobrun Is it currently possible to get the manager instance from the main thread but then call the other methods in a separate thread?

@@ -34,47 +35,40 @@ public void beforeTest() {
.build();
}

@Test
public void testSanity() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobrun Why is necessary to remove this test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A sanity test becomes obsolete when there other tests that indirectly test the same thing (this is a common test driven development practice).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always keep those, well, to make sure I keep my sanity ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm all down for keeping you sane! Will keep them.

@@ -194,6 +211,66 @@ public void testOuterUnion() {
}

@Test
public void northWest() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobrun For all these new methods, could we add specific tests for cases where latitude and/or longitude are crossing their limits (i.e International Date Line)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if there is a reason for it as it's valid to construct a bounds that is not found inside of the world bounds (eg. no wrapping should be enforced by LatLngBounds). The current LatLngBounds logic now matches what core exposes. FWIW this is also the reason why this PR only validates creation of an offline region instead of enforcing this with LatLngBounds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about developers using this class outside offline cases. If wrapping is not tested at the core level either, then it's fine to leave it there but I'd make a note in Javadoc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this in class javadoc

@tobrun tobrun force-pushed the tvn-latlngbounds branch 2 times, most recently from 3719e71 to ff0e27f Compare March 24, 2017 15:24
@tobrun tobrun merged commit 66ed1a1 into master Mar 24, 2017
@tobrun tobrun deleted the tvn-latlngbounds branch March 24, 2017 17:41
@tobrun tobrun mentioned this pull request May 2, 2017
12 tasks
@tobrun tobrun mentioned this pull request Jun 9, 2017
12 tasks
@tobrun tobrun mentioned this pull request Jun 21, 2017
11 tasks
@tobrun tobrun mentioned this pull request Jun 30, 2017
16 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants