Commit 01ce277
fix(chat): avoid main-thread deadlock in ChatActivity onStart media controller connect
The onStart() listener re-read the mutable mediaControllerFuture field
instead of the future it was registered against. If onStart() ran again
before a prior connection attempt's listener fired, that listener could
end up blocking get() on a newer, not-yet-completed future, deadlocking
the main thread and causing an ANR. Capture the future in a local val
and ignore the callback if it's no longer the current connection attempt.
Assisted-by: Claude Code:claude-sonnet-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>1 parent b360738 commit 01ce277
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1400 | 1400 | | |
1401 | 1401 | | |
1402 | 1402 | | |
1403 | | - | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
1404 | 1410 | | |
1405 | | - | |
1406 | 1411 | | |
1407 | | - | |
| 1412 | + | |
1408 | 1413 | | |
1409 | 1414 | | |
1410 | 1415 | | |
| |||
0 commit comments