Merge "Don't use serialized system font map if disabled."
This commit is contained in:
committed by
Android (Google) Code Review
commit
6095771fe5
@@ -6417,11 +6417,13 @@ public final class ActivityThread extends ClientTransactionHandler {
|
||||
*/
|
||||
LocaleList.setDefault(data.config.getLocales());
|
||||
|
||||
try {
|
||||
Typeface.setSystemFontMap(data.mSerializedSystemFontMap);
|
||||
} catch (IOException | ErrnoException e) {
|
||||
Slog.e(TAG, "Failed to parse serialized system font map");
|
||||
Typeface.loadPreinstalledSystemFontMap();
|
||||
if (Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION) {
|
||||
try {
|
||||
Typeface.setSystemFontMap(data.mSerializedSystemFontMap);
|
||||
} catch (IOException | ErrnoException e) {
|
||||
Slog.e(TAG, "Failed to parse serialized system font map");
|
||||
Typeface.loadPreinstalledSystemFontMap();
|
||||
}
|
||||
}
|
||||
|
||||
synchronized (mResourcesManager) {
|
||||
|
||||
@@ -64,6 +64,9 @@ public final class FontManagerService {
|
||||
|
||||
@Nullable
|
||||
private SharedMemory getSerializedSystemFontMap() {
|
||||
if (!Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION) {
|
||||
return null;
|
||||
}
|
||||
synchronized (FontManagerService.this) {
|
||||
if (mSerializedSystemFontMap == null) {
|
||||
mSerializedSystemFontMap = createSerializedSystemFontMapLocked();
|
||||
|
||||
Reference in New Issue
Block a user