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

Commit 6930c86c authored by Dmitri Plotnikov's avatar Dmitri Plotnikov Committed by Android (Google) Code Review
Browse files

Merge "Ignore RejectedExecutionException that may occur during system shutdown"

parents ed8b854b e1ea9b00
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
@@ -404,8 +405,10 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
     * within the task, never wait on the resulting Future. This will result in a deadlock.
     */
    public synchronized void scheduleRunnable(Runnable runnable) {
        if (!mExecutorService.isShutdown()) {
        try {
            mExecutorService.submit(runnable);
        } catch (RejectedExecutionException e) {
            Slog.e(TAG, "Couldn't schedule " + runnable, e);
        }
    }