diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java')
-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); + } } |