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

app.memoryTrimLevel metadata attribute #1344

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Aug 16, 2021

Goal

Add the app.memoryTrimLevel metadata attribute for Android error reports. This reports a human-readable description of the most recent value delivered to onTrimMemory.

Design

Introduced MemoryTrimState to encapsulate the lowMemory and memoryTrimLevel values and firing the StateEvent.UpdateMemoryTrimEvents to registered Observers. This also helps to synchronise the state when new Observers (such as the NDK Plugin) are registered, ensuring that events originating from the NDK always have the appropriate fields.

Testing

Tested manually, and adjustments to existing tests.

@lemnik lemnik requested a review from kattrali August 16, 2021 10:19
@lemnik lemnik force-pushed the PLAT-7108/memory-trim-level-attribute branch 4 times, most recently from 1ef1a4f to 9fe3e38 Compare August 17, 2021 08:42
bsg_request_env_write_lock();
bugsnag_event_add_metadata_bool(&bsg_global_env->next_event, "app",
"lowMemory", (bool)new_value);
"low_memory", (bool)low_memory);
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this casing change intentional?

Suggested change
"low_memory", (bool)low_memory);
"lowMemory", (bool)low_memory);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, absolutely not! thanks for spotting that

@lemnik lemnik force-pushed the PLAT-7108/memory-trim-level-attribute branch from 9fe3e38 to 0806942 Compare August 17, 2021 09:27
@lemnik lemnik merged commit 03c5ee4 into next Aug 17, 2021
@lemnik lemnik deleted the PLAT-7108/memory-trim-level-attribute branch August 17, 2021 10:11
@lemnik lemnik mentioned this pull request Aug 26, 2021
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.

2 participants