Files
simplex-chat/apps/multiplatform/android
Narasimha-sc a23e4976be android: handle screen-size config changes in MainActivity
Two flows in the app set requestedOrientation to a specific value -
LockToCurrentOrientationUntilDispose during voice recording (UI.android.kt),
and androidLockPortraitOrientation during the Migrate to/from another device
flows (SimplexApp.kt). MainActivity declared configChanges="uiMode" only, so
the framework treated each requestedOrientation write as an unhandled config
change and destroyed+recreated the activity. The destroy disposed the
recorder via RecordVoiceView's DisposableEffect, so a tap that was meant to
start tap-to-stop recording instead came back with the recording already
finished at ~1 second. The migrate flows just blanked the screen and
reopened.

The bug only reliably reproduces on Waydroid - real Android devices and the
AVD usually optimize the recreate away when requested orientation matches
current. CallActivity already declares
screenSize|smallestScreenSize|screenLayout|orientation and is not affected
on the same platform, which is direct precedent for the right set.

Match CallActivity's set (plus the existing uiMode). The two
requestedOrientation callsites keep their existing logic unchanged; only
the framework's response changes. Compose tracks LocalConfiguration and
recomposes without needing the activity to be recreated, and the codebase
already reads configuration through configuration-aware APIs.
2026-04-28 14:59:07 +00:00
..