Create new SurfaceControl.Transaction when old closed

The SurfaceControl.Transaction will be closed after use. If TransactionCommittedListener can not be called in time, sytem_server will crash when merge Transaction.

Bug: 281823781
Test: run monkey test pass

Change-Id: I68d9809aaebc3a217b0c5287323c65c4f9fd05b9
This commit is contained in:
Bin Zhai
2023-05-09 17:08:54 +08:00
committed by Evan Rosky
parent 8020b8b64c
commit a35993b83f

View File

@@ -248,7 +248,10 @@ class BLASTSyncEngine {
Slog.e(TAG, "WM sent Transaction to organized, but never received" +
" commit callback. Application ANR likely to follow.");
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
onCommitted(merged);
synchronized (mWm.mGlobalLock) {
onCommitted(merged.mNativeObject != 0
? merged : mWm.mTransactionFactory.get());
}
}
};
CommitCallback callback = new CommitCallback();