Commit 842ac4b
committed
Stride.Games/Android: guard ringer receiver register/unregister against pause-before-OnRun
Launching while the device is asleep fires onResume/onPause on the UI thread
before Silk's OnRun (separate thread) created the receiver, so OnPause called
UnregisterReceiver with a null field and crashed. Create the receiver lazily and
track registration under a lock so the two threads stay balanced.1 parent decb0c6 commit 842ac4b
1 file changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 60 | | |
65 | 61 | | |
66 | 62 | | |
| |||
170 | 166 | | |
171 | 167 | | |
172 | 168 | | |
| 169 | + | |
| 170 | + | |
173 | 171 | | |
174 | 172 | | |
| 173 | + | |
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
| |||
0 commit comments