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

Commit c0a5b059 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Verify that setReportedProcState() has been called." into main

parents fbe28f5c 0654f47b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -401,7 +401,7 @@ class ProcessRecord implements WindowProcessListener {
    /**
     * All about the process state info (proc state, oom adj score) in this process.
     */
    final ProcessStateRecord mState;
    ProcessStateRecord mState;

    /**
     * All about the state info of the optimizer when the process is cached.
+3 −2
Original line number Diff line number Diff line
@@ -334,6 +334,7 @@ public class BroadcastQueueTest extends BaseBroadcastQueueTest {
        final boolean dead = (behavior == ProcessBehavior.DEAD);

        final ProcessRecord r = spy(new ProcessRecord(mAms, ai, processName, ai.uid));
        r.mState = spy(r.mState);
        r.setPid(mNextPid.getAndIncrement());
        mActiveProcesses.add(r);

@@ -788,8 +789,8 @@ public class BroadcastQueueTest extends BaseBroadcastQueueTest {
        }) {
            // Confirm expected OOM adjustments; we were invoked once to upgrade
            // and once to downgrade
            assertEquals(String.valueOf(receiverApp), ActivityManager.PROCESS_STATE_RECEIVER,
                    receiverApp.mState.getReportedProcState());
            verify(receiverApp.mState, times(1).description(String.valueOf(receiverApp)))
                    .setReportedProcState(ActivityManager.PROCESS_STATE_RECEIVER);
            verify(mAms, times(2)).enqueueOomAdjTargetLocked(eq(receiverApp));

            if ((mImpl == Impl.DEFAULT) && (receiverApp == receiverBlueApp)) {