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.graphics.Rect;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.PowerManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -870,6 +871,12 @@ public class FragmentFolders extends FragmentBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
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");
|
long fid = args.getLong("id");
|
||||||
Uri uri = args.getParcelable("uri");
|
Uri uri = args.getParcelable("uri");
|
||||||
|
|
||||||
|
@ -963,6 +970,9 @@ public class FragmentFolders extends FragmentBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
} finally {
|
||||||
|
wl.release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue