Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9248444 authored by Kohsuke Yatoh's avatar Kohsuke Yatoh
Browse files

Don't use serialized system font map if disabled.

Bug: 174672300
Test: device boots
Change-Id: I6ec96f6d2629b082a87997e86960234fac65ca57
parent 9e442109
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -6417,12 +6417,14 @@ public final class ActivityThread extends ClientTransactionHandler {
         */
        LocaleList.setDefault(data.config.getLocales());

        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) {
            /*
+3 −0
Original line number Diff line number Diff line
@@ -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();