Merge "Do not start change transition when the bounds size is not changed" into tm-qpr-dev
This commit is contained in:
@@ -2340,7 +2340,10 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !startBounds.equals(getBounds());
|
// Only take snapshot if the bounds are resized.
|
||||||
|
final Rect endBounds = getConfiguration().windowConfiguration.getBounds();
|
||||||
|
return endBounds.width() != startBounds.width()
|
||||||
|
|| endBounds.height() != startBounds.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canHaveEmbeddingActivityTransition(@NonNull ActivityRecord child) {
|
boolean canHaveEmbeddingActivityTransition(@NonNull ActivityRecord child) {
|
||||||
|
|||||||
@@ -133,6 +133,23 @@ public class TaskFragmentTest extends WindowTestsBase {
|
|||||||
verify(mTransaction).setWindowCrop(mLeash, 500, 500);
|
verify(mTransaction).setWindowCrop(mLeash, 500, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testStartChangeTransition_doNotFreezeWhenOnlyMoved() {
|
||||||
|
final Rect startBounds = new Rect(0, 0, 1000, 1000);
|
||||||
|
final Rect endBounds = new Rect(startBounds);
|
||||||
|
endBounds.offset(500, 0);
|
||||||
|
mTaskFragment.setBounds(startBounds);
|
||||||
|
doReturn(true).when(mTaskFragment).isVisible();
|
||||||
|
doReturn(true).when(mTaskFragment).isVisibleRequested();
|
||||||
|
|
||||||
|
clearInvocations(mTransaction);
|
||||||
|
mTaskFragment.setBounds(endBounds);
|
||||||
|
|
||||||
|
// No change transition, but update the organized surface position.
|
||||||
|
verify(mTaskFragment, never()).initializeChangeTransition(any(), any());
|
||||||
|
verify(mTransaction).setPosition(mLeash, endBounds.left, endBounds.top);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNotOkToAnimate_doNotStartChangeTransition() {
|
public void testNotOkToAnimate_doNotStartChangeTransition() {
|
||||||
mockSurfaceFreezerSnapshot(mTaskFragment.mSurfaceFreezer);
|
mockSurfaceFreezerSnapshot(mTaskFragment.mSurfaceFreezer);
|
||||||
|
|||||||
Reference in New Issue
Block a user