Merge "Reparent child surface layers when TDA migrate to new surface control" into sc-dev
This commit is contained in:
@@ -451,7 +451,7 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> {
|
||||
|
||||
void sendDisplayAreaVanished(IDisplayAreaOrganizer organizer) {
|
||||
if (organizer == null) return;
|
||||
migrateToNewSurfaceControl();
|
||||
migrateToNewSurfaceControl(getSyncTransaction());
|
||||
mOrganizerController.onDisplayAreaVanished(organizer, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -2382,11 +2382,11 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
}
|
||||
|
||||
@Override
|
||||
void migrateToNewSurfaceControl() {
|
||||
super.migrateToNewSurfaceControl();
|
||||
void migrateToNewSurfaceControl(SurfaceControl.Transaction t) {
|
||||
super.migrateToNewSurfaceControl(t);
|
||||
mLastSurfaceSize.x = 0;
|
||||
mLastSurfaceSize.y = 0;
|
||||
updateSurfaceSize(getPendingTransaction());
|
||||
updateSurfaceSize(t);
|
||||
}
|
||||
|
||||
void updateSurfaceSize(SurfaceControl.Transaction transaction) {
|
||||
|
||||
@@ -963,6 +963,22 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void migrateToNewSurfaceControl(SurfaceControl.Transaction t) {
|
||||
super.migrateToNewSurfaceControl(t);
|
||||
if (mAppAnimationLayer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// As TaskDisplayArea is getting a new surface, reparent and reorder the child surfaces.
|
||||
t.reparent(mAppAnimationLayer, mSurfaceControl);
|
||||
t.reparent(mBoostedAppAnimationLayer, mSurfaceControl);
|
||||
t.reparent(mHomeAppAnimationLayer, mSurfaceControl);
|
||||
t.reparent(mSplitScreenDividerAnchor, mSurfaceControl);
|
||||
reassignLayer(t);
|
||||
scheduleAnimation();
|
||||
}
|
||||
|
||||
void onRootTaskRemoved(Task rootTask) {
|
||||
if (ActivityTaskManagerDebugConfig.DEBUG_ROOT_TASK) {
|
||||
Slog.v(TAG_ROOT_TASK, "onRootTaskRemoved: detaching " + rootTask + " from displayId="
|
||||
|
||||
@@ -310,7 +310,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
|
||||
boolean taskAppearedSent = t.mTaskAppearedSent;
|
||||
if (taskAppearedSent) {
|
||||
if (t.getSurfaceControl() != null) {
|
||||
t.migrateToNewSurfaceControl();
|
||||
t.migrateToNewSurfaceControl(t.getSyncTransaction());
|
||||
}
|
||||
t.mTaskAppearedSent = false;
|
||||
}
|
||||
|
||||
@@ -460,8 +460,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
* This is used to revoke control of the SurfaceControl from a client process that was
|
||||
* previously organizing this WindowContainer.
|
||||
*/
|
||||
void migrateToNewSurfaceControl() {
|
||||
SurfaceControl.Transaction t = getPendingTransaction();
|
||||
void migrateToNewSurfaceControl(SurfaceControl.Transaction t) {
|
||||
t.remove(mSurfaceControl);
|
||||
// Clear the last position so the new SurfaceControl will get correct position
|
||||
mLastSurfacePosition.set(0, 0);
|
||||
|
||||
Reference in New Issue
Block a user