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

Commit ab969bb7 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Consider invisible requested resumed activity as pausing state" into main

parents f98c7399 6b5d24ae
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1286,7 +1286,9 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
                // this process, we'd find out the one with the minimal layer, thus it'll
                // get a higher adj score.
            } else if (!visible && bestInvisibleState != PAUSING) {
                if (state == PAUSING) {
                // Also check RESUMED in case the activity is pending to be stopped by
                // ActivityRecord#makeInvisible.
                if (state == PAUSING || state == RESUMED) {
                    bestInvisibleState = PAUSING;
                    // Treat PAUSING as visible in case the next activity in the same process has
                    // not yet been set as visible-requested.
+6 −0
Original line number Diff line number Diff line
@@ -364,6 +364,12 @@ public class WindowProcessControllerTests extends WindowTestsBase {
        activity.setState(STOPPED, "test");
        flags = mWpc.getActivityStateFlags() & exclusiveFlags;
        assertEquals(0, flags);

        activity.setVisibleRequested(true);
        activity.setState(RESUMED, "test");
        activity.makeInvisible();
        flags = mWpc.getActivityStateFlags() & exclusiveFlags;
        assertEquals(WindowProcessController.ACTIVITY_STATE_FLAG_IS_PAUSING_OR_PAUSED, flags);
    }

    @Test