Repository navigation
Description
Summary
A common push pattern for self-hosted and battery-friendly apps is FCM tickle-based alerting: the backend sends a high-priority FCM data message ("tickle"), the app wakes, then fetches the actual content from its own server. On GMS devices this works end-to-end even in Doze: Play Services wakes the app and grants it a temporary network exemption, so the follow-up fetch completes within seconds.
On user-installed microG (vanilla ROMs, the common non-privileged install), this pattern is silently degraded: the app is woken on time, but its follow-up network request is blackholed by Doze. The user experiences "pushes only arrive when I open the app" — with no diagnostic signal at any layer: microG logs nothing, the app's connect attempt hangs (no exception), and the backend never sees a request. Incoming-call alerts degrade the same way, and call signaling cannot complete.
The root cause is that microG implements the GMS-parity Doze exemption (addPowerSaveTempWhitelistApp / addToTemporaryAllowList) but gates it on holding android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST — a signature|privileged permission that a user-installed microG does not have — and the skip is completely silent. Notification messages (notification block in the FCM payload) are unaffected, because the system renders them without starting the app; so server-side workarounds can restore message alerts, but tickle-driven fetches and call signaling remain broken.
Why apps depend on this (the tickle pattern)
- Backend cannot deliver content in the push itself (e.g. end-to-end encrypted payloads), so it sends a minimal "wake up, fetch now" data message.
- High-priority data messages are the documented mechanism for Doze-exempt wake-ups; GMS grants the woken app a temporary allowlist (
DeviceIdleController.addPowerSaveTempWhitelistApp-equivalent) precisely so its immediate fetch succeeds. - Every silent failure in this path degrades the app to "notification arrives only on app open" — the worst possible UX, with nothing in any log pointing to the cause.
Environment
- microG Services v0.3.16.1.25432, installed as a user app on vanilla LineageOS 22.2 (not the for-microG build)
- Device: OnePlus 6T (fajita), Android 15 (SDK 35 →
PowerExemptionManagerpath) - App under test: background service woken via FCM high-priority data messages; content fetched over HTTPS from a home server
Reproduction (deterministic, ~5 minutes)
- App X registers an FCM token and is backgrounded. A message is queued on its home server.
- Force Doze:
adb shell dumpsys deviceidle force-idle adb shell dumpsys deviceidle get deep # → "idle" - The server sends a high-priority data-only message via FCM HTTP v1 (
"android": {"priority": "HIGH"}) → HTTP 200. - Observed:
adb logcat -s FCMService:*→FCM tickle received1.5–2.3 s after send, reproduced across multiple trials (11-16 16:27:10.579, 11-16 16:41:57.809). microG delivers the message and starts the app's service promptly. ✔- The app's immediate HTTPS fetch to its server never reaches the server (no request logged server-side), and no exception is thrown client-side — the connect attempt hangs on dropped packets, so a fetch without a timeout blocks indefinitely.
- No user-visible notification appears.
unforce-idle+ open the app: queued message is fetched and acknowledged immediately — the event was queued all along; only the woken app's network access was blocked.- Control: identical message with a
notificationblock, still in forced Doze → lock-screen notification instantly. ✔ - Check:
dumpsys package com.google.android.gms—CHANGE_DEVICE_IDLE_TEMP_WHITELISTis present in the requested permissions (manifest declaration) but not granted (absent from theinstall permissions:block / nogranted=true), which is the expected state for a user-installed (non-priv-app) microG;dumpsys deviceidle tempwhitelistshows no entry for the target app after the tickle.
Root cause (microG master, 2026-11-16)
McsService.onCreate()initializes the reflection handles forPowerExemptionManager.addToTemporaryAllowList(SDK ≥ 31) orIDeviceIdleController.addPowerSaveTempWhitelistApp(SDK 23–30) only ifcheckSelfPermission("android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST") == PERMISSION_GRANTED. Otherwise the fields stay null and nothing further happens.- On message delivery,
sendOrderedBroadcastis preceded byif (app.wakeForDelivery) addPowerSaveTempWhitelistApp(packageName). addPowerSaveTempWhitelistApp(String)null-guards both reflection handles and logs nothing when they are null — the skip is invisible.wake_for_deliverydefaults to1(GcmDatabaseschema) and is exposed per app in the Push Notification settings UI, so the per-app gate is normally satisfied.- The allowlist duration granted is 10 s (
10000ms), sufficient for an immediate fetch.
Test matrix (all on the device above)
| Trial | FCM message | Device state | Result |
|---|---|---|---|
| A | data-only | idle hours | no visible effect (fetch hung silently) |
| B | data + notification |
screen off ~1 min | lock-screen notification instantly |
| C (baseline) | data-only + queued event | awake, app backgrounded | notification promptly (fetch works when not in Doze) |
| C′ | data-only + queued event | forced deep Doze | silent; message only after app open |
| D | data + notification |
~3.5 h natural Doze | lock-screen notification instantly |
| E | data + notification |
~24 h Doze + Wi-Fi loss/reconnect | lock-screen notification instantly; microG "Connected since" confirmed reconnect at Wi-Fi return |
| E2 | data + notification |
forced deep Doze (same state as silent C′) | lock-screen notification instantly |
| F | data-only | forced deep Doze, logcat attached | FCM tickle received +1.5 s; no fetch request server-side; no exception |
| G | data-only + queued event | forced deep Doze, logcat attached | FCM tickle received +2.3 s; no fetch request server-side; no exception; no notification; message flushed only after unforce-idle + app open |
The C′/E2 pair isolates the variable precisely: identical Doze state, identical delivery — only the notification message renders; the data message wakes the app whose network is then blocked.
Additional data points
- App Standby Bucket of the target app:
20(working set) — notrestricted(am get-standby-bucket), so bucketing does not explain it. - microG itself is in the deviceidle whitelist:
dumpsys deviceidle whitelistshowsuser,com.google.android.gms,10223. - microG Cloud Messaging status reports a persistent connection ("Connected since N hours") spanning the whole test window, and reconnects promptly after Wi-Fi loss even in Doze — socket liveness is not the issue.
- The block applies while charging (forced-idle test runs on cable show the same hang) and in overnight natural Doze (~7.5 h): server accepted the tickle (HTTP 200), phone stayed silent until the app was opened.
- Installing microG as a privileged system app (e.g. LineageOS for microG builds, which ship the privapp-permissions whitelist) is expected to fix delivery — consistent with the permission being the differentiator.
Expected behavior
Either the exemption is granted when the permission is available, or — when it is not — the condition is observable: a log warning and an indicator in the Push Notification settings (e.g. a banner in PushNotificationFragment: "microG lacks CHANGE_DEVICE_IDLE_TEMP_WHITELIST; apps will not be exempted from Doze on push delivery").
Actual behavior
Silent no-op: push data messages are delivered to the app process, but the app cannot use the network in Doze. End users experience "push only arrives when I open the app" with no hint that a privileged permission is the root cause. The failure is invisible at every layer: microG logs nothing, the app sees a hung connect (no timeout fires), the server never sees a request.
Impact
User-installed microG on vanilla ROMs (a very common configuration) silently degrades every app relying on tickle-based alerting: message alerts require server-side notification blocks as a workaround (and those cannot carry E2EE content or notification actions), while call signaling, remote-wipe, on-demand sync, and similar wake-and-fetch flows remain broken. Nothing in the UI, logs, or documentation points to the privileged-permission requirement.
Suggested improvements
- Log a clear warning (once per boot) when
CHANGE_DEVICE_IDLE_TEMP_WHITELISTis missing but GCM/MCS push delivery is active. - Surface the condition in the existing Push Notification settings UI.
- Document the privileged-installation requirement for reliable Doze push in the README/wiki.
Questions
- Is there a supported path for user-installed microG to obtain
CHANGE_DEVICE_IDLE_TEMP_WHITELIST(privileged install via root/desktop installer, or ROM-side grants)? - Would a pull request adding the warning + settings indicator be welcome?
Activity
biemster commentedon Nov 16, 2026
Maybe just add a check in the Self-Check thing in Settings? This took me a full week to diagnose, after a few weeks wondering why I was missing messages.