aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-10-11 22:19:28 +0200
committerChristian Schneppe <christian@pix-art.de>2016-10-11 22:19:28 +0200
commit075bc05022eccdbba4c1563995d0689a19342d81 (patch)
tree558b75d42d70f535edc103c1b652b54ab65350eb /src/main/java/de
parent3c030f46ebf6938f85551d0770814ad31d642804 (diff)
fix bug with wake lock for video compression
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 58d1a61af..bd5b30b59 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -580,19 +580,18 @@ public class XmppConnectionService extends Service {
protected void onPreExecute() {
super.onPreExecute();
Log.d(Config.LOGTAG,"Start video compression");
+ wakeLock.acquire();
}
@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();
File video = new File(compressedpath);
if (mListener != null) {
if (video.exists() && video.length() > 0) {
@@ -603,7 +602,6 @@ public class XmppConnectionService extends Service {
Log.d(Config.LOGTAG, "Compression failed!");
}
}
- wakeLock.release();
}
}