Hacker News new | ask | show | jobs
by catdog 47 days ago
There is also the problem, that some OEMs add their own "battery optimizations". If you simply don't run anything its indeed very battery efficient... Forcing push notifications through some central service has minimal benefits at best. Open source variants are forced to publish annoying persistent notifications and ask the user to flip some "battery optimization" toggle deep inside the settings to not get killed, of course this often enough changes with Android versions.
1 comments

You're talking about the standard battery optimizations where the end user needs to approve apps repeatedly waking up the app from sleep and running continuously while awake. OEMs have been required to stop doing most of the non-standard things they were doing in relation to this and it's not hard for app developers to deal with anymore unless they care about it on end-of-life Android versions.

The persistent notification for foreground services is mandatory for apps to implement but entirely optional for users. The notification channel can simply be toggled off to hide it. Apps are required to make a notification for each foreground service to provide transparency. It gives apps a way to explain why they're doing it to end users and the notification be toggled off if the user doesn't want it. It can also be kept enabled but collapsed at the bottom with no lockscreen or status bar display. Apps are required to use at least low importance themselves so the user needs to opt in to collapsing and hiding it or turning it off.

Fully open source apps can use UnifiedPush as the Molly fork of Signal does instead of their own push connection. Similarly to FCM, UnifiedPush providers can provide reliable and efficient push messaging including push notifications. Unlike FCM, users can choose the local implementation and the service providing it including the option to self-host it. There are multiple options available as an existing service. There are a growing number of apps supporting UnifiedPush.

Signal's own fallback push messaging for push notifications when FCM isn't present is very inefficient. It substantially reduces battery life even if it's the only app doing push with another mechanism. Molly's UnifiedPush support works much better.

Using a single push messaging connection or at least only a couple (FCM and UnifiedPush) is definitely far more efficient than using dozens. Using many push messaging connections will drain a lot of power due to each needing to be maintained with regular checks which will typically not align well. Having many causes a drastically higher number of wakes from sleep and non-idle time. That's especially true if the push messaging connections aren't implemented very efficiently. Even a single inefficient one can drain a lot of power.

Signal's fallback isn't as bad as it used to be but it's not efficient. They should support UnifiedPush as Molly does for a better non-FCM push experience. Signal's fallback push is a common way people ruin battery life on GrapheneOS.