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

Backport JNI error handling fixes to v4 #1127

Merged
merged 16 commits into from
Feb 16, 2021
Merged

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Feb 10, 2021

Goal

Backports the following PRs to the v4 branch for use in bugsnag-unity: #1088 #1091 #1092 #1117

These enhance the error handling around JNI calls by ensuring that exceptions are checked and cleared.

Changeset

The PR consists of 4 commits, which add the new safejni.h functions, then applies them to the source files in the NDK module.

Broadly speaking this was mostly a case of just copying functions over. There were a few structs that were renamed between v4 and v5 (e.g. bsg_metadata_t to bugsnag_metadata) that required alterations, and some method names on the NativeInterface class were renamed. The bugsnag_notify_env and bugsnag_populate_crumb_metadata functions have also been split into multiple functions in v5 - this change has been carried across.

Testing

Performed a smoke test by comparing an NDK error report from the Unity app before and after these changes. Full regression testing will be carried out before release.

@fractalwrench fractalwrench marked this pull request as ready for review February 12, 2021 10:28
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Feb 12, 2021

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1150.44 1108.78
arm64_v8a 333.19 291.76
armeabi -1743.67 -760.82
armeabi_v7a 295.47 254.03
x86 371.92 330.48
x86_64 355.23 313.8

Generated by 🚫 Danger

@fractalwrench fractalwrench removed the request for review from tomlongridge February 16, 2021 11:52
@kstenerud kstenerud self-requested a review February 16, 2021 13:35
@fractalwrench fractalwrench merged commit 983280f into v4-unity Feb 16, 2021
@fractalwrench fractalwrench deleted the PLAT-5957/jni-backport branch February 16, 2021 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants