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

Commit e2279c6d authored by Tim Murray's avatar Tim Murray
Browse files

Don't reset current thread's priority accidentally.

If there's no RenderThread for the top app and FIFO UI is enabled, it's
possible to reset the current system_server thread's priority and
scheduler.

bug 30173296

Change-Id: I15da2563356ddd66911d695db43660ce5400da07
parent ffde6274
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -20265,12 +20265,14 @@ public final class ActivityManagerService extends ActivityManagerNative
                        if (mUseFifoUiScheduling) {
                            // Reset UI pipeline to SCHED_OTHER
                            Process.setThreadScheduler(app.pid, Process.SCHED_OTHER, 0);
                            Process.setThreadPriority(app.pid, app.savedPriority);
                            if (app.renderThreadTid != 0) {
                                Process.setThreadScheduler(app.renderThreadTid,
                                    Process.SCHED_OTHER, 0);
                            Process.setThreadPriority(app.pid, app.savedPriority);
                                Process.setThreadPriority(app.renderThreadTid, -4);
                            }
                        }
                    }
                } catch (Exception e) {
                    Slog.w(TAG, "Failed setting process group of " + app.pid
                            + " to " + app.curSchedGroup);