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

Commit e9ef4cf3 authored by Louis Chang's avatar Louis Chang
Browse files

Fixes the top activity not getting the focus by default

Make the top activity to be the latest resumed activity in the Task,
to ensure it gets the focus.

Bug: 377808246
Test: starts an Activity on a new Task from an AE app and finish it.
Flag: EXEMPT bugfix
Change-Id: I5612760f91a813ac3e02f134958681f637ff13be
parent 9405a43f
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -75,7 +75,6 @@ import static com.android.server.wm.ActivityRecord.TRANSFER_SPLASH_SCREEN_COPYIN
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_RECENTS;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_RECENTS;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_SWITCH;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_SWITCH;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_TRANSITION;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_TRANSITION;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_USER_LEAVING;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_CLEANUP;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_CLEANUP;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_RECENTS;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_RECENTS;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_SWITCH;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_SWITCH;
@@ -5257,7 +5256,6 @@ class Task extends TaskFragment {


        final boolean[] resumed = new boolean[1];
        final boolean[] resumed = new boolean[1];
        final TaskFragment topFragment = topActivity.getTaskFragment();
        final TaskFragment topFragment = topActivity.getTaskFragment();
        resumed[0] = topFragment.resumeTopActivity(prev, options, deferPause);
        forAllLeafTaskFragments(f -> {
        forAllLeafTaskFragments(f -> {
            if (topFragment == f) {
            if (topFragment == f) {
                return;
                return;
@@ -5267,6 +5265,7 @@ class Task extends TaskFragment {
            }
            }
            resumed[0] |= f.resumeTopActivity(prev, options, deferPause);
            resumed[0] |= f.resumeTopActivity(prev, options, deferPause);
        }, true);
        }, true);
        resumed[0] |= topFragment.resumeTopActivity(prev, options, deferPause);
        return resumed[0];
        return resumed[0];
    }
    }