mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Introduce thread priorities for threads and handlerthreads.
This commit is contained in:
@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.signal.core.util.ExceptionUtil;
|
||||
import org.signal.core.util.ThreadUtil;
|
||||
import org.signal.core.util.concurrent.SignalExecutors;
|
||||
import org.thoughtcrime.securesms.notifications.v2.DefaultMessageNotifier;
|
||||
import org.thoughtcrime.securesms.notifications.v2.ConversationId;
|
||||
@@ -28,7 +29,7 @@ public class OptimizedMessageNotifier implements MessageNotifier {
|
||||
|
||||
@MainThread
|
||||
public OptimizedMessageNotifier(@NonNull Application context) {
|
||||
this.limiter = new LeakyBucketLimiter(5, 1000, new Handler(SignalExecutors.getAndStartHandlerThread("signal-notifier").getLooper()));
|
||||
this.limiter = new LeakyBucketLimiter(5, 1000, new Handler(SignalExecutors.getAndStartHandlerThread("signal-notifier", ThreadUtil.PRIORITY_IMPORTANT_BACKGROUND_THREAD).getLooper()));
|
||||
this.defaultMessageNotifier = new DefaultMessageNotifier(context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user