Skip to content

Apps using FCM tickle-based alerting are silently degraded on user-installed microG: app is woken by high-priority data messages in Doze, but network access stays blocked #4014

Open

Description

@biemster

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 → PowerExemptionManager path)
  • App under test: background service woken via FCM high-priority data messages; content fetched over HTTPS from a home server

Reproduction (deterministic, ~5 minutes)

  1. App X registers an FCM token and is backgrounded. A message is queued on its home server.
  2. Force Doze:
    adb shell dumpsys deviceidle force-idle
    adb shell dumpsys deviceidle get deep     # → "idle"
    
  3. The server sends a high-priority data-only message via FCM HTTP v1 ("android": {"priority": "HIGH"}) → HTTP 200.
  4. Observed:
    • adb logcat -s FCMService:* → FCM tickle received 1.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.
  5. 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.
  6. Control: identical message with a notification block, still in forced Doze → lock-screen notification instantly. ✔
  7. Check: dumpsys package com.google.android.gms — CHANGE_DEVICE_IDLE_TEMP_WHITELIST is present in the requested permissions (manifest declaration) but not granted (absent from the install permissions: block / no granted=true), which is the expected state for a user-installed (non-priv-app) microG; dumpsys deviceidle tempwhitelist shows no entry for the target app after the tickle.

Root cause (microG master, 2026-11-16)

  • McsService.onCreate() initializes the reflection handles for PowerExemptionManager.addToTemporaryAllowList (SDK ≥ 31) or IDeviceIdleController.addPowerSaveTempWhitelistApp (SDK 23–30) only if checkSelfPermission("android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST") == PERMISSION_GRANTED. Otherwise the fields stay null and nothing further happens.
  • On message delivery, sendOrderedBroadcast is preceded by if (app.wakeForDelivery) addPowerSaveTempWhitelistApp(packageName).
  • addPowerSaveTempWhitelistApp(String) null-guards both reflection handles and logs nothing when they are null — the skip is invisible.
  • wake_for_delivery defaults to 1 (GcmDatabase schema) 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 (10000 ms), 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) — not restricted (am get-standby-bucket), so bucketing does not explain it.
  • microG itself is in the deviceidle whitelist: dumpsys deviceidle whitelist shows user,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

  1. Log a clear warning (once per boot) when CHANGE_DEVICE_IDLE_TEMP_WHITELIST is missing but GCM/MCS push delivery is active.
  2. Surface the condition in the existing Push Notification settings UI.
  3. Document the privileged-installation requirement for reliable Doze push in the README/wiki.

Questions

  1. 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)?
  2. Would a pull request adding the warning + settings indicator be welcome?

Activity

  1. biemster commented on Nov 16, 2026

    @biemster
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions