Don't schedule SurfaceControl transaction if it is not valid
This CL adds a preventive check to ensure that we don't schedule a transaction on a SurfaceControl that was released. Bug: 237183762 Test: Manual Change-Id: I86f8372c7de8234f5f1dd941dbf1c9eb9fbef647
This commit is contained in:
@@ -523,9 +523,10 @@ class ActivityLaunchAnimator(
|
|||||||
state: LaunchAnimator.State,
|
state: LaunchAnimator.State,
|
||||||
linearProgress: Float,
|
linearProgress: Float,
|
||||||
) {
|
) {
|
||||||
if (transactionApplierView.viewRootImpl == null) {
|
if (transactionApplierView.viewRootImpl == null || !window.leash.isValid) {
|
||||||
// If the view root we synchronize with was detached, don't apply any transaction
|
// Don't apply any transaction if the view root we synchronize with was detached or
|
||||||
// (as [SyncRtSurfaceTransactionApplier.scheduleApply] would otherwise throw).
|
// if the SurfaceControl associated with [window] is not valid, as
|
||||||
|
// [SyncRtSurfaceTransactionApplier.scheduleApply] would otherwise throw.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,9 +606,10 @@ class ActivityLaunchAnimator(
|
|||||||
state: LaunchAnimator.State,
|
state: LaunchAnimator.State,
|
||||||
linearProgress: Float
|
linearProgress: Float
|
||||||
) {
|
) {
|
||||||
if (transactionApplierView.viewRootImpl == null) {
|
if (transactionApplierView.viewRootImpl == null || !navigationBar.leash.isValid) {
|
||||||
// If the view root we synchronize with was detached, don't apply any transaction
|
// Don't apply any transaction if the view root we synchronize with was detached or
|
||||||
// (as [SyncRtSurfaceTransactionApplier.scheduleApply] would otherwise throw).
|
// if the SurfaceControl associated with [navigationBar] is not valid, as
|
||||||
|
// [SyncRtSurfaceTransactionApplier.scheduleApply] would otherwise throw.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user