Restart background executor.
Bug 19671650.
Change-Id: I1a28a53e94bdb79aeb173f6905c1035022495acc
diff --git a/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java b/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java
index 3a6c60b..9171468 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 @@
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 @@
} 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());
}
}