From 70c096d9a1305d3002320eb0d7185b5abb81c086 Mon Sep 17 00:00:00 2001 From: Dan Zivkovic Date: Tue, 10 Mar 2015 10:01:15 -0700 Subject: [PATCH] Restart background executor. Bug 19671650. Change-Id: I1a28a53e94bdb79aeb173f6905c1035022495acc --- .../com/android/inputmethod/latin/utils/ExecutorUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java b/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java index 3a6c60b15..91714686f 100644 --- a/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java @@ -33,7 +33,7 @@ public class ExecutorUtils { private static final String TAG = "ExecutorUtils"; - private static final ScheduledExecutorService sExecutorService = + private static ScheduledExecutorService sExecutorService = Executors.newSingleThreadScheduledExecutor(new ExecutorFactory()); private static class ExecutorFactory implements ThreadFactory { @@ -80,6 +80,8 @@ public class ExecutorUtils { } catch (InterruptedException e) { Log.wtf(TAG, "Failed to shut down background task."); throw new IllegalStateException("Failed to shut down background task."); + } finally { + sExecutorService = Executors.newSingleThreadScheduledExecutor(new ExecutorFactory()); } }