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

Commit a104b102 authored by Wei Wang's avatar Wei Wang Committed by Android (Google) Code Review
Browse files

Merge "Set reset_on_fork in setRenderThread as well" into main

parents ab8211ad 319474c1
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -8274,7 +8274,16 @@ public class ActivityManagerService extends IActivityManager.Stub
                        setThreadScheduler(proc.getRenderThreadTid(),
                        setThreadScheduler(proc.getRenderThreadTid(),
                                SCHED_FIFO | SCHED_RESET_ON_FORK, 1);
                                SCHED_FIFO | SCHED_RESET_ON_FORK, 1);
                    } else {
                    } else {
                        setThreadPriority(proc.getRenderThreadTid(), THREAD_PRIORITY_TOP_APP_BOOST);
                        if (Flags.resetOnForkEnabled()) {
                            if (Process.getThreadScheduler(proc.getRenderThreadTid())
                                    == Process.SCHED_OTHER) {
                                Process.setThreadScheduler(proc.getRenderThreadTid(),
                                    Process.SCHED_OTHER | Process.SCHED_RESET_ON_FORK,
                                    0);
                            }
                        }
                        setThreadPriority(proc.getRenderThreadTid(),
                            THREAD_PRIORITY_TOP_APP_BOOST);
                    }
                    }
                }
                }
            } else {
            } else {
+6 −5
Original line number Original line Diff line number Diff line
@@ -459,13 +459,14 @@ public class OomAdjuster {


        void setThreadPriority(int tid, int priority) {
        void setThreadPriority(int tid, int priority) {
            if (Flags.resetOnForkEnabled()) {
            if (Flags.resetOnForkEnabled()) {
                if (Process.getThreadScheduler(tid) == Process.SCHED_OTHER) {
                    Process.setThreadScheduler(tid,
                    Process.setThreadScheduler(tid,
                        Process.SCHED_OTHER | Process.SCHED_RESET_ON_FORK,
                        Process.SCHED_OTHER | Process.SCHED_RESET_ON_FORK,
                    priority);
                        0);
            } else {
                 Process.setThreadPriority(tid, priority);
                }
                }
            }
            }
            Process.setThreadPriority(tid, priority);
        }


    }
    }