Loading services/core/java/com/android/server/ContextHubSystemService.java +4 −4 Original line number Diff line number Diff line Loading @@ -16,12 +16,12 @@ package com.android.server; import com.android.internal.util.ConcurrentUtils; import com.android.server.location.ContextHubService; import com.android.server.SystemServerInitThreadPool; import android.content.Context; import android.util.Log; import com.android.internal.util.ConcurrentUtils; import com.android.server.location.ContextHubService; import java.util.concurrent.Future; class ContextHubSystemService extends SystemService { Loading @@ -32,7 +32,7 @@ class ContextHubSystemService extends SystemService { public ContextHubSystemService(Context context) { super(context); mInit = SystemServerInitThreadPool.get().submit(() -> { mInit = SystemServerInitThreadPool.submit(() -> { mContextHubService = new ContextHubService(context); }, "Init ContextHubSystemService"); } Loading services/core/java/com/android/server/PersistentDataBlockService.java +1 −1 Original line number Diff line number Diff line Loading @@ -162,7 +162,7 @@ public class PersistentDataBlockService extends SystemService { @Override public void onStart() { // Do init on a separate thread, will join in PHASE_ACTIVITY_MANAGER_READY SystemServerInitThreadPool.get().submit(() -> { SystemServerInitThreadPool.submit(() -> { mAllowedUid = getAllowedUid(UserHandle.USER_SYSTEM); enforceChecksumValidity(); formatIfOemUnlockEnabled(); Loading services/core/java/com/android/server/SystemServerInitThreadPool.java +11 −8 Original line number Diff line number Diff line Loading @@ -67,23 +67,26 @@ public class SystemServerInitThreadPool { } /** * Gets the singleton. * Submits a task for execution. * * @throws IllegalStateException if it hasn't been started or has been shut down already. */ public static SystemServerInitThreadPool get() { public static @NonNull Future<?> submit(@NonNull Runnable runnable, @NonNull String description) { Preconditions.checkNotNull(description, "description cannot be null"); SystemServerInitThreadPool instance; synchronized (LOCK) { Preconditions.checkState(sInstance != null, "Cannot get " + TAG + " - it has been shut down"); return sInstance; instance = sInstance; } return instance.submitTask(runnable, description); } /** * Submits a task for execution. */ public @NonNull Future<?> submit(@NonNull Runnable runnable, @NonNull String description) { Preconditions.checkNotNull(description, "description cannot be null"); private @NonNull Future<?> submitTask(@NonNull Runnable runnable, @NonNull String description) { synchronized (mPendingTasks) { Preconditions.checkState(!mShutDown, TAG + " already shut down"); mPendingTasks.add(description); Loading services/core/java/com/android/server/UiModeManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ final class UiModeManagerService extends SystemService { updateNightModeFromSettings(context, res, UserHandle.getCallingUserId()); // Update the initial, static configurations. SystemServerInitThreadPool.get().submit(() -> { SystemServerInitThreadPool.submit(() -> { synchronized (mLock) { updateConfigurationLocked(); sendConfigurationLocked(); Loading services/core/java/com/android/server/biometrics/face/FaceService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1089,7 +1089,7 @@ public class FaceService extends BiometricServiceBase { publishBinderService(Context.FACE_SERVICE, new FaceServiceWrapper()); // Get the face daemon on FaceService's on thread so SystemServerInitThreadPool isn't // blocked SystemServerInitThreadPool.get().submit(() -> mHandler.post(this::getFaceDaemon), SystemServerInitThreadPool.submit(() -> mHandler.post(this::getFaceDaemon), TAG + ".onStart"); } Loading Loading
services/core/java/com/android/server/ContextHubSystemService.java +4 −4 Original line number Diff line number Diff line Loading @@ -16,12 +16,12 @@ package com.android.server; import com.android.internal.util.ConcurrentUtils; import com.android.server.location.ContextHubService; import com.android.server.SystemServerInitThreadPool; import android.content.Context; import android.util.Log; import com.android.internal.util.ConcurrentUtils; import com.android.server.location.ContextHubService; import java.util.concurrent.Future; class ContextHubSystemService extends SystemService { Loading @@ -32,7 +32,7 @@ class ContextHubSystemService extends SystemService { public ContextHubSystemService(Context context) { super(context); mInit = SystemServerInitThreadPool.get().submit(() -> { mInit = SystemServerInitThreadPool.submit(() -> { mContextHubService = new ContextHubService(context); }, "Init ContextHubSystemService"); } Loading
services/core/java/com/android/server/PersistentDataBlockService.java +1 −1 Original line number Diff line number Diff line Loading @@ -162,7 +162,7 @@ public class PersistentDataBlockService extends SystemService { @Override public void onStart() { // Do init on a separate thread, will join in PHASE_ACTIVITY_MANAGER_READY SystemServerInitThreadPool.get().submit(() -> { SystemServerInitThreadPool.submit(() -> { mAllowedUid = getAllowedUid(UserHandle.USER_SYSTEM); enforceChecksumValidity(); formatIfOemUnlockEnabled(); Loading
services/core/java/com/android/server/SystemServerInitThreadPool.java +11 −8 Original line number Diff line number Diff line Loading @@ -67,23 +67,26 @@ public class SystemServerInitThreadPool { } /** * Gets the singleton. * Submits a task for execution. * * @throws IllegalStateException if it hasn't been started or has been shut down already. */ public static SystemServerInitThreadPool get() { public static @NonNull Future<?> submit(@NonNull Runnable runnable, @NonNull String description) { Preconditions.checkNotNull(description, "description cannot be null"); SystemServerInitThreadPool instance; synchronized (LOCK) { Preconditions.checkState(sInstance != null, "Cannot get " + TAG + " - it has been shut down"); return sInstance; instance = sInstance; } return instance.submitTask(runnable, description); } /** * Submits a task for execution. */ public @NonNull Future<?> submit(@NonNull Runnable runnable, @NonNull String description) { Preconditions.checkNotNull(description, "description cannot be null"); private @NonNull Future<?> submitTask(@NonNull Runnable runnable, @NonNull String description) { synchronized (mPendingTasks) { Preconditions.checkState(!mShutDown, TAG + " already shut down"); mPendingTasks.add(description); Loading
services/core/java/com/android/server/UiModeManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ final class UiModeManagerService extends SystemService { updateNightModeFromSettings(context, res, UserHandle.getCallingUserId()); // Update the initial, static configurations. SystemServerInitThreadPool.get().submit(() -> { SystemServerInitThreadPool.submit(() -> { synchronized (mLock) { updateConfigurationLocked(); sendConfigurationLocked(); Loading
services/core/java/com/android/server/biometrics/face/FaceService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1089,7 +1089,7 @@ public class FaceService extends BiometricServiceBase { publishBinderService(Context.FACE_SERVICE, new FaceServiceWrapper()); // Get the face daemon on FaceService's on thread so SystemServerInitThreadPool isn't // blocked SystemServerInitThreadPool.get().submit(() -> mHandler.post(this::getFaceDaemon), SystemServerInitThreadPool.submit(() -> mHandler.post(this::getFaceDaemon), TAG + ".onStart"); } Loading