summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-06-25 01:04:33 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-06-25 01:04:33 +0000
commit65b828e217e939141546a031112667345bcde01f (patch)
treee67c2f26c6603f0ee5e8762a5a624a9ab089e94c
parent8c23f4fb56f57888f804be69b5b59b6274101c09 (diff)
parent47deb4411f828c6a65ec893040f7d5a33870e051 (diff)
downloadservices-android11-d1-release.tar.gz
Change-Id: I886784fc2dc7d5f1f60b61d3b7e25416ea60732c
-rw-r--r--src/com/android/internal/car/CarServiceHelperService.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/internal/car/CarServiceHelperService.java b/src/com/android/internal/car/CarServiceHelperService.java
index d2d6fea..cd3c4f9 100644
--- a/src/com/android/internal/car/CarServiceHelperService.java
+++ b/src/com/android/internal/car/CarServiceHelperService.java
@@ -76,7 +76,6 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.car.ExternalConstants.ICarConstants;
import com.android.internal.os.IResultReceiver;
-import com.android.server.SystemServerInitThreadPool;
import com.android.server.SystemService;
import com.android.server.Watchdog;
import com.android.server.am.ActivityManagerService;
@@ -899,7 +898,19 @@ public class CarServiceHelperService extends SystemService {
@VisibleForTesting
void runAsync(Runnable r) {
- SystemServerInitThreadPool.submit(r, "CarServiceHelperManagePreCreatedUsers");
+ // We cannot use SystemServerInitThreadPool because user pre-creation can take too long,
+ // which would crash the SystemServer on SystemServerInitThreadPool.shutdown();
+ String threadName = TAG + ".AsyncTask";
+ Slog.i(TAG, "Starting thread " + threadName);
+ new Thread(() -> {
+ try {
+ r.run();
+ Slog.i(TAG, "Finishing thread " + threadName);
+ } catch (RuntimeException e) {
+ Slog.e(TAG, "runAsync() failed", e);
+ throw e;
+ }
+ }, threadName).start();
}
@Nullable