Merge "Fix starting window isn't removed" into tm-dev am: ce3c4be427
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18282095 Change-Id: I1d04b003214ce3f9be547dce47a6292a57d27d65 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -6340,8 +6340,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
mSharedStartingData != null ? mSharedStartingData.mAssociatedTask : null;
|
||||
if (associatedTask == null) {
|
||||
removeStartingWindow();
|
||||
} else if (associatedTask.getActivity(
|
||||
r -> r.mVisibleRequested && !r.firstWindowDrawn) == null) {
|
||||
} else if (associatedTask.getActivity(r -> r.mVisibleRequested && !r.firstWindowDrawn
|
||||
// Don't block starting window removal if an Activity can't be a starting window
|
||||
// target.
|
||||
&& r.mSharedStartingData != null) == null) {
|
||||
// The last drawn activity may not be the one that owns the starting window.
|
||||
final ActivityRecord r = associatedTask.topActivityContainsStartingWindow();
|
||||
if (r != null) {
|
||||
|
||||
@@ -2853,6 +2853,11 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
assertTrue(activity2.isResizeable());
|
||||
activity1.reparent(taskFragment1, POSITION_TOP);
|
||||
|
||||
// Adds an Activity which doesn't have shared starting data, and verify if it blocks
|
||||
// starting window removal.
|
||||
final ActivityRecord activity3 = new ActivityBuilder(mAtm).build();
|
||||
taskFragment2.addChild(activity3, POSITION_TOP);
|
||||
|
||||
verify(activity1.getSyncTransaction()).reparent(eq(startingWindow.mSurfaceControl),
|
||||
eq(task.mSurfaceControl));
|
||||
assertEquals(activity1.mStartingData, startingWindow.mStartingData);
|
||||
|
||||
Reference in New Issue
Block a user