summaryrefslogtreecommitdiff
path: root/quickstep/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2022-05-24 17:09:25 -0700
committerSunny Goyal <sunnygoyal@google.com>2022-05-24 17:14:44 -0700
commitcdc111a158c089a6a8e4dd9c9e961c77b91d684d (patch)
treec9a982c76443d44a0a365b3933011e4885302e51 /quickstep/src
parent2940565595103e7594423548a93cde095f8d6b2e (diff)
downloadLauncher3-cdc111a158c089a6a8e4dd9c9e961c77b91d684d.tar.gz
Creating the transaction on the UI thread
This avoids the error when the transaction is created after the surface is released. In case the surface is released after transaction object is created, the apply() call simply ignores that error, whereas previously the transactionCreation will throw an error Bug: 231889963 Test: Verified by manually releasing the surface that there is no crash Change-Id: I9a4b9ca0be2ed687b2fc692570415256e3e479f7
Diffstat (limited to 'quickstep/src')
-rw-r--r--quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java b/quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java
index 4757d4bc7d..1200208e30 100644
--- a/quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java
+++ b/quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java
@@ -75,6 +75,13 @@ public class SurfaceTransactionApplier extends ReleaseCheck {
if (view == null) {
return;
}
+ Transaction t = new Transaction();
+ for (int i = params.length - 1; i >= 0; i--) {
+ SurfaceParams surfaceParams = params[i];
+ if (surfaceParams.surface.isValid()) {
+ surfaceParams.applyTo(t);
+ }
+ }
mLastSequenceNumber++;
final int toApplySeqNo = mLastSequenceNumber;
@@ -85,13 +92,6 @@ public class SurfaceTransactionApplier extends ReleaseCheck {
.sendToTarget();
return;
}
- Transaction t = new Transaction();
- for (int i = params.length - 1; i >= 0; i--) {
- SurfaceParams surfaceParams = params[i];
- if (surfaceParams.surface.isValid()) {
- surfaceParams.applyTo(t);
- }
- }
mTargetViewRootImpl.mergeWithNextTransaction(t, frame);
Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0)
.sendToTarget();