Commit f30d630
Fix updateOrientation crash: dispatch to UI thread, add safe cast
The Android updateOrientation() set Activity.RequestedOrientation directly
from the game update thread. On Samsung OneUI (S23 Ultra) and Android 13+,
this throws CalledFromWrongThreadException because Android requires UI
property changes on the UI thread.
The iOS version correctly dispatched via InvokeOnMainThread but the
Android version was missing the equivalent RunOnUiThread wrapper.
Also replaced the unsafe direct cast (IOsuScreen)ScreenStack.CurrentScreen
with a safe pattern check (is not IOsuScreen) to handle edge cases during
initialization when CurrentScreen may not yet be an IOsuScreen.
Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/502fe957-0685-4af6-b430-6862ca7660561 parent da99329 commit f30d630
1 file changed
Lines changed: 19 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
| 248 | + | |
251 | 249 | | |
252 | | - | |
253 | | - | |
254 | | - | |
| 250 | + | |
| 251 | + | |
255 | 252 | | |
256 | | - | |
257 | | - | |
258 | | - | |
| 253 | + | |
259 | 254 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
| |||
0 commit comments