133 points · by anthropodie · 6y ago · 169 comments
Looking at the landscape of shit software out there, I find this justification entirely plausible. If iOS & Android didn't lock this down, phones would be running 4-5 different poorly implemented push platforms (or more). Battery performance on mobile would be utter crap.
There is a big balancing act going on here. People want phones that do the thing they are supposed to do. They also want battery life to be excellent and the device to be secure by default. It's impossible to give 3rd party devs 100% access and meet those 2 demands.
1. From client get a push url.
2. Pass that to your app server for future use.
3. Send notification json to that url.
4. That url points to the specific browser vendor's Push notification server, and when it recieves a notification from your app server. It relays the message to the client.
And that url is different for different browsers.
Firefox - https://mozilla-push-service.readthedocs.io/en/latest/
Chrome - uses FCM
Can't configure a custom push server endpoint, like self hosted server without shipping your own browser.
There are bad actors abound but many users were navigating the environment semi-ok, checking for information on how bad their apps were acting.
The clampdown is both for the user but also enormously user hostile. We can try to pin down how justified or not it is, but it bloody sucks either way & I am worried, really worried, with current events like Mozilla & Apple teaming up to decry webmidi & ambient light sensing as enemies. Yes they have some risk? But mostly this comes off as farce to me, & spun with heavy marketing "be afraid" FUD.
Stop mistaking your unique desires for those of the vast majority of smartphone users. Very few care about alternate push notification services, or sideloading, they are happy to use the default app stores and services.
I truly hope Pine phone picks up share (and performance/ functionality) so people who want this level of control over what their phone runs have a platform.
A lot of people don't know how to manage their phones. I know how to manage performance on my computer but would prefer to not have to do the same on my phone. I suspect I'm not the only computer professional who wants to leave that sort of administrative detail to their work life and not have to deal with a phone that crashes due to a poorly written app.
I suspect this is why the iPad is so popular. It has much of the power people expect from a PC, but removes much of the headaches associated with them.
My feeling here is there is space for managed platforms such as the phone and the iPad; less managed platforms like the Windows/ MacOS; and truly open platforms like Linux. I'm not sure open platforms are very well suited to phones myself, but I'm not against them either.
The post is Android-centric because in typical Android fashion, a passable concept is implemented is the most disjointed way varying scross devices.
Limiting excessive background communication? Thats a good thing.
Killing useful apps like media players in the background repeatedly until you end up with 1 star reviews because people don't realize their own phone is killing apps?
Intentionally breaking well defined OS scheduling guarantees?
Silently breaking functionality that users rely on?
Making alarms fail to ring?
Not as useful.
It's to the point there's literally a website dedicated to worksrounds: https://dontkillmyapp.com/
Look at at this entry for OnePlus
> Not only did users need to enable extra settings to make their apps work properly, but those settings even got reset with firmware updates. So apps break again and users are required to re-enable those settings on a regular basis.
What's funny/sad is their edit only applies to vanilla Android. Other manufacturers have manufacturer-specific settings needed to whitelist apps, because they're not respecting the contract Android provides on background processing
-
And maybe the most insulting part is the fact that the apps that consistently show up as higher energy users on people's devices... like Facebook...
Are normally exempt! These "optimizers" usually exclude any app deemed "too big to make fail".
So it actually undoes an enormous amount of good that would otherwise be done, and shows it's hardly being done with actual results in mind
These optimizers have existed since the early days of Android, but advanced users understood that intentionally breaking apps wasn't the right way to go about saving battery.
Manufacturers picked them up, in large part because clueless users who like the sound of the idea (right up until it starts killing their music or making their alarms fail to ring) were installing them
Some of them even feel like anti-competitive implementations.
Huawei has an implementation that can't be controlled by the user on some devices! So only apps on the pre-installed Huawei whitelist can run in the background period, and that list includes their homegrown apps and a few major ones like Facebook. Good luck if you have a small app with useful functionality.
This is arguably one of the biggest problems in tech and as devices get smaller and more personal, it's only going to get trickier. Your watch battery isn't going to last all day when you are running a crypto currency miner which is disguised as a media player.
A non-user modifiable app killer isn't the fine line separating us from media app currency miners.
How are Google's devices keeping OS guarantees while delivering some of the best in class battery life figured on Android
Also, imagine seriously implying it's ok they blanket-kill user installed media players because there's a chance they might be currency mining?
https://www.cnet.com/news/vlc-for-android-blacklists-huawei-...
> The decision came in response to the Chinese phone maker's decision to cut off all background apps except its own, which stops VLC's audio playback, VideoLAN said in a tweet.
Here's a real, not made up, not founded in a slippery slope from allowing music to allowing crypto mining, example of what these manufacturers are doing to users and devs alike.
-
It's not about battery life, it's about flexing their power to seem like they're doing something, while ensuring their bundled apps are the best option for a wide range of tasks
In fact, you can look at the manufacturer list and come to that conclusion yourself.
The manufacturers at the top of the list of breaking optimizers are mostly selling devices heavily subsidized by bundled services. Even Samsung is more aggressive on cheaper devices that target BRIC markets because they need revenue from bundled services.
-
Google is the only exception to the rule... until you realize their devices are just following the guarantees Android makes.
And they still manage to have some of the best battery life on the market.
That's because it's not even as simple as just blindly killing background apps.
When you kill these background apps, users get in the habit of opening the apps back up manually to not miss updates.
Repeatedly waking the radio is more battery consuming than if the OS just keeps it's promises and smartly wakes these apps.
It's not like they get infinite processing time anyways, having this stuff be managed intelligently instead of just taking a sledgehammer to the concept of background processing is better for everyone involved but a manufacturer that wants their music app to be the only functional one...
This is true with current implementations, but it doesn't have to be true.
Coordinated CPU wakeups and radio packet timings would mean the power consumption from waking the radio would be not much larger with 5 apps than 1.
It needs coordination, but the coordination doesn't have to be done inside a service daemon as it is now, and it doesn't have to go through one shared cloud service provider as it is now.
The savings are from letting radio go to idle. If you have more than one (ideally non-cooperating) services that are keeping the radio permamently on, you won't ever get to idling and say good bye to battery.
What does the software solution look like that distinguishes between a crypto miner and a media player?
How can you tell when an app legitimately needs access to files from another app versus being malware of some sort?
And it would not be impossible to coordinate the return timings to match either.
Or even better, to have just one low-level packet shared among them all, with a mobile operator or backbone protocol that fans them out and in, analogous to multicast and IGMP but designed for push/keepalive systems.
There are no insurmountable technical obstacles. Just challenges.
There is negligible consequence for power consumption too, with a suitable API.
But rather than design for everyone, as we would have seen in the utopian days of the internet, it's much easier to run a single walled-garden service, and it fits with the "you must go through us for everything" model used by many of the device's other services.
This SDK has "Google Analytics for Firebase" enabled by default, and they use dark patterns to make it seem like having Analytics enabled is required: https://imgur.com/a/Nk2KhFo
Of course, if you do enable analytics, then Google sucks up your customer data (including in-app purchase behavior!) for their own data collection and advertising purposes. Also, you're required to tell your users this is happening, but of course developers don't know this. (More dark patterns in how Google reveals that they steal your analytics data for themselves: https://imgur.com/a/R0K71Zn)
Enabling it in your project like you show on the screen does basically nothing as long as you don't have analytics SDK in your app.
This is stated right before the steps you show. Only the one who doesn't read will blindly add analytics.
Can also be distributed via doc browsers like Dash, e.g. if censored from the web.
This would be a "vendor documentation annotation" service not controlled by vendor.
Edit: the article references this HN thread, which I'm sure we'll end up rehashing: https://news.ycombinator.com/item?id=22310319
The thing I hate is megacorps slowly infringing and removing device/OS freedoms in the name of some stated "good cause" (security, malware prevention, battery life, etc.).
And phones know your location virtually 100% of the time because of cell tower triangulation. That’s part of being a phone, not a google hypocrisy.
The real problem is pushing everyone towards unconfigurable closed software that would otherwise abuse full access to the device. Because people can’t trust what they run on their phones the apps can’t be given any more privileges than a random web page.
This only works on a platform where apps can run in the background indefinitely. Small memory, limited CPU, and battery life means apps have short life-spans on phones.
This is why there is a push notification service for mobile platforms.
The reason apps have to have short lifetimes on people’s phones is because they’re encouraged to install untrusted software as native apps.
So the only way to get push notifications on, say, apps that provide a client for generic protocols or self-hosted services, is for either the app developer to run a proxy gateway (which inevitably runs into scalability issues forcing them to start charging for it or require registration with free quotas), or for you to create your own build of the app. I ended up having to do that with Linphone, rebuild it under my own app ID with my own FCM creds, just so I could get push notification integration with my own SIP server instead of having to keep a background SIP connection open to receive calls.
This is completely silly, with the only free endgame being everyone has to compile their own apps and have one app installed for every potential provider, even if they share a protocol.
trivially addressed via a proxy, which you’d want anyway to properly monetize it
There's probably no wish to monetize, just to distribute working apps for free.
You're right that the issue is easily addressed with a proxy.
But now you need to maintain and pay for a proxy in perpetuity, for other people to use who aren't paying anything.
Even if it's cheap, maybe you don't have the time. It will break occasionally. Knowing there are people who may depend on it 24x7x365 is burdensome too. You'd like to have vacations.
It's not very open source friendly if other people can't just take your software and run it themselves without depending on you.
Those other people can avoid depending on you by registering themselves with FCM, but having to do that is not open source or self-hosted friendly either, which was the GP's point.
Before manufacturers come up with there GCM alternative, each apps actually have there own service to handle push messaging. It is fine when the number of apps is small, but drains a lot of battery when it gets larger. So manufacturers started to introduce some aggressive strategy to kill background processes to save batteries, but it also makes small developers' app less usefull. It is because apps from big corporations usually get a pass, while others will be killed. Now, as far as I know, manufacturers have their own GCM alternative now as an alliance.
So I think even if you don't have it, you eventually need one, because it is too inefficient to let each apps handle this by themselves.
I’m just glad my pinephone shipped and everything on my phone actually makes sense now (even if I have to compile things and write a few config files.)
You say this like it's some egregious burden. Compared to the cost of building an app and shipping it $100/ year is a fraction of a drop in the bucket. It's less than 1 developer hour.
If you are capable of building an app with push service, the cost is trivial. If you aren't capable, it's irrelevant.
Why the hell do I have to pay $100 a year to use a computer I own? Why are you defending this!?!
And where is the option for those of us who don’t mind less battery in exchange for actually getting prompt notifications for services we use?
Apple has an obligation to its customers to make their phones work as well as possible. Customers complain all the time about mysterious battery draining behaviors, and blaming various apps. Having millions install some cool new notifications service without realizing it’s actually a battery draining service just multiplies those problems.
You always have the option to build your own phone. With easily available components and open source software it’s never been easier. And with cheap and flexible Chinese manufacturing, Kickstarter and Patreon it’s never been easier to manufacture your own phone design.
Otherwise, your demands don’t reflect the needs of the vast majority of Google and Apple customers. The world doesn’t revolve around your unique desires.
This is a pretty tough alternative. No developer is going to say "I have ill intent here"; are you confident you have the ability to make that decision on your own? I'm not confident I do. I can't look at the code of most of the stuff I run on my phone. Some people would say "then stick to all open source software," but I don't have the time or expertise to audit the code of all -- or even most -- of the applications I run. Maybe other people will, but there's no guarantee they'll find anything bad (whether malicious or just buggy) very quickly -- and we're talking about cloud stuff here, which means there's a server none of us can audit involved in the process.
Apple and Google having "blessed" push notification systems is certainly a tradeoff on multiple levels, from it being a single point of failure to being another server you can't audit and a single company you have to trust to at least some limited degree. But having the notifications integrated at the OS level reduces the number of people and systems involved in delivering those notifications, at least theoretically reducing the number of bad actors -- and, as many people have observed here, also lets these notifications be optimized for battery life in a way that's probably not possible if you have dozens of apps running their own background processes rather than simply asking to be notified by the system one. The alternatives are a different set of tradeoffs. That doesn't necessarily make them worse, but it definitely doesn't automatically make them better.
> And where is the option for those of us who don’t mind less battery in exchange for actually getting prompt notifications for services we use?
The alternate scenarios give you less battery, but don't guarantee actually getting prompt notifications for services you use, do they? They just give you different points of failure. Actually, they might even give you the same points of failure. When a DoorDash notification shows up on my iPhone late -- or as it did the other day, inexplicably 20 minutes early, leaving me standing in Silicon Valley's smoke-filled air quizzically looking for my chicken order -- is that Apple's fault, or is it DoorDash's fault? After all, the notification isn't starting on Apple's server. If the problem is with DoorDash, which the early notification had to be, then if DoorDash could bypass Apple's notification system all that would give me is an incorrect notification delivered with fewer network hops.
Is each app going to be killed when not in foreground ? Or are they all going to keep running ?
Is there going to be special API for background download manager, notification listening, music playing, etc. or is each app going to keep running in background and do its own stuff like on Desktop ?
For Google & Apple things are super easy : they do what they want.
But For Linux Phones, people from KDE, Gnome, Wayland, Purism, etc. will have to agree on services & APIs which might take lots of time
The phone is suspended when the power button is pressed. Reciving network traffic (ex responses to IDLE on an open IMAP connection) wakes it up and there’s a service that suspends it again fairly quickly if the power button hasn’t been pressed. Another service manages an RTC alarm so that programs expecting pushed data can reestablish sockets if they die (since that won’t necessarily wake the phone.) The only disadvantage to this scheme is that there are more keepalive messages sent (so you should limit the number of services expecting push messages to just a few.)
Mine runs a normal X11 DE (fluxbox) so the apps run in the background just like they do on my laptop. If something wakes the phone up too often just kill it.
I’m still working out the kinks but it seems to get decent battery life this way. No need for some special API.
How can you listen to network events while being suspended ? I thought that on linux suspend = all user processes stopped. Does it somehow wake up every nth second to check if there a new message from the network ?
A bit like some browsers do to timers in non-foreground tabs.
But RAM might also be a problem if the phone keeps everything in background & isn't allowed to kill any app when it needs to
My friend has one with an ATT sim, and calls+SMS works just fine on postmarketOS. The UI is really sluggish though.
And there is microG, to hook into the Google way of doing things.
Also, this is not just about push. The problem is that Apple and Google de facto own the edge user interface: phones.
Android has moved from a mostly unrestricted environment to one that's pretty restrictive. Which means things have been taken away, and things that would have worked in gingerbread can't work today. And it's big things with reasonable use cases too: background exection and network access used to be pretty reliable (minus wifi tended to turn off with the screen), now it's not --- if Google push doesn't work, no notifications until the user starts the app or Google lets you run; you used to be able to use a usb camera from an app, now you can't with latest Android, so keep an old phone for inspection cameras.
I understand unfetered background execution is problematic, but it's also useful.
The technical part is not the hardest part; it's the "everything else".
It hasn’t taken off yet because it’s only barely started shipping.
>why not shutdown location and frequent play service updates as they aren't helping my phone battery either
They do. The recommendation is to use the location library that batches GPS use instead of manually calling it per app. The playstore uses heuristics to know when to query for updates and when to download. Its better that the OS batches these sorts of things.
There may be some valid critique but this article is devoid of anything useful.
A: Never work, because NAT isn't going away (even with increased IPV6 adoption). Even locally it will work less and less because "block all incoming connections" host firewall configs will eventually become the norm.
B: Be a security risk waiting to happen (EX: Chromecasts using UPNP to expose themselves to the internet, which were immediately blasted with broadcasts from one of PewDiePie's wretched fans).
However, the Push API refers to a recommended IETF protocol for providing the push service: https://tools.ietf.org/html/rfc8030
> A self-hosted push notification service.
If energy used by firing up the CPU frequency plus the 4G radio to send some packet is the main battery drainer, why not just synchronize the poll of multiple notification servers?
The CPU will be waked up, a few data packets will go to a few notification servers, then in the common case of no notification everything goes back to sleep.
If it's the network that wakes up the phone when some packets are there (as WiFi energy saving does), if synchronized in time (NTP goog enough) it should also work and be energy efficient.
Probably naive, curious about real world measurements in this area :)
Google/Apple work directly with carriers to extend the timeouts for their push services so the phones aren't required to send keepalive packets every 30 seconds to keep the connection alive. Carriers won't be willing to do that for every random server out there.
This is just one of many ways these push services are carefully designed/operated to save as much battery life as possible. If you had more than one notification service, battery life would degrade to the worst performing one (the radio would be forced to wake up to keep every notification service alive... Even if the Google one could go minutes between the keepalive packets)
(Another is the way Google batches low priority notifications... Sending a push message won't immediately wake up a phone - it delays to try to batch as many messages as possible. This scheme breaks down if messages aren't all routed through a single server)
But imagine you are a company running one of the big mobile platforms. You could invest effort in the APIs and OS behavior to do this, and the payoff would be loosening your grip on the ecosystem. Tough to justify to those watching the ROI.
You'd need mobile IPv6, and background applications that don't get killed while listening to a socket. As far as I know, neither of those are commonly available.
edit: removed stuff about Push via SIP, that might be too incorrect to be helpful. Also removed some pondering about trying msg.exe over IPv6. I was probably fishing for trouble there.
In 2030 we won't have native IPv6 and it won't be on the drawing board.
That’s something that is hidden from users, they put their phone in their pocket and two hours later their battery charge is substantially diminished. They don’t understand why or how to stop it.
They know playing a game for hours straight reduces battery charge.
It’s called cell tower triangulation and your phone needs to do it constantly, or you can’t receive or send calls.