07123403cde544fd2e51f4e669421121b4e57b93
The notification service was holding a PARTIAL_WAKE_LOCK indefinitely, preventing the CPU from ever sleeping. Combined with OkHttp's 30-second ping interval, this caused continuous CPU wake-ups — worse than the previous polling approach. Changes: - Remove permanent WakeLock that kept CPU running 24/7 - Disable OkHttp's 30s ping interval (useless without WakeLock in Doze) - Add AlarmManager keepalive using setAndAllowWhileIdle() every ~8 min - Acquire brief WakeLock (15s timeout) only during keepalive checks - Track connection liveness via relay message timestamps - Reconnect automatically when Doze kills the TCP connection - Missed events are recovered via the existing 'since' timestamp Expected improvement: ~3 brief wake-ups/hour vs continuous CPU usage. Notifications may be delayed up to ~8 min in deep sleep.
Description
Languages
TypeScript
95.7%
Java
1.5%
JavaScript
0.9%
Swift
0.9%
CSS
0.5%
Other
0.4%