Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e653c84 authored by Robert Carr's avatar Robert Carr
Browse files

applySyncTransaction: Add to syncSet earlier

We need to add modified WindowContainers to the BLASTSync set
before applying any changes. Recall that while participating in
sync window containers stop using the Display global
pending-transaction and instead redirect their changes in to the
BLASTSync-transaction. If we add to the BLAST sync too late, some
changes could go in to the WM transaction while others go in to
the BLASTSync-transaction. This means the effects would not be
applied atomically.

Bug: 149946388
Bug: 155814541
Test: Expand PIP. No flash.
Change-Id: I9b9b8f2308098d045a44004e2cca6dcbf84efcd9
parent 43d32906
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -138,6 +138,13 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                            Slog.e(TAG, "Attempt to operate on detached container: " + wc);
                            continue;
                        }
                        // Make sure we add to the syncSet before performing
                        // operations so we don't end up splitting effects between the WM
                        // pending transaction and the BLASTSync transaction.
                        if (syncId >= 0) {
                            mBLASTSyncEngine.addToSyncSet(syncId, wc);
                        }

                        int containerEffect = applyWindowContainerChange(wc, entry.getValue());
                        effects |= containerEffect;

@@ -146,9 +153,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                                && (containerEffect & TRANSACT_EFFECTS_CLIENT_CONFIG) != 0) {
                            haveConfigChanges.add(wc);
                        }
                        if (syncId >= 0) {
                            mBLASTSyncEngine.addToSyncSet(syncId, wc);
                        }
                    }
                    // Hierarchy changes
                    final List<WindowContainerTransaction.HierarchyOp> hops = t.getHierarchyOps();