Merge "Fix some visibility issues with tasks & task overlays" into tm-qpr-dev

This commit is contained in:
Winson Chung
2023-01-20 05:01:18 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 2 deletions

View File

@@ -114,7 +114,9 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
t.setPosition(leash, positionInParent.x, positionInParent.y); t.setPosition(leash, positionInParent.x, positionInParent.y);
t.setAlpha(leash, 1f); t.setAlpha(leash, 1f);
t.setMatrix(leash, 1, 0, 0, 1); t.setMatrix(leash, 1, 0, 0, 1);
if (taskInfo.isVisible) {
t.show(leash); t.show(leash);
}
}); });
} }
} }

View File

@@ -3327,12 +3327,17 @@ class Task extends TaskFragment {
// We intend to let organizer manage task visibility but it doesn't // We intend to let organizer manage task visibility but it doesn't
// have enough information until we finish shell transitions. // have enough information until we finish shell transitions.
// In the mean time we do an easy fix here. // In the mean time we do an easy fix here.
final boolean show = isVisible() || isAnimating(TRANSITION | PARENTS | CHILDREN); final boolean visible = isVisible();
final boolean show = visible || isAnimating(TRANSITION | PARENTS | CHILDREN);
if (mSurfaceControl != null) { if (mSurfaceControl != null) {
if (show != mLastSurfaceShowing) { if (show != mLastSurfaceShowing) {
t.setVisibility(mSurfaceControl, show); t.setVisibility(mSurfaceControl, show);
} }
} }
// Only show the overlay if the task has other visible children
if (mOverlayHost != null) {
mOverlayHost.setVisibility(t, visible);
}
mLastSurfaceShowing = show; mLastSurfaceShowing = show;
} }

View File

@@ -80,6 +80,12 @@ class TrustedOverlayHost {
} }
} }
void setVisibility(SurfaceControl.Transaction t, boolean visible) {
if (mSurfaceControl != null) {
t.setVisibility(mSurfaceControl, visible);
}
}
void addOverlay(SurfaceControlViewHost.SurfacePackage p, SurfaceControl currentParent) { void addOverlay(SurfaceControlViewHost.SurfacePackage p, SurfaceControl currentParent) {
requireOverlaySurfaceControl(); requireOverlaySurfaceControl();
mOverlays.add(p); mOverlays.add(p);