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

Commit a6fac5d6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Deprecate fonts.xml and add hidden font_fallback.xml" into main

parents 944f5358 e3510a82
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -52,3 +52,8 @@ prebuilt_etc {
    name: "fonts.xml",
    src: "fonts.xml",
}

prebuilt_etc {
    name: "font_fallback.xml",
    src: "font_fallback.xml",
}
+1626 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -17,4 +17,5 @@
PRODUCT_PACKAGES := \
    DroidSansMono.ttf \
    AndroidClock.ttf \
    font_fallback.xml \
    fonts.xml
+12 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    DEPRECATED: This XML file is no longer a source of the font files installed
    in the system.

    For the device vendors: please add your font configurations to the
    platform/frameworks/base/data/font_fallback.xml and also add it to this XML
    file as much as possible for apps that reads this XML file.

    For the application developers: please stop reading this XML file and use
    android.graphics.fonts.SystemFonts#getAvailableFonts Java API or
    ASystemFontIterator_open NDK API for getting list of system installed
    font files.

    WARNING: Parsing of this file by third-party apps is not supported. The
    file, and the font files it refers to, will be renamed and/or moved out
    from their respective location in the next Android release, and/or the
+14 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ import java.util.Set;
public final class SystemFonts {
    private static final String TAG = "SystemFonts";

    private static final String FONTS_XML = "/system/etc/fonts.xml";
    private static final String FONTS_XML = "/system/etc/font_fallback.xml";
    /** @hide */
    public static final String SYSTEM_FONT_DIR = "/system/fonts/";
    private static final String OEM_XML = "/product/etc/fonts_customization.xml";
@@ -207,6 +207,19 @@ public final class SystemFonts {
        fallbackListMap.put(familyName, fallback);
    }

    /**
     * Get the updated FontConfig for testing purposes.
     * @hide
     */
    public static @NonNull FontConfig getSystemFontConfigForTesting(
            @NonNull String fontsXmlPath,
            @Nullable Map<String, File> updatableFontMap,
            long lastModifiedDate,
            int configVersion) {
        return getSystemFontConfigInternal(fontsXmlPath, SYSTEM_FONT_DIR, OEM_XML, OEM_FONT_DIR,
                updatableFontMap, lastModifiedDate, configVersion);
    }

    /**
     * Get the updated FontConfig.
     *
Loading