summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2023-06-23 09:23:28 +0100
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-29 17:25:34 +0000
commita8432dc26294debe98b0c9d955b49c6ffc6009c6 (patch)
treeff0a25bfd4fc1f9247dd1ddea3538fe97253015c
parent04ca607c0c3e5a8d0eca632faf2d9e3bf3835fd9 (diff)
downloadart-a8432dc26294debe98b0c9d955b49c6ffc6009c6.tar.gz
Only create a StartupCompletedTask for non-zygote processes.
Bug: 288486162 Test: test.py (cherry picked from https://android-review.googlesource.com/q/commit:e87e6100cbbc54fb5563da451644e10b652a2dc7) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3415d029cefb874a2f44f311b3510186bad36906) Merged-In: Id177e767b9de95886d7b48fdf57222fdd2153ec4 Change-Id: Id177e767b9de95886d7b48fdf57222fdd2153ec4
-rw-r--r--runtime/native/dalvik_system_ZygoteHooks.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc
index 3c73cc569e..af0ee53854 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.cc
+++ b/runtime/native/dalvik_system_ZygoteHooks.cc
@@ -347,10 +347,12 @@ static void ZygoteHooks_nativePostForkChild(JNIEnv* env,
runtime->GetHeap()->PostForkChildAction(thread);
- // Setup an app startup complete task in case the app doesn't notify it
- // through VMRuntime::notifyStartupCompleted.
- static constexpr uint64_t kMaxAppStartupTimeNs = MsToNs(5000); // 5 seconds
- runtime->GetHeap()->AddHeapTask(new StartupCompletedTask(NanoTime() + kMaxAppStartupTimeNs));
+ if (!is_zygote) {
+ // Setup an app startup complete task in case the app doesn't notify it
+ // through VMRuntime::notifyStartupCompleted.
+ static constexpr uint64_t kMaxAppStartupTimeNs = MsToNs(5000); // 5 seconds
+ runtime->GetHeap()->AddHeapTask(new StartupCompletedTask(NanoTime() + kMaxAppStartupTimeNs));
+ }
if (runtime->GetJit() != nullptr) {
if (!is_system_server) {