Merge "Don't schedule SurfaceControl transaction if it is not valid" into tm-qpr-dev

This commit is contained in:
Jordan Demeulenaere
2022-07-20 09:26:56 +00:00
committed by Android (Google) Code Review

View File

@@ -523,9 +523,10 @@ class ActivityLaunchAnimator(
state: LaunchAnimator.State,
linearProgress: Float,
) {
if (transactionApplierView.viewRootImpl == null) {
// If the view root we synchronize with was detached, don't apply any transaction
// (as [SyncRtSurfaceTransactionApplier.scheduleApply] would otherwise throw).
if (transactionApplierView.viewRootImpl == null || !window.leash.isValid) {
// Don't apply any transaction if the view root we synchronize with was detached or
// if the SurfaceControl associated with [window] is not valid, as
// [SyncRtSurfaceTransactionApplier.scheduleApply] would otherwise throw.
return
}
@@ -605,9 +606,10 @@ class ActivityLaunchAnimator(
state: LaunchAnimator.State,
linearProgress: Float
) {
if (transactionApplierView.viewRootImpl == null) {
// If the view root we synchronize with was detached, don't apply any transaction
// (as [SyncRtSurfaceTransactionApplier.scheduleApply] would otherwise throw).
if (transactionApplierView.viewRootImpl == null || !navigationBar.leash.isValid) {
// Don't apply any transaction if the view root we synchronize with was detached or
// if the SurfaceControl associated with [navigationBar] is not valid, as
// [SyncRtSurfaceTransactionApplier.scheduleApply] would otherwise throw.
return
}