Add callback for notifying that startup is completed

Add a callback that can be called to denote that application startup
is completed. This may affect how the profile is collected and how
startup related caches are managed.

Bug: 123377072
Bug: 120671223
Test: test-art-host
Change-Id: If7eb8909cc5e99082a2243b5029380244b46174d
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index d705d5f..8115b6b 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -306,6 +306,10 @@
   runtime->UpdateProcessState(static_cast<ProcessState>(process_state));
 }
 
+static void VMRuntime_notifyStartupCompleted(JNIEnv*, jobject) {
+  Runtime::Current()->NotifyStartupCompleted();
+}
+
 static void VMRuntime_trimHeap(JNIEnv* env, jobject) {
   Runtime::Current()->GetHeap()->Trim(ThreadForEnv(env));
 }
@@ -722,6 +726,7 @@
   NATIVE_METHOD(VMRuntime, registerNativeFreeInternal, "(I)V"),
   NATIVE_METHOD(VMRuntime, getNotifyNativeInterval, "()I"),
   NATIVE_METHOD(VMRuntime, notifyNativeAllocationsInternal, "()V"),
+  NATIVE_METHOD(VMRuntime, notifyStartupCompleted, "()V"),
   NATIVE_METHOD(VMRuntime, registerSensitiveThread, "()V"),
   NATIVE_METHOD(VMRuntime, requestConcurrentGC, "()V"),
   NATIVE_METHOD(VMRuntime, requestHeapTrim, "()V"),