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

Commit 0c0f8b86 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set reset_on_fork flag for threads in power hint sessions" into main

parents 2d351559 1e650f5d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.os.Flags.adpfUseFmqChannel;
import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR;
import static com.android.server.power.hint.Flags.adpfSessionTag;
import static com.android.server.power.hint.Flags.powerhintThreadCleanup;
import static com.android.server.power.hint.Flags.resetOnForkEnabled;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -1057,6 +1058,11 @@ public final class HintManagerService extends SystemService {
                    Slogf.w(TAG, errMsg);
                    throw new SecurityException(errMsg);
                }
                if (resetOnForkEnabled()){
                    for (int tid : tids) {
                        Process.setThreadScheduler(tid, Process.SCHED_RESET_ON_FORK, 0);
                    }
                }

                if (adpfSessionTag() && tag == SessionTag.APP) {
                    // If the category of the app is a game,
@@ -1447,6 +1453,11 @@ public final class HintManagerService extends SystemService {
                            Slogf.w(TAG, errMsg);
                            throw new SecurityException(errMsg);
                        }
                        if (resetOnForkEnabled()){
                            for (int tid : tids) {
                                Process.setThreadScheduler(tid, Process.SCHED_RESET_ON_FORK, 0);
                            }
                        }
                        if (powerhintThreadCleanup()) {
                            synchronized (mNonIsolatedTidsLock) {
                                for (int i = nonIsolated.size() - 1; i >= 0; i--) {
+7 −0
Original line number Diff line number Diff line
@@ -14,3 +14,10 @@ flag {
    description: "Feature flag for adding session tag to hint session atom"
    bug: "345011125"
}

flag {
    name: "reset_on_fork_enabled"
    namespace: "game"
    description: "Set reset_on_fork flag."
    bug: "370988407"
}