Add method for updating dalvik process state through VMRuntime.
Used to know when to do trimming and will be used for knowing when
to do compaction.
Bug: 8981901
Change-Id: I0f715f8c9dfc5f7399b54261fe08410449fef10e
diff --git a/libart/src/main/java/dalvik/system/VMRuntime.java b/libart/src/main/java/dalvik/system/VMRuntime.java
index 063a988..0e14912 100644
--- a/libart/src/main/java/dalvik/system/VMRuntime.java
+++ b/libart/src/main/java/dalvik/system/VMRuntime.java
@@ -258,6 +258,12 @@
public native void concurrentGC();
/**
+ * Let the heap know of the new process state. This can change allocation and garbage collection
+ * behavior regarding trimming and compaction.
+ */
+ public native void updateProcessState(int state);
+
+ /**
* Fill in dex caches with classes, fields, and methods that are
* already loaded. Typically used after Zygote preloading.
*/
diff --git a/libdvm/src/main/java/dalvik/system/VMRuntime.java b/libdvm/src/main/java/dalvik/system/VMRuntime.java
index 9ae3f67..fc83948 100644
--- a/libdvm/src/main/java/dalvik/system/VMRuntime.java
+++ b/libdvm/src/main/java/dalvik/system/VMRuntime.java
@@ -255,6 +255,12 @@
public native void registerNativeFree(int bytes);
/**
+ * Let the heap know of the new process state. This can change allocation and garbage collection
+ * behavior regarding trimming and compaction.
+ */
+ public native void updateProcessState(int state);
+
+ /**
* Fill in dex caches with classes, fields, and methods that are
* already loaded. Typically used after Zygote preloading.
*/