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

Commit 4dc0b4e1 authored by Wei Wang's avatar Wei Wang Committed by Automerger Merge Worker
Browse files

Merge "libutils: use system_background for low prio tasks in framework" into...

Merge "libutils: use system_background for low prio tasks in framework" into sc-qpr1-dev am: ecaf9ef7

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15946148

Change-Id: I2094d7af01deb3ca3c8acd52da54e0849a8c0c73
parents 52dc14ce ecaf9ef7
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -86,8 +86,10 @@ struct thread_data_t {


        // A new thread will be in its parent's sched group by default,
        // A new thread will be in its parent's sched group by default,
        // so we just need to handle the background case.
        // so we just need to handle the background case.
        // currently set to system_background group which is different
        // from background group for app.
        if (prio >= ANDROID_PRIORITY_BACKGROUND) {
        if (prio >= ANDROID_PRIORITY_BACKGROUND) {
            SetTaskProfiles(0, {"SCHED_SP_BACKGROUND"}, true);
            SetTaskProfiles(0, {"SCHED_SP_SYSTEM"}, true);
        }
        }


        if (name) {
        if (name) {
@@ -313,7 +315,7 @@ int androidSetThreadPriority(pid_t tid, int pri)
    }
    }


    if (pri >= ANDROID_PRIORITY_BACKGROUND) {
    if (pri >= ANDROID_PRIORITY_BACKGROUND) {
        rc = SetTaskProfiles(tid, {"SCHED_SP_BACKGROUND"}, true) ? 0 : -1;
        rc = SetTaskProfiles(tid, {"SCHED_SP_SYSTEM"}, true) ? 0 : -1;
    } else if (curr_pri >= ANDROID_PRIORITY_BACKGROUND) {
    } else if (curr_pri >= ANDROID_PRIORITY_BACKGROUND) {
        SchedPolicy policy = SP_FOREGROUND;
        SchedPolicy policy = SP_FOREGROUND;
        // Change to the sched policy group of the process.
        // Change to the sched policy group of the process.