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

Re-throw Java exception instead of the native one in the map state callbacks #13285

Closed
LukasPaczos opened this issue Nov 6, 2018 · 0 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@LukasPaczos
Copy link
Contributor

Refs #13050.

Previously, if any Java-caused exception was thrown in a code block invoked from the JNI (OnMapChange events in this case), we were catching that and logging/throwing the Java exception instead of a native one.

@Keep
protected void onMapChanged(int rawChange) {
  for (MapView.OnMapChangedListener onMapChangedListener : onMapChangedListeners) {
    try {
      onMapChangedListener.onMapChanged(rawChange);
    } catch (RuntimeException err) {
      Logger.e(TAG, "Exception in MapView.OnMapChangedListener", err);
      MapStrictMode.strictModeViolation(err);
    }
  }
}

We should re-implement that logic in the newly added state callbacks as well.

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

No branches or pull requests

1 participant