feat: support setting attributes after handler start#10
Merged
Conversation
Use crashpad's SimpleStringDictionary registered on CrashpadInfo to allow runtime attribute updates. The dictionary lives in process memory and is read directly by the crash handler at crash time. Adds BugSplat.setAttribute() and BugSplat.removeAttribute() public API methods, and updates the example app with a "Set Attribute" button to test the feature. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds support for setting/removing BugSplat crash report attributes at runtime (after init()), backed by Crashpad’s SimpleStringDictionary stored in process memory, and exposes the feature in the example app UI.
Changes:
- Added
BugSplat.setAttribute(key, value)andBugSplat.removeAttribute(key)plus corresponding JNI bridge methods. - Registered a Crashpad
SimpleStringDictionaryviaCrashpadInfoand implemented native setters/removers. - Updated the example app to include a “Set Attribute” button and input dialog for manual testing.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| example/src/main/res/values/styles.xml | Adds a style for the new “Set Attribute” button. |
| example/src/main/res/values/strings.xml | Adds the “Set Attribute” label resource. |
| example/src/main/res/layout/dialog_attribute.xml | New dialog layout for entering key/value pairs. |
| example/src/main/res/layout/activity_main.xml | Adds the new button to the main screen layout. |
| example/src/main/java/com/bugsplat/example/MainActivity.java | Wires the new UI flow to call BugSplat.setAttribute(). |
| app/src/main/java/com/bugsplat/android/BugSplatBridge.java | Adds Java-to-JNI methods for set/remove attribute. |
| app/src/main/java/com/bugsplat/android/BugSplat.java | Adds public SDK API methods and Javadoc. |
| app/src/main/cpp/native-lib.cpp | Implements the Crashpad SimpleStringDictionary registration and JNI set/remove. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4 tasks
daveplunkett
approved these changes
Apr 7, 2026
Fix layout constraint cycle in example app and add null/blank key validation to setAttribute/removeAttribute to prevent JNI crashes. Document SimpleStringDictionary limits in public Javadoc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BugSplat.setAttribute(key, value)andBugSplat.removeAttribute(key)to allow setting crash report attributes afterinit()has been calledSimpleStringDictionaryregistered onCrashpadInfo— the dictionary lives in process memory and is read directly by the crash handler at crash time, so updates are reflected immediatelyTest plan
🤖 Generated with Claude Code