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

Commit 2f917df4 authored by Ruben Brunk's avatar Ruben Brunk Committed by Android (Google) Code Review
Browse files

Merge "Don't crash system server when setting scheduler." into nyc-mr1-dev

parents a96e7ac4 29a4a9ed
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -2328,6 +2328,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                            ProcessRecord proc = r.app;
                            if (proc.vrThreadTid > 0) {
                                if (proc.curSchedGroup == ProcessList.SCHED_GROUP_TOP_APP) {
                                    try {
                                        if (mInVrMode == true) {
                                            Process.setThreadScheduler(proc.vrThreadTid,
                                                Process.SCHED_FIFO | Process.SCHED_RESET_ON_FORK, 1);
@@ -2335,6 +2336,10 @@ public final class ActivityManagerService extends ActivityManagerNative
                                            Process.setThreadScheduler(proc.vrThreadTid,
                                                Process.SCHED_OTHER, 0);
                                        }
                                    } catch (IllegalArgumentException e) {
                                        Slog.e(TAG, "Failed to set scheduling policy, thread does"
                                                + " not exist:\n" + e);
                                    }
                                }
                            }
                        }