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

Commit b18a57cb authored by Kohsuke Yatoh's avatar Kohsuke Yatoh
Browse files

Set FOREGROUND thread priority to 'fonts' thread.

'fonts' thread will block UI thread, so it should have a higher priority
than DEFAULT.

Bug: 178195682
Test: adb shell "ps -A -l -T" | grep fonts
Change-Id: I4fd67389abcfd7d1b78a3db3dc86422a7a837024
parent ede25d21
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -362,7 +362,8 @@ public class FontsContract {
            // the font provider takes too much time. For now, request the font data to ensure
            // it is in the cache next time and return.
            if (sHandler == null) {
                sThread = new HandlerThread("fonts", Process.THREAD_PRIORITY_BACKGROUND);
                // Use FOREGROUND priority as this thread will block UI thread.
                sThread = new HandlerThread("fonts", Process.THREAD_PRIORITY_FOREGROUND);
                sThread.start();
                sHandler = new Handler(sThread.getLooper());
            }