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

Commit 569d5710 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Fix black screen after moving top activity to another display" into sc-v2-dev am: 8e851faf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15184579

Change-Id: I40f6c0110f37f01cb1e9a1f08610beb1271f8f48
parents 1933a378 8e851faf
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -353,7 +353,7 @@ public class DisplayAreaOrganizerController extends IDisplayAreaOrganizerControl
        // Only update focus/visibility for the last one because there may be many root tasks are
        // Only update focus/visibility for the last one because there may be many root tasks are
        // reparented and the intermediate states are unnecessary.
        // reparented and the intermediate states are unnecessary.
        if (lastReparentedRootTask != null) {
        if (lastReparentedRootTask != null) {
            lastReparentedRootTask.postReparent();
            lastReparentedRootTask.resumeNextFocusAfterReparent();
        }
        }
    }
    }
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -5696,7 +5696,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        // Only update focus/visibility for the last one because there may be many root tasks are
        // Only update focus/visibility for the last one because there may be many root tasks are
        // reparented and the intermediate states are unnecessary.
        // reparented and the intermediate states are unnecessary.
        if (lastReparentedRootTask != null) {
        if (lastReparentedRootTask != null) {
            lastReparentedRootTask.postReparent();
            lastReparentedRootTask.resumeNextFocusAfterReparent();
        }
        }
        releaseSelfIfNeeded();
        releaseSelfIfNeeded();
        mDisplayPolicy.release();
        mDisplayPolicy.release();
+4 −1
Original line number Original line Diff line number Diff line
@@ -71,7 +71,6 @@ import static com.android.server.wm.ActivityTaskSupervisor.ON_TOP;
import static com.android.server.wm.ActivityTaskSupervisor.PRESERVE_WINDOWS;
import static com.android.server.wm.ActivityTaskSupervisor.PRESERVE_WINDOWS;
import static com.android.server.wm.ActivityTaskSupervisor.dumpHistoryList;
import static com.android.server.wm.ActivityTaskSupervisor.dumpHistoryList;
import static com.android.server.wm.ActivityTaskSupervisor.printThisActivity;
import static com.android.server.wm.ActivityTaskSupervisor.printThisActivity;
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
import static com.android.server.wm.RootWindowContainerProto.IS_HOME_RECENTS_COMPONENT;
import static com.android.server.wm.RootWindowContainerProto.IS_HOME_RECENTS_COMPONENT;
import static com.android.server.wm.RootWindowContainerProto.KEYGUARD_CONTROLLER;
import static com.android.server.wm.RootWindowContainerProto.KEYGUARD_CONTROLLER;
import static com.android.server.wm.RootWindowContainerProto.WINDOW_CONTAINER;
import static com.android.server.wm.RootWindowContainerProto.WINDOW_CONTAINER;
@@ -2078,6 +2077,10 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                    + " to its current taskDisplayArea=" + taskDisplayArea);
                    + " to its current taskDisplayArea=" + taskDisplayArea);
        }
        }
        rootTask.reparent(taskDisplayArea, onTop);
        rootTask.reparent(taskDisplayArea, onTop);

        // Resume focusable root task after reparenting to another display area.
        rootTask.resumeNextFocusAfterReparent();

        // TODO(multi-display): resize rootTasks properly if moved from split-screen.
        // TODO(multi-display): resize rootTasks properly if moved from split-screen.
    }
    }


+1 −8
Original line number Original line Diff line number Diff line
@@ -1231,12 +1231,6 @@ class Task extends TaskFragment {
        adjustBoundsForDisplayChangeIfNeeded(getDisplayContent());
        adjustBoundsForDisplayChangeIfNeeded(getDisplayContent());


        mRootWindowContainer.updateUIDsPresentOnDisplay();
        mRootWindowContainer.updateUIDsPresentOnDisplay();

        // Resume next focusable root task after reparenting to another display if we aren't
        // removing the prevous display.
        if (oldDisplay != null && oldDisplay.isRemoving()) {
            postReparent();
        }
    }
    }


    /** Returns the currently topmost resumed activity. */
    /** Returns the currently topmost resumed activity. */
@@ -4514,8 +4508,7 @@ class Task extends TaskFragment {
        mRootWindowContainer.resumeFocusedTasksTopActivities();
        mRootWindowContainer.resumeFocusedTasksTopActivities();
    }
    }


    /** Resume next focusable root task after reparenting to another display. */
    void resumeNextFocusAfterReparent() {
    void postReparent() {
        adjustFocusToNextFocusableTask("reparent", true /* allowFocusSelf */,
        adjustFocusToNextFocusableTask("reparent", true /* allowFocusSelf */,
                true /* moveDisplayToTop */);
                true /* moveDisplayToTop */);
        mRootWindowContainer.resumeFocusedTasksTopActivities();
        mRootWindowContainer.resumeFocusedTasksTopActivities();