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

Commit 35d73857 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz
Browse files

Fix testUpdateOomAdj_DoOne_AboveClient_NotStarted

The new OomAdjuster implementation relies on onProcessBeginLocked being
called. Use the helper updateOomAdj method which handles that.

Test: atest MockingOomAdjusterTests
Fix: 310995646
Change-Id: Ia5044569b8b9e2c1cbe49df75351e4e433c47619
parent 121a0b3d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2625,7 +2625,7 @@ public class MockingOomAdjusterTests {
        doReturn(PROCESS_STATE_TOP).when(sService.mAtmInternal).getTopProcessState();
        doReturn(app).when(sService).getTopApp();
        sService.mWakefulness.set(PowerManagerInternal.WAKEFULNESS_AWAKE);
        sService.mOomAdjuster.updateOomAdjLocked(app, OOM_ADJ_REASON_NONE);
        updateOomAdj(app);

        assertEquals(FOREGROUND_APP_ADJ, app.mState.getSetAdj());

@@ -2637,7 +2637,7 @@ public class MockingOomAdjusterTests {
        // Since sr.app is null, this service cannot be in the same process as the
        // client so we expect the BIND_ABOVE_CLIENT adjustment to take effect.
        app.mServices.updateHasAboveClientLocked();
        sService.mOomAdjuster.updateOomAdjLocked(app, OOM_ADJ_REASON_NONE);
        updateOomAdj(app);
        assertTrue(app.mServices.hasAboveClient());
        assertNotEquals(FOREGROUND_APP_ADJ, app.mState.getSetAdj());
    }