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

Commit 965596c5 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

Change-Id: Iec4b849fb0badc94f37791bd7389eacc63b68bc2
parents ba93096c 7697ba26
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;
            }
        };