Start a new thread if it was dead in CarServiceUtils
Bug: 159363078
Test: Tested a sample app using robolectrics
Change-Id: I53ac81024efc36a139c69e9b2fa9efa1b7e18591
diff --git a/service/src/com/android/car/CarServiceUtils.java b/service/src/com/android/car/CarServiceUtils.java
index 781fd6a..046c059 100644
--- a/service/src/com/android/car/CarServiceUtils.java
+++ b/service/src/com/android/car/CarServiceUtils.java
@@ -208,7 +208,7 @@
public static HandlerThread getHandlerThread(String name) {
synchronized (sHandlerThreads) {
HandlerThread thread = sHandlerThreads.get(name);
- if (thread == null) {
+ if (thread == null || !thread.isAlive()) {
Log.i(TAG, "Starting HandlerThread:" + name);
thread = new HandlerThread(name);
thread.start();