aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/xmpp
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-01-21 16:59:19 +0100
committerChristian Schneppe <christian@pix-art.de>2018-01-21 16:59:19 +0100
commitca8b091cd896bd8a131cd4c4930bec942f9d5305 (patch)
tree3b45478ae6e7ffb0568333b547f3f4b10b4a7268 /src/main/java/de/pixart/messenger/xmpp
parent1fde63fc5406d2b92ee5412e9c7f2955d3776cf9 (diff)
remove wakelocks in XmlReader
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp')
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/XmppConnection.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
index 4ee5a6a4e..58329609a 100644
--- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
@@ -2,8 +2,6 @@ package de.pixart.messenger.xmpp;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
-import android.os.PowerManager;
-import android.os.PowerManager.WakeLock;
import android.os.SystemClock;
import android.security.KeyChain;
import android.util.Base64;
@@ -107,7 +105,6 @@ public class XmppConnection implements Runnable {
private static final int PACKET_MESSAGE = 1;
private static final int PACKET_PRESENCE = 2;
protected final Account account;
- private final WakeLock wakeLock;
private Socket socket;
private XmlReader tagReader;
private TagWriter tagWriter = new TagWriter();
@@ -234,7 +231,6 @@ public class XmppConnection implements Runnable {
public XmppConnection(final Account account, final XmppConnectionService service) {
this.account = account;
final String tag = account.getJid().toBareJid().toPreppedString();
- this.wakeLock = service.getPowerManager().newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, tag == null ? "[empty bare jid]" : tag);
mXmppConnectionService = service;
}
@@ -469,14 +465,8 @@ public class XmppConnection implements Runnable {
} finally {
if (!Thread.currentThread().isInterrupted()) {
forceCloseSocket();
- if (wakeLock.isHeld()) {
- try {
- wakeLock.release();
- } catch (final RuntimeException ignored) {
- }
- }
} else {
- Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": not force closing socket and releasing wake lock (is held=" + wakeLock.isHeld() + ") because thread was interrupted");
+ Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": not force closing socket because thread was interrupted");
}
}
}
@@ -491,7 +481,7 @@ public class XmppConnection implements Runnable {
throw new InterruptedException();
}
this.socket = socket;
- tagReader = new XmlReader(wakeLock);
+ tagReader = new XmlReader();
if (tagWriter != null) {
tagWriter.forceClose();
}