From 8c2400d452cff5535db517ad88f3f0cb107c2542 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 6 Nov 2014 22:44:53 +0100 Subject: Use default priority for sensors thread Background priority might put the thread into the background cgroup which only has access to a limited portion of the CPU. It might be the cause of some lenghty delays (200 seconds) before events are taken into account. There is no guarantee though. Part of work on #4458. --- main/src/cgeo/geocaching/utils/RxUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main/src/cgeo/geocaching/utils/RxUtils.java') diff --git a/main/src/cgeo/geocaching/utils/RxUtils.java b/main/src/cgeo/geocaching/utils/RxUtils.java index 69c3185..c10fd9e 100644 --- a/main/src/cgeo/geocaching/utils/RxUtils.java +++ b/main/src/cgeo/geocaching/utils/RxUtils.java @@ -18,6 +18,7 @@ import rx.subscriptions.Subscriptions; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; +import android.os.Process; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; @@ -35,7 +36,7 @@ public class RxUtils { public static final Scheduler networkScheduler = Schedulers.from(new ThreadPoolExecutor(10, 10, 5, TimeUnit.SECONDS, new LinkedBlockingQueue())); private static final HandlerThread looperCallbacksThread = - new HandlerThread("Looper callbacks thread", android.os.Process.THREAD_PRIORITY_BACKGROUND); + new HandlerThread("Looper callbacks thread", Process.THREAD_PRIORITY_DEFAULT); static { looperCallbacksThread.start(); -- cgit v1.1