Load preinstalled sytem font if fs-verity is not supported

Some form factor doesn't support fs-verity and it ends up with NPE
during boot because of empty system font map.
To work on such environment, load preinstalled system font before
serializing system font map.

Bug: N/A
Test: N/A
Change-Id: Ibc4d512e1a70d9e7be889ea7b1e6afa5e45b1bbb
This commit is contained in:
Seigo Nonaka
2023-06-28 09:57:56 +09:00
parent b34177197c
commit 18c3e398e1

View File

@@ -269,6 +269,9 @@ public final class FontManagerService extends IFontManager.Stub {
synchronized (mUpdatableFontDirLock) {
mUpdatableFontDir = createUpdatableFontDir();
if (mUpdatableFontDir == null) {
// If fs-verity is not supported, load preinstalled system font map and use it for
// all apps.
Typeface.loadPreinstalledSystemFontMap();
setSerializedFontMap(serializeSystemServerFontMap());
return;
}