diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java index bce131b6700b7..adb8bf696dd3f 100644 --- a/services/core/java/com/android/server/wm/WindowContainer.java +++ b/services/core/java/com/android/server/wm/WindowContainer.java @@ -3769,9 +3769,9 @@ class WindowContainer extends ConfigurationContainer< // Check if this is changing displays. If so, mark the old display as "ready" for // transitions. This is to work around the problem where setting readiness against this // container will only set the new display as ready and leave the old display as unready. - if (mSyncState != SYNC_STATE_NONE && oldParent != null - && oldParent.getDisplayContent() != null && (newParent == null - || oldParent.getDisplayContent() != newParent.getDisplayContent())) { + if (mSyncState != SYNC_STATE_NONE && oldParent != null && newParent != null + && oldParent.getDisplayContent() != null && newParent.getDisplayContent() != null + && oldParent.getDisplayContent() != newParent.getDisplayContent()) { mTransitionController.setReady(oldParent.getDisplayContent()); }