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

Commit d71317c9 authored by Bryce Lee's avatar Bryce Lee
Browse files

Revert "Set correct focus activity when using FLAG_ACTIVITY_REORDER_TO_FRONT"

This reverts commit 6d42df6d.

The original commit addressed b/25487874 by changing the root
activity to match the top activity. This however affects the
backstack behavior as we return to home if our current activity is
the root activity
(see ActivityStack::adjustFocusedActivityStackLocked). Upon
removing this change, the original issue no longer reproduces.

Fixes: 25784754
Bug: 25487874
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerActivityVisibilityTests#testReorderToFrontBackstack
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerActivityVisibilityTests#testReorderToFrontChangingStack

Change-Id: I291fab0b14c69ec8c4c8ce3100cd391260a4c77e
parent 150a584a
Loading
Loading
Loading
Loading
+3 −15
Original line number Original line Diff line number Diff line
@@ -969,18 +969,9 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta
                || topRunningActivityLocked() != null;
                || topRunningActivityLocked() != null;
    }
    }


    void setFrontOfTask() {
        setFrontOfTask(null);
    }

    /** Call after activity movement or finish to make sure that frontOfTask is set correctly */
    /** Call after activity movement or finish to make sure that frontOfTask is set correctly */
    void setFrontOfTask(ActivityRecord newTop) {
    final void setFrontOfTask() {
        // If a top candidate is suggested by the caller, go ahead and use it and mark all others
        boolean foundFront = false;
        // as not front. This is needed in situations where the current front activity in the
        // task isn't finished yet and we want to set the front to the activity moved to the front
        // of the task.
        boolean foundFront = newTop != null ? true : false;

        final int numActivities = mActivities.size();
        final int numActivities = mActivities.size();
        for (int activityNdx = 0; activityNdx < numActivities; ++activityNdx) {
        for (int activityNdx = 0; activityNdx < numActivities; ++activityNdx) {
            final ActivityRecord r = mActivities.get(activityNdx);
            final ActivityRecord r = mActivities.get(activityNdx);
@@ -997,9 +988,6 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta
            // activity, make the bottom activity front.
            // activity, make the bottom activity front.
            mActivities.get(0).frontOfTask = true;
            mActivities.get(0).frontOfTask = true;
        }
        }
        if (newTop != null) {
            newTop.frontOfTask = true;
        }
    }
    }


    /**
    /**
@@ -1014,7 +1002,7 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta
        mActivities.add(newTop);
        mActivities.add(newTop);
        updateEffectiveIntent();
        updateEffectiveIntent();


        setFrontOfTask(newTop);
        setFrontOfTask();
    }
    }


    void addActivityAtBottom(ActivityRecord r) {
    void addActivityAtBottom(ActivityRecord r) {