1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

Use Executors.newSingleThreadScheduledExecutor

and remove the calls to setMaximumPoolSize() and steKeepAliveTime()
since they are ineffective on Android.
This commit is contained in:
Florian Schmaus 2015-02-25 16:14:16 +01:00
parent 39382b8b38
commit 404b90054b
2 changed files with 4 additions and 6 deletions

View file

@ -21,9 +21,9 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -117,7 +117,7 @@ public class PingManager extends Manager {
private PingManager(XMPPConnection connection) {
super(connection);
executorService = new ScheduledThreadPoolExecutor(1,
executorService = Executors.newSingleThreadScheduledExecutor(
new SmackExecutorThreadFactory(connection.getConnectionCounter(), "Ping"));
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
sdm.addFeature(Ping.NAMESPACE);