diff options
| author | 2024-04-15 08:37:20 +0000 | |
|---|---|---|
| committer | 2024-04-15 09:58:23 +0000 | |
| commit | dc44cbbb42583b67b876e6edd3f1231eba92ab5b (patch) | |
| tree | 1e6e6daba0a95a60e746fba356958e598cf808d3 | |
| parent | 52bd4f135acdb36fbc7f3a4402bb29416e3ba06c (diff) | |
fw: delay TracingServiceProxy until PHASE_THIRD_PARTY_APPS_CAN_START
Because all methods in TracingServiceProxy want to bind/start services
in places outside system_server, it makes sense to wait until
PHASE_THIRD_PARTY_APPS_CAN_START to actually publish the service
This should solve some subtle race conditions around OOM heap dumps where they were being dropped on the floor by system_server because the GMSCore package had not yet been populated by PackageManager.
Bug: 333846370
Change-Id: I1addeafd9eac69e11c896fdda9a7a3924c09e22c
| -rw-r--r-- | services/core/java/com/android/server/tracing/TracingServiceProxy.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/tracing/TracingServiceProxy.java b/services/core/java/com/android/server/tracing/TracingServiceProxy.java index 10e868d06766..c1d92cffe1a7 100644 --- a/services/core/java/com/android/server/tracing/TracingServiceProxy.java +++ b/services/core/java/com/android/server/tracing/TracingServiceProxy.java @@ -119,8 +119,13 @@ public class TracingServiceProxy extends SystemService { } @Override - public void onStart() { - publishBinderService(TRACING_SERVICE_PROXY_BINDER_NAME, mTracingServiceProxy); + public void onStart() {} + + @Override + public void onBootPhase(int phase) { + if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) { + publishBinderService(TRACING_SERVICE_PROXY_BINDER_NAME, mTracingServiceProxy); + } } private void notifyTraceur(boolean sessionStolen) { |