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

Commit e0abcf0b authored by Evan Rosky's avatar Evan Rosky
Browse files

Skip config-at-end sync if activity removed

If an Activity is removed before we commit config-at-end,
it won't have a surface. In this case we can skip sync but
still need to clean-up config-at-end state.

Bug: 385917347
Test: remove activity before cfg-at-end finishes. This mostly
      happens during automated tests, so monitor dashboards.
Flag: EXEMPT bugfix
Change-Id: I16610b69cb0c9a85134458377689205a9cb843c9
parent 78fd834f
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -1626,6 +1626,11 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        for (int i = 0; i < mConfigAtEndActivities.size(); ++i) {
        for (int i = 0; i < mConfigAtEndActivities.size(); ++i) {
            final ActivityRecord target = mConfigAtEndActivities.get(i);
            final ActivityRecord target = mConfigAtEndActivities.get(i);
            final SurfaceControl targetLeash = target.getSurfaceControl();
            final SurfaceControl targetLeash = target.getSurfaceControl();
            if (targetLeash == null) {
                // activity may have been removed. In this case, no need to sync, just update state.
                target.resumeConfigurationDispatch();
                continue;
            }
            if (target.getSyncGroup() == null || target.getSyncGroup().isIgnoring(target)) {
            if (target.getSyncGroup() == null || target.getSyncGroup().isIgnoring(target)) {
                if (syncId < 0) {
                if (syncId < 0) {
                    final BLASTSyncEngine.SyncGroup sg = mSyncEngine.prepareSyncSet(
                    final BLASTSyncEngine.SyncGroup sg = mSyncEngine.prepareSyncSet(