Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b6165e9 authored by Tony Mantler's avatar Tony Mantler Committed by android-build-merger
Browse files

Fix AsyncTask to handle exceptions in doInBackground am: 78a8e9d2 am: 7697ba26

am: 965596c5

Change-Id: I5879054fdacc571a94a5b23b472865b7eb25c07d
parents bb3e1fa6 965596c5
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -298,12 +298,16 @@ public abstract class AsyncTask<Params, Progress, Result> {
        mWorker = new WorkerRunnable<Params, Result>() {
            public Result call() throws Exception {
                mTaskInvoked.set(true);

                Result result = null;
                try {
                    Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
                    //noinspection unchecked
                Result result = doInBackground(mParams);
                    result = doInBackground(mParams);
                    Binder.flushPendingCommands();
                return postResult(result);
                } finally {
                    postResult(result);
                }
                return result;
            }
        };