Merge "Reuse computed font mapping for preinstalled system font config." into sc-dev

This commit is contained in:
Seigo Nonaka
2021-02-04 20:47:34 +00:00
committed by Android (Google) Code Review

View File

@@ -219,7 +219,13 @@ public final class FontManagerService extends IFontManager.Stub {
private void initialize() {
synchronized (mUpdatableFontDirLock) {
if (mUpdatableFontDir == null) {
updateSerializedFontMap();
synchronized (mSerializedFontMapLock) {
try {
mSerializedFontMap = Typeface.serializeFontMap(Typeface.getSystemFontMap());
} catch (IOException | ErrnoException e) {
mSerializedFontMap = null;
}
}
return;
}
if (mFontCrashDetector.hasCrashed()) {