From a23e4976bed91f2a155a01665a1700c5f2c82749 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:02:30 +0000 Subject: [PATCH] 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. --- apps/multiplatform/android/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/multiplatform/android/src/main/AndroidManifest.xml b/apps/multiplatform/android/src/main/AndroidManifest.xml index 9e059afa14..0f5d3fae31 100644 --- a/apps/multiplatform/android/src/main/AndroidManifest.xml +++ b/apps/multiplatform/android/src/main/AndroidManifest.xml @@ -55,7 +55,7 @@ android:exported="true" android:label="${app_name}" android:windowSoftInputMode="adjustResize" - android:configChanges="uiMode" + android:configChanges="uiMode|orientation|screenSize|screenLayout|smallestScreenSize" android:theme="@style/Theme.SimpleX">