Skip to content

Fix foldable window transitions after notification and floating opens#1946

Open
rybnikov wants to merge 5 commits intoDrKLO:masterfrom
rybnikov:upstream/fix-foldable-window-transition-recovery
Open

Fix foldable window transitions after notification and floating opens#1946
rybnikov wants to merge 5 commits intoDrKLO:masterfrom
rybnikov:upstream/fix-foldable-window-transition-recovery

Conversation

@rybnikov
Copy link
Copy Markdown

@rybnikov rybnikov commented Mar 23, 2026

This fixes four regressions that show up on foldables and in Android split-screen.

The first issue was tablet detection after resume. On foldables, checkDisplaySize(activity, ...) refreshed displaySize and density from the current activity, but resetTabletFlag() then repopulated the tablet cache through isTabletForce(), which was still reading stale application-context metrics. That could leave the app cached in phone mode on an unfolded screen after wake or resume. The fix makes isTabletForce() use the already refreshed displaySize and density first, with the application-context metrics kept only as an early-init fallback.

The second issue was navigation recovery after window transitions. The existing safety reset in ActionBarLayout was firing even while a fresh animation was still valid, which could interrupt normal transitions. The fix keeps the reset path for genuinely stuck state, but skips it for fresh transitions and logs when end callbacks have to be dropped.

The third issue was chat back navigation after resizing split-screen. During layout migration, LaunchActivity moved an existing ChatActivity between layouts by destroying and re-adding the same fragment instance. That left the fragment in a finished state, so the chat back button stopped working after a resize. The fix resets the fragment before re-adding it, and also avoids routing back presses into the right pane when the activity is already in full-size mode.

The fourth issue was foldable window recovery after notification and floating-window opens. The existing changes in this PR keep the tablet layout and fragment state coherent when the window mode changes under the activity.

@rybnikov rybnikov changed the title Fix foldable window transition recovery after notification opens Fix foldable window transitions after notification and floating opens Mar 23, 2026
@rybnikov rybnikov force-pushed the upstream/fix-foldable-window-transition-recovery branch from edc53af to 65aa2ff Compare March 23, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant