summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-06-26 08:38:13 -0700
committerSan Mehat <san@google.com>2009-06-26 08:38:13 -0700
commit7d619f18a277ee3114624df7301db94db83936b9 (patch)
treeab64cffe75ebb381148544692566ab4479237d0d /core
parent5c7d9e8194900a2b1699cd57f95b22ca5f7b9be2 (diff)
downloadframeworks_base-7d619f18a277ee3114624df7301db94db83936b9.zip
frameworks_base-7d619f18a277ee3114624df7301db94db83936b9.tar.gz
frameworks_base-7d619f18a277ee3114624df7301db94db83936b9.tar.bz2
framework: process: Set the control group of a thread to the background group
if the priority is logically-lower than ANDROID_PRIORITY_BACKGROUND Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'core')
-rw-r--r--core/jni/android_util_Process.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index c890b0f..aee0ed7 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -269,9 +269,9 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin
void android_os_Process_setThreadPriority(JNIEnv* env, jobject clazz,
jint pid, jint pri)
{
- if (pri == ANDROID_PRIORITY_BACKGROUND) {
+ if (pri >= ANDROID_PRIORITY_BACKGROUND) {
add_pid_to_cgroup(pid, ANDROID_TGROUP_BG_NONINTERACT);
- } else if (getpriority(PRIO_PROCESS, pid) == ANDROID_PRIORITY_BACKGROUND) {
+ } else if (getpriority(PRIO_PROCESS, pid) >= ANDROID_PRIORITY_BACKGROUND) {
add_pid_to_cgroup(pid, ANDROID_TGROUP_DEFAULT);
}