summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2013-12-09 18:24:29 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-09 18:24:29 -0800
commitcb3ee4ed3e23cb0de4b7cb37617330a41485845b (patch)
tree340d5907f4c598eec3174c08629cb4dc46cabc3e /core/java/android
parentea18bdafb9e82a613f6b9b1f7ba4a9f1ea6c8b20 (diff)
parent3254260b8b55496468e2b897c76cadd9ecde508d (diff)
downloadframeworks_base-cb3ee4ed3e23cb0de4b7cb37617330a41485845b.zip
frameworks_base-cb3ee4ed3e23cb0de4b7cb37617330a41485845b.tar.gz
frameworks_base-cb3ee4ed3e23cb0de4b7cb37617330a41485845b.tar.bz2
am 3254260b: Merge "Update Dalvik process state through VMRuntime."
* commit '3254260b8b55496468e2b897c76cadd9ecde508d': Update Dalvik process state through VMRuntime.
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/ActivityThread.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 5e3dc02..65c40c1 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -117,6 +117,7 @@ import libcore.io.EventLogger;
import libcore.io.IoUtils;
import dalvik.system.CloseGuard;
+import dalvik.system.VMRuntime;
final class RemoteServiceException extends AndroidRuntimeException {
public RemoteServiceException(String msg) {
@@ -1068,8 +1069,15 @@ public final class ActivityThread {
synchronized (this) {
if (mLastProcessState != processState) {
mLastProcessState = processState;
-
- // Update Dalvik state here based on ActivityManager.PROCESS_STATE_* constants.
+ // Update Dalvik state based on ActivityManager.PROCESS_STATE_* constants.
+ final int DALVIK_PROCESS_STATE_JANK_PERCEPTIBLE = 0;
+ final int DALVIK_PROCESS_STATE_JANK_IMPERCEPTIBLE = 1;
+ int dalvikProcessState = DALVIK_PROCESS_STATE_JANK_IMPERCEPTIBLE;
+ // TODO: Tune this since things like gmail sync are important background but not jank perceptible.
+ if (processState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND) {
+ dalvikProcessState = DALVIK_PROCESS_STATE_JANK_PERCEPTIBLE;
+ }
+ VMRuntime.getRuntime().updateProcessState(dalvikProcessState);
if (false) {
Slog.i(TAG, "******************* PROCESS STATE CHANGED TO: " + processState
+ (fromIpc ? " (from ipc": ""));