Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d619f18 authored by San Mehat's avatar San Mehat
Browse files

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: default avatarSan Mehat <san@google.com>
parent 5c7d9e81
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
    }