Open Bug 2038949 Opened 6 months ago Updated 6 months ago

Remove ReflectionUtils.setField

Categories

(Firefox for Android :: Tooling, task)

All
Android
task

Tracking

()

People

(Reporter: mcarare, Unassigned)

References

Details

(Whiteboard: [fxdroid][group6] )

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

Apps running on Android 17 or higher that target Android 17 (API level 37) or higher cannot change static final fields. If an app attempts to change a static final field by using reflection, it will cause an IllegalAccessException. Attempting to modify one of these fields through JNI APIs (such as SetStaticLongField()) will cause the app to crash.

ReflectionUtils.setField would be subject to these changes only if it were to be used for static final fields. As long as it is strictly used for instance final fields (as is currently the case), it will continue to work as expected. However, as Android continues to tighten reflection access, it is recommended to eventually move towards using constructors or mockable interfaces where possible, though this is often difficult with GeckoView's data-only objects.

No longer blocks: 2017262, 2037911
No longer depends on: 2037826
See Also: → 2037826
You need to log in before you can comment on or make changes to this bug.