Merge "Allow WindowState to assign layer during transition." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
28017afd52
@@ -516,8 +516,14 @@ class TransitionController {
|
||||
* playing, but can be "opened-up" for certain transition operations like calculating layers
|
||||
* for finishTransaction.
|
||||
*/
|
||||
boolean canAssignLayers() {
|
||||
return mBuildingFinishLayers || !isPlaying();
|
||||
boolean canAssignLayers(@NonNull WindowContainer wc) {
|
||||
// Don't build window state into finish transaction in case another window is added or
|
||||
// removed during transition playing.
|
||||
if (mBuildingFinishLayers) {
|
||||
return wc.asWindowState() == null;
|
||||
}
|
||||
// Always allow WindowState to assign layers since it won't affect transition.
|
||||
return wc.asWindowState() != null || !isPlaying();
|
||||
}
|
||||
|
||||
@WindowConfiguration.WindowingMode
|
||||
|
||||
@@ -2596,7 +2596,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
void assignLayer(Transaction t, int layer) {
|
||||
// Don't assign layers while a transition animation is playing
|
||||
// TODO(b/173528115): establish robust best-practices around z-order fighting.
|
||||
if (!mTransitionController.canAssignLayers()) return;
|
||||
if (!mTransitionController.canAssignLayers(this)) return;
|
||||
final boolean changed = layer != mLastLayer || mLastRelativeToLayer != null;
|
||||
if (mSurfaceControl != null && changed) {
|
||||
setLayer(t, layer);
|
||||
|
||||
Reference in New Issue
Block a user