mirror of https://github.com/M66B/FairEmail.git
Use wakelock for mbox export
This commit is contained in:
parent
eba065fb02
commit
9fb1a58036
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue