Commit 0a88d14
Fix AA disconnect: detect via display removal, prevent auto-resume
Android Auto on projection-mode devices (com.google.android.projection.gearhead)
doesn't trigger ACTION_EXIT_CAR_MODE, so the disconnect was never detected.
- Add DisplayManager.DisplayListener to detect AA disconnect when virtual
displays are removed (projection mode)
- Add bidirectional method channel so Dart notifies native of AA connection
- Add onAADisconnected callback that force-pauses (not toggles) the player
- Suppress Sendspin stream/start for 2s after disconnect to handle the race
where the server sends audio before processing our pause command
- Guard interruption begin handler to only pause/toggle when actually playing,
preventing the interrupted-while-paused -> accidental resume bug
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent c3f6710 commit 0a88d14
3 files changed
Lines changed: 85 additions & 5 deletions
File tree
- android/app/src/main/kotlin/com/collotsspot/ensemble
- lib
- providers
- services/audio
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
88 | 107 | | |
89 | 108 | | |
90 | 109 | | |
91 | 110 | | |
92 | 111 | | |
| 112 | + | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
| |||
108 | 128 | | |
109 | 129 | | |
110 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
111 | 150 | | |
112 | 151 | | |
113 | 152 | | |
| |||
261 | 300 | | |
262 | 301 | | |
263 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
264 | 307 | | |
265 | 308 | | |
266 | 309 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2130 | 2130 | | |
2131 | 2131 | | |
2132 | 2132 | | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
2133 | 2140 | | |
2134 | 2141 | | |
2135 | 2142 | | |
| |||
2557 | 2564 | | |
2558 | 2565 | | |
2559 | 2566 | | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
2560 | 2572 | | |
2561 | 2573 | | |
2562 | 2574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| |||
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
97 | | - | |
98 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| |||
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
112 | 129 | | |
113 | 130 | | |
114 | 131 | | |
| |||
138 | 155 | | |
139 | 156 | | |
140 | 157 | | |
141 | | - | |
142 | | - | |
| 158 | + | |
143 | 159 | | |
144 | 160 | | |
145 | 161 | | |
146 | 162 | | |
| 163 | + | |
147 | 164 | | |
148 | 165 | | |
149 | 166 | | |
150 | 167 | | |
151 | 168 | | |
| 169 | + | |
| 170 | + | |
152 | 171 | | |
153 | 172 | | |
154 | 173 | | |
| |||
203 | 222 | | |
204 | 223 | | |
205 | 224 | | |
206 | | - | |
207 | 225 | | |
208 | 226 | | |
209 | 227 | | |
| |||
349 | 367 | | |
350 | 368 | | |
351 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
352 | 376 | | |
353 | 377 | | |
354 | 378 | | |
| |||
676 | 700 | | |
677 | 701 | | |
678 | 702 | | |
| 703 | + | |
679 | 704 | | |
680 | 705 | | |
681 | 706 | | |
| |||
0 commit comments