Merge "Wait for relaunching activity to finish sync" into udc-dev
This commit is contained in:
@@ -10608,6 +10608,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!isVisibleRequested()) return true;
|
if (!isVisibleRequested()) return true;
|
||||||
|
if (mPendingRelaunchCount > 0) return false;
|
||||||
// Wait for attach. That is the earliest time where we know if there will be an associated
|
// Wait for attach. That is the earliest time where we know if there will be an associated
|
||||||
// display rotation. If we don't wait, the starting-window can finishDrawing first and
|
// display rotation. If we don't wait, the starting-window can finishDrawing first and
|
||||||
// cause the display rotation to end-up in a following transition.
|
// cause the display rotation to end-up in a following transition.
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.android.server.wm;
|
|||||||
|
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
||||||
|
|
||||||
|
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
|
||||||
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock;
|
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock;
|
||||||
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
|
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
|
||||||
import static com.android.dx.mockito.inline.extended.ExtendedMockito.times;
|
import static com.android.dx.mockito.inline.extended.ExtendedMockito.times;
|
||||||
@@ -119,6 +120,22 @@ public class SyncEngineTests extends WindowTestsBase {
|
|||||||
assertTrue(mockWC.onSyncFinishedDrawing());
|
assertTrue(mockWC.onSyncFinishedDrawing());
|
||||||
bse.onSurfacePlacement();
|
bse.onSurfacePlacement();
|
||||||
verify(listener, times(1)).onTransactionReady(eq(id), notNull());
|
verify(listener, times(1)).onTransactionReady(eq(id), notNull());
|
||||||
|
|
||||||
|
// The sync is not finished for a relaunching activity.
|
||||||
|
id = startSyncSet(bse, listener);
|
||||||
|
final ActivityRecord r = new ActivityBuilder(mAtm).setCreateTask(true).build();
|
||||||
|
final WindowState w = mock(WindowState.class);
|
||||||
|
doReturn(true).when(w).isVisibleRequested();
|
||||||
|
doReturn(true).when(w).fillsParent();
|
||||||
|
doReturn(true).when(w).isSyncFinished(any());
|
||||||
|
r.mChildren.add(w);
|
||||||
|
bse.addToSyncSet(id, r);
|
||||||
|
r.onSyncFinishedDrawing();
|
||||||
|
assertTrue(r.isSyncFinished(r.getSyncGroup()));
|
||||||
|
r.startRelaunching();
|
||||||
|
assertFalse(r.isSyncFinished(r.getSyncGroup()));
|
||||||
|
r.finishRelaunching();
|
||||||
|
assertTrue(r.isSyncFinished(r.getSyncGroup()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user