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

Commit 90b6f049 authored by Yeabkal Wubshit's avatar Yeabkal Wubshit
Browse files

Avoid loading system font map twice.

In ag/23835644, pre-installed system font maps are loaded if
mUpdatableFontDir==null, so there's no need to set system font map again
at the end of the constructor.

Bug: 290301535
Test: presubmit
Change-Id: I820e8433e309e2a706f9f32798a1b0c79b36c8ee
parent c41e0701
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -228,12 +228,17 @@ public final class FontManagerService extends IFontManager.Stub {
        mIsSafeMode = safeMode;
        initialize();

        // Set system font map only if there is updatable font directory.
        // If there is no updatable font directory, `initialize` will have already loaded the
        // system font map, so there's no need to set the system font map again here.
        if  (mUpdatableFontDir != null) {
            try {
                Typeface.setSystemFontMap(getCurrentFontMap());
            } catch (IOException | ErrnoException e) {
                Slog.w(TAG, "Failed to set system font map of system_server");
            }
        }
    }

    @Nullable
    private UpdatableFontDir createUpdatableFontDir() {