diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index c00803d1c..75231f037 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -154,7 +154,7 @@ public class XmppConnectionService extends Service { private final List<Conversation> conversations = new CopyOnWriteArrayList<>(); private final IqGenerator mIqGenerator = new IqGenerator(this); private final List<String> mInProgressAvatarFetches = new ArrayList<>(); - + private WakeLock wakeLock; private long mLastActivity = 0; public DatabaseBackend databaseBackend; @@ -363,7 +363,6 @@ public class XmppConnectionService extends Service { }; private OpenPgpServiceConnection pgpServiceConnection; private PgpEngine mPgpEngine = null; - private WakeLock wakeLock; private PowerManager pm; private LruCache<String, Bitmap> mBitmapCache; private EventReceiver mEventReceiver = new EventReceiver(); @@ -581,12 +580,16 @@ public class XmppConnectionService extends Service { @Override protected Boolean doInBackground(String... params) { + PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE); + wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"CompressPixArtMessengerVideo"); + wakeLock.acquire(); return MediaController.getInstance().convertVideo(originalpath, compressedpath); } @Override protected void onPostExecute(Boolean compressed) { super.onPostExecute(compressed); + wakeLock.release(); if (mListener != null) { mListener.videocompressed(compressed); Log.d(Config.LOGTAG, "Compression successfully!"); |