Skip to content

Commit 54eec4b

Browse files
Chavi WeingartenAndroid (Google) Code Review
authored andcommitted
Merge "Allow Tasks to set some properties for migrated SC" into rvc-dev
2 parents 825ad11 + 21ea187 commit 54eec4b

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

services/core/java/com/android/server/wm/Task.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,8 +3209,9 @@ void onSurfaceShown(SurfaceControl.Transaction t) {
32093209
}
32103210

32113211
@Override
3212-
SurfaceControl.Builder makeSurface() {
3213-
return super.makeSurface().setColorLayer().setMetadata(METADATA_TASK_ID, mTaskId);
3212+
void setInitialSurfaceControlProperties(SurfaceControl.Builder b) {
3213+
b.setColorLayer().setMetadata(METADATA_TASK_ID, mTaskId);
3214+
super.setInitialSurfaceControlProperties(b);
32143215
}
32153216

32163217
boolean isTaskAnimating() {

services/core/java/com/android/server/wm/WindowContainer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,11 @@ void onParentChanged(ConfigurationContainer newParent, ConfigurationContainer ol
399399
}
400400

401401
void createSurfaceControl(boolean force) {
402-
setInitialSurfaceControlProperties(makeSurface().build());
402+
setInitialSurfaceControlProperties(makeSurface());
403403
}
404404

405-
private void setInitialSurfaceControlProperties(SurfaceControl surfaceControl) {
406-
setSurfaceControl(surfaceControl);
405+
void setInitialSurfaceControlProperties(SurfaceControl.Builder b) {
406+
setSurfaceControl(b.build());
407407
getSyncTransaction().show(mSurfaceControl);
408408
onSurfaceShown(getSyncTransaction());
409409
updateSurfacePosition();
@@ -431,7 +431,7 @@ void migrateToNewSurfaceControl() {
431431
.setContainerLayer()
432432
.setName(getName());
433433

434-
setInitialSurfaceControlProperties(b.build());
434+
setInitialSurfaceControlProperties(b);
435435

436436
// If parent is null, the layer should be placed offscreen so reparent to null. Otherwise,
437437
// set to the available parent.

0 commit comments

Comments
 (0)