summaryrefslogtreecommitdiff
path: root/services/java/com/android
diff options
context:
space:
mode:
authorKohsuke Yatoh <kyatoh@google.com>2020-12-10 15:24:21 -0800
committerKohsuke Yatoh <kyatoh@google.com>2020-12-10 15:24:21 -0800
commitf0acf2f128486f140711a11283a4a989e3ee2102 (patch)
treefd15f9916e6f7e58824d2b6aed97a97e389a23d2 /services/java/com/android
parent28f5469e4476c78b9f5ca29453572d73ef060463 (diff)
Do not load Typefaces twice in system server.
Zygote should have already loaded them if ENABLE_LAZY_TYPEFACE_INITIALIZATION is false. Bug: 172891184 Test: boot Change-Id: I3c02463b217f31068dc26bf3451cb1d612154230
Diffstat (limited to 'services/java/com/android')
-rw-r--r--services/java/com/android/server/SystemServer.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 6525e1126478..59b28cb841a6 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -678,7 +678,9 @@ public final class SystemServer implements Dumpable {
// Load preinstalled system fonts for system server, so that WindowManagerService, etc
// can start using Typeface. Note that fonts are required not only for text rendering,
// but also for some text operations (e.g. TextUtils.makeSafeForPresentation()).
- Typeface.loadPreinstalledSystemFontMap();
+ if (Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION) {
+ Typeface.loadPreinstalledSystemFontMap();
+ }
// Attach JVMTI agent if this is a debuggable build and the system property is set.
if (Build.IS_DEBUGGABLE) {