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

Commit efd40ba9 authored by Yeabkal Wubshit's avatar Yeabkal Wubshit
Browse files

Ensure font is loaded by PHASE_SYSTEM_SERVICES_READY

This is needed to fix the corner cases where system_server tries to draw
some text before FontManagerService is initialized.

Bug: 327941215
Test: successful boot
Change-Id: Iee21f13112681fa43fb08828d27dfe34d2e58b41
parent 65dc94c7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -52,6 +52,19 @@ flag {
  bug: "304406888"
}

flag {
  name: "complete_font_load_in_system_services_ready"
  namespace: "text"
  description: "Fix to ensure that font loading is complete on system-services-ready boot phase."
  # Make read only, as font loading is in the critical boot path which happens before the read-write
  # flags propagate to the device.
  is_fixed_read_only: true
  bug: "327941215"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "phrase_strict_fallback"
  namespace: "text"
+5 −1
Original line number Diff line number Diff line
@@ -165,7 +165,11 @@ public final class FontManagerService extends IFontManager.Stub {

        @Override
        public void onBootPhase(int phase) {
            if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
            final int latestFontLoadBootPhase =
                    (Flags.completeFontLoadInSystemServicesReady())
                            ? SystemService.PHASE_SYSTEM_SERVICES_READY
                            : SystemService.PHASE_ACTIVITY_MANAGER_READY;
            if (phase == latestFontLoadBootPhase) {
                // Wait for FontManagerService to start since it will be needed after this point.
                mServiceStarted.join();
            }