Commit 95acf7e
authored
fix(signaling): call startForeground() first in onCreate() to reduce FGS timeout risk (#1100)
Move startForeground() to be the first call after super.onCreate(), before
any SharedPreferences IPC. Under memory pressure (Xiaomi HyperOS), the
SharedPrefs read in getCallbackDispatcher() can block the main thread for
50-500ms, pushing startForeground() past Xiaomi's aggressive ~1.2s window
and causing ForegroundServiceDidNotStartInTimeException.
startForeground() has no dependency on FlutterEngineHelper or callbackHandle —
the engine starts in onStartCommand(), which runs after onCreate() completes.1 parent a1b410b commit 95acf7e
1 file changed
Lines changed: 2 additions & 4 deletions
File tree
- packages/webtrit_signaling_service/webtrit_signaling_service_android/android/src/main/kotlin/com/webtrit/signaling_service
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | | - | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
| |||
0 commit comments