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

Commit 2ea878df authored by Matt Sziklay's avatar Matt Sziklay
Browse files

Only perform mExistenceChanged check on DisplayContent changes.

Since non-display changes can have mExistenceChanged set to true, checking it in ChangeInfo#hasChanged results in unexpected transition behavior and test failures. Since we're only concerned about the existence changes of display, move the check into applyDisplayChangeIfNeeded.

Bug: 391652399
Test: Manual, atest
Flag: com.android.window.flags.enable_display_disconnect_interaction

Change-Id: Ic65e01a2b1a4ba7760fc50cbefb618ba3e60d04e
parent 4d60bc1d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3453,14 +3453,16 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        for (int i = mParticipants.size() - 1; i >= 0; --i) {
            final WindowContainer<?> wc = mParticipants.valueAt(i);
            final DisplayContent dc = wc.asDisplayContent();
            if (dc == null || !mChanges.get(dc).hasChanged()) continue;
            if (dc == null) continue;
            final ChangeInfo displayChange = mChanges.get(dc);
            if (ENABLE_DISPLAY_DISCONNECT_INTERACTION.isTrue()
                    && mChanges.get(dc) != null && mChanges.get(dc).mExistenceChanged) {
                    && displayChange.mExistenceChanged) {
                dc.remove();
                affectsLifecycle = true;
                mWmService.mPossibleDisplayInfoMapper.removePossibleDisplayInfos(dc.mDisplayId);
                continue;
            }
            if (!displayChange.hasChanged()) continue;
            final boolean changed = dc.sendNewConfiguration();
            // Set to ready if no other change controls the ready state. But if there is, such as
            // if an activity is pausing, it will call setReady(ar, false) and wait for the next
@@ -3660,7 +3662,6 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        }

        boolean hasChanged() {
            if (mExistenceChanged && ENABLE_DISPLAY_DISCONNECT_INTERACTION.isTrue()) return true;
            final boolean currVisible = mContainer.isVisibleRequested();
            // the task including transient launch must promote to root task
            if (currVisible && ((mFlags & ChangeInfo.FLAG_TRANSIENT_LAUNCH) != 0