Retry "Support loading system font map from SharedMemory."
This is the second try of
commit c7a5b3a90db2f97c1d95332e9bb5b5c0f34084d7, which was reverted in
commit 735d447d4807bb9440b2037bc67e35da95edb209
Changes:
- Use reflection to update static final fields, because some apps and
tests rely on Typeface.create() to return references to static final
fields (which is a behavior resulted from the use of internal cache).
- Make setSystemFontMap() thread safe.
- Hold a reference to ByteBuffer so that the memory won't be unmapped.
Bug: 172891184
Test: atest FrameworksCoreTests:TypefaceTest
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewPrecomputedTextTest
Change-Id: I1dea26c08a8585ea10e866c063bef6d682d8b15e
3 files changed