Skip to content

Add Android 17 safety comment for JNI-written static field#56442

Closed
alanleedev wants to merge 1 commit intofacebook:mainfrom
alanleedev:export-D100831802
Closed

Add Android 17 safety comment for JNI-written static field#56442
alanleedev wants to merge 1 commit intofacebook:mainfrom
alanleedev:export-D100831802

Conversation

@alanleedev
Copy link
Copy Markdown
Contributor

Summary:
AppearanceModule.invalidatePlatformColorCache is set from native via JNI (configurePlatformColorCacheInvalidationHook.cpp). Android 17 crashes if JNI modifies a static final field. Since Kotlin val compiles to static final, this field must remain var. Added a comment to prevent accidental refactoring.

See https://developer.android.com/about/versions/17/behavior-changes-17#static-final-fields

Changelog: [Internal]

Differential Revision: D100831802

Summary:
AppearanceModule.invalidatePlatformColorCache is set from native via JNI (configurePlatformColorCacheInvalidationHook.cpp). Android 17 crashes if JNI modifies a static final field. Since Kotlin `val` compiles to static final, this field must remain `var`. Added a comment to prevent accidental refactoring.

See https://developer.android.com/about/versions/17/behavior-changes-17#static-final-fields


Changelog: [Internal]

Differential Revision: D100831802
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 14, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Apr 14, 2026

@alanleedev has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100831802.

@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Apr 14, 2026

This pull request has been merged in 95e0b5e.

@facebook-github-tools facebook-github-tools bot added the Merged This PR has been merged. label Apr 14, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @alanleedev in 95e0b5e

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants