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

Commit 079c7330 authored by Richard Uhler's avatar Richard Uhler
Browse files

Treat SystemServer as jank perceptible under jank_perceptible_narrow.

Flag: android.app.jank_perceptible_narrow
Bug: 304837972
Test: Device boots, manually confirm system_server is now jank perceptible.
Change-Id: Idd87768cdb981b3f1ecda85e6a5e0b5d3e4f5966
parent 32b4056b
Loading
Loading
Loading
Loading
+14 −4
Original line number Original line Diff line number Diff line
@@ -3959,10 +3959,20 @@ public final class ActivityThread extends ClientTransactionHandler


    /** Converts a process state to a VM process state. */
    /** Converts a process state to a VM process state. */
    private static int toVmProcessState(int processState) {
    private static int toVmProcessState(int processState) {
        final int state = ActivityManager.isProcStateJankPerceptible(processState)
        if (ActivityManager.isProcStateJankPerceptible(processState)) {
                ? VM_PROCESS_STATE_JANK_PERCEPTIBLE
            return VM_PROCESS_STATE_JANK_PERCEPTIBLE;
                : VM_PROCESS_STATE_JANK_IMPERCEPTIBLE;
        }
        return state;

        if (Flags.jankPerceptibleNarrow()) {
            // Unlike other persistent processes, system server is often on
            // the critical path for application startup. Mark it explicitly
            // as jank perceptible regardless of processState.
            if (isSystem()) {
                return VM_PROCESS_STATE_JANK_PERCEPTIBLE;
            }
        }

        return VM_PROCESS_STATE_JANK_IMPERCEPTIBLE;
    }
    }


    /** Update VM state based on ActivityManager.PROCESS_STATE_* constants. */
    /** Update VM state based on ActivityManager.PROCESS_STATE_* constants. */