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

Commit ab3ef104 authored by Karl Rosaen's avatar Karl Rosaen
Browse files

Run background threads associated with filtering at background priority.

This improves the typing responsiveness in the browser a lot, and should
help out in all the other cases in the UI where we use a filter thread.
parent f7703519
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -85,7 +85,8 @@ public abstract class Filter {
    public final void filter(CharSequence constraint, FilterListener listener) {
    public final void filter(CharSequence constraint, FilterListener listener) {
        synchronized (mLock) {
        synchronized (mLock) {
            if (mThreadHandler == null) {
            if (mThreadHandler == null) {
                HandlerThread thread = new HandlerThread(THREAD_NAME);
                HandlerThread thread = new HandlerThread(
                        THREAD_NAME, android.os.Process.THREAD_PRIORITY_BACKGROUND);
                thread.start();
                thread.start();
                mThreadHandler = new RequestHandler(thread.getLooper());
                mThreadHandler = new RequestHandler(thread.getLooper());
            }
            }