diff options
| author | Mathieu Chartier <mathieuc@google.com> | 2013-12-10 02:27:33 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-12-10 02:27:33 +0000 |
| commit | 6a58a2e7e6d39180a130f3bff09aeb7afa6b1e3c (patch) | |
| tree | 340d5907f4c598eec3174c08629cb4dc46cabc3e /core/java/android | |
| parent | 140ecf2530fc9ad89e59d60b6f7b70bc2e1fdd0c (diff) | |
| parent | cb3ee4ed3e23cb0de4b7cb37617330a41485845b (diff) | |
| download | frameworks_base-6a58a2e7e6d39180a130f3bff09aeb7afa6b1e3c.zip frameworks_base-6a58a2e7e6d39180a130f3bff09aeb7afa6b1e3c.tar.gz frameworks_base-6a58a2e7e6d39180a130f3bff09aeb7afa6b1e3c.tar.bz2 | |
am cb3ee4ed: am 3254260b: Merge "Update Dalvik process state through VMRuntime."
* commit 'cb3ee4ed3e23cb0de4b7cb37617330a41485845b':
Update Dalvik process state through VMRuntime.
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 12 |
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": "")); |
