Merge "Skip transition only when transferring starting from visible activity" into sc-v2-dev am: a790ce3978
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15654839 Change-Id: Ibc66e8aa57fca9ada74a208128aeff903fbda55a
This commit is contained in:
@@ -3935,7 +3935,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
if (tStartingWindow != null && fromActivity.mStartingSurface != null) {
|
if (tStartingWindow != null && fromActivity.mStartingSurface != null) {
|
||||||
// In this case, the starting icon has already been displayed, so start
|
// In this case, the starting icon has already been displayed, so start
|
||||||
// letting windows get shown immediately without any more transitions.
|
// letting windows get shown immediately without any more transitions.
|
||||||
getDisplayContent().mSkipAppTransitionAnimation = true;
|
if (fromActivity.mVisible) {
|
||||||
|
mDisplayContent.mSkipAppTransitionAnimation = true;
|
||||||
|
}
|
||||||
|
|
||||||
ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Moving existing starting %s"
|
ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Moving existing starting %s"
|
||||||
+ " from %s to %s", tStartingWindow, fromActivity, this);
|
+ " from %s to %s", tStartingWindow, fromActivity, this);
|
||||||
|
|||||||
@@ -2510,8 +2510,10 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
@Test
|
@Test
|
||||||
public void testTransferStartingWindow() {
|
public void testTransferStartingWindow() {
|
||||||
registerTestStartingWindowOrganizer();
|
registerTestStartingWindowOrganizer();
|
||||||
final ActivityRecord activity1 = new ActivityBuilder(mAtm).setCreateTask(true).build();
|
final ActivityRecord activity1 = new ActivityBuilder(mAtm).setCreateTask(true)
|
||||||
final ActivityRecord activity2 = new ActivityBuilder(mAtm).setCreateTask(true).build();
|
.setVisible(false).build();
|
||||||
|
final ActivityRecord activity2 = new ActivityBuilder(mAtm).setCreateTask(true)
|
||||||
|
.setVisible(false).build();
|
||||||
activity1.addStartingWindow(mPackageName,
|
activity1.addStartingWindow(mPackageName,
|
||||||
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
|
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
|
||||||
false, false);
|
false, false);
|
||||||
@@ -2520,6 +2522,7 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
android.R.style.Theme, null, "Test", 0, 0, 0, 0, activity1,
|
android.R.style.Theme, null, "Test", 0, 0, 0, 0, activity1,
|
||||||
true, true, false, true, false, false);
|
true, true, false, true, false, false);
|
||||||
waitUntilHandlersIdle();
|
waitUntilHandlersIdle();
|
||||||
|
assertFalse(mDisplayContent.mSkipAppTransitionAnimation);
|
||||||
assertNoStartingWindow(activity1);
|
assertNoStartingWindow(activity1);
|
||||||
assertHasStartingWindow(activity2);
|
assertHasStartingWindow(activity2);
|
||||||
}
|
}
|
||||||
@@ -2627,6 +2630,7 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
false /* newTask */, false /* isTaskSwitch */, null /* options */,
|
false /* newTask */, false /* isTaskSwitch */, null /* options */,
|
||||||
null /* sourceRecord */);
|
null /* sourceRecord */);
|
||||||
|
|
||||||
|
assertTrue(mDisplayContent.mSkipAppTransitionAnimation);
|
||||||
assertNull(middle.mStartingWindow);
|
assertNull(middle.mStartingWindow);
|
||||||
assertHasStartingWindow(top);
|
assertHasStartingWindow(top);
|
||||||
assertTrue(top.isVisible());
|
assertTrue(top.isVisible());
|
||||||
|
|||||||
Reference in New Issue
Block a user