Use wakelock for mbox export

This commit is contained in:
M66B 2021-04-17 21:18:56 +02:00
parent eba065fb02
commit 9fb1a58036
1 changed files with 99 additions and 89 deletions

View File

@ -29,6 +29,7 @@ import android.graphics.Color;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
import android.os.PowerManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
@ -870,6 +871,12 @@ public class FragmentFolders extends FragmentBase {
@Override
protected Void onExecute(Context context, Bundle args) throws Throwable {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(
PowerManager.PARTIAL_WAKE_LOCK, BuildConfig.APPLICATION_ID + ":mbox");
try {
wl.acquire();
long fid = args.getLong("id");
Uri uri = args.getParcelable("uri");
@ -963,6 +970,9 @@ public class FragmentFolders extends FragmentBase {
}
return null;
} finally {
wl.release();
}
}
@Override