diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-10 19:48:36 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-10 19:48:36 +0200 |
commit | fd81491b059983eb9bcafc91eb91055174bce131 (patch) | |
tree | 4480b0b6dea32a80c2f69e93c67204d633fada75 /src/main/java/eu/siacs/conversations/services | |
parent | d30515a85acaedb57d0d4308aeb72d96074f729a (diff) |
put wake locks on out of band file transfers
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java b/src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java index dbd7f376..1b49e365 100644 --- a/src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java +++ b/src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java @@ -1,5 +1,7 @@ package eu.siacs.conversations.services; +import android.content.Context; +import android.os.PowerManager; import android.util.Log; import android.util.Pair; @@ -118,4 +120,9 @@ public class AbstractConnectionManager { return null; } } + + public PowerManager.WakeLock createWakeLock(String name) { + PowerManager powerManager = (PowerManager) mXmppConnectionService.getSystemService(Context.POWER_SERVICE); + return powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,name); + } } |