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

Commit a0b899cb authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #65259946: APR: runtime restart: at com.android.server.am.ActivityManagerService

Catch security exception as well.

Bug: 65259946
Test: manual
Change-Id: Icffccb7d28ef2cf01955173f7dc5adbb81ed0caa
parent 50877231
Loading
Loading
Loading
Loading
+26 −10
Original line number Diff line number Diff line
@@ -1473,7 +1473,7 @@ public class ActivityManagerService extends IActivityManager.Stub
     * Flag that indicates if multi-window is enabled.
     *
     * For any particular form of multi-window to be enabled, generic multi-window must be enabled
     * in {@link com.android.internal.R.bool.config_supportsMultiWindow} config or
     * in {@link com.android.internal.R.bool#config_supportsMultiWindow} config or
     * {@link Settings.Global#DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES} development option set.
     * At least one of the forms of multi-window must be enabled in order for this flag to be
     * initialized to 'true'.
@@ -13423,7 +13423,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    /**
     * Schedule the given thread a normal scheduling priority.
     *
     * @param newTid the tid of the thread to adjust the scheduling of.
     * @param tid the tid of the thread to adjust the scheduling of.
     * @param suppressLogs {@code true} if any error logging should be disabled.
     *
     * @return {@code true} if this succeeded.
@@ -13436,6 +13436,10 @@ public class ActivityManagerService extends IActivityManager.Stub
            if (!suppressLogs) {
                Slog.w(TAG, "Failed to set scheduling policy, thread does not exist:\n" + e);
            }
        } catch (SecurityException e) {
            if (!suppressLogs) {
                Slog.w(TAG, "Failed to set scheduling policy, not allowed:\n" + e);
            }
        }
        return false;
    }
@@ -13443,7 +13447,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    /**
     * Schedule the given thread an FIFO scheduling priority.
     *
     * @param newTid the tid of the thread to adjust the scheduling of.
     * @param tid the tid of the thread to adjust the scheduling of.
     * @param suppressLogs {@code true} if any error logging should be disabled.
     *
     * @return {@code true} if this succeeded.
@@ -13456,6 +13460,10 @@ public class ActivityManagerService extends IActivityManager.Stub
            if (!suppressLogs) {
                Slog.w(TAG, "Failed to set scheduling policy, thread does not exist:\n" + e);
            }
        } catch (SecurityException e) {
            if (!suppressLogs) {
                Slog.w(TAG, "Failed to set scheduling policy, not allowed:\n" + e);
            }
        }
        return false;
    }
@@ -22009,6 +22017,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                               app.curSchedGroup != ProcessList.SCHED_GROUP_TOP_APP) {
                        mVrController.onTopProcChangedLocked(app);
                        if (mUseFifoUiScheduling) {
                            try {
                                // Reset UI pipeline to SCHED_OTHER
                                setThreadScheduler(app.pid, SCHED_OTHER, 0);
                                setThreadPriority(app.pid, app.savedPriority);
@@ -22017,6 +22026,13 @@ public class ActivityManagerService extends IActivityManager.Stub
                                        SCHED_OTHER, 0);
                                    setThreadPriority(app.renderThreadTid, -4);
                                }
                            } catch (IllegalArgumentException e) {
                                Slog.w(TAG,
                                        "Failed to set scheduling policy, thread does not exist:\n"
                                                + e);
                            } catch (SecurityException e) {
                                Slog.w(TAG, "Failed to set scheduling policy, not allowed:\n" + e);
                            }
                        } else {
                            // Reset priority for top app UI and render threads
                            setThreadPriority(app.pid, 0);