Live data from Hacker News

Android now forces apps to include proprietary code for push notifications

reddit.com

251–260 of 284 posts

Re: Android now forces apps to include proprietary code for push notifications

#251

Earlier quoted context omitted.

For completeness' sake: even power users cannot really do with their devices as they please, if they don't happen to be kernel hackers with a few months' worth of time to spare. If google was trying to hit some sweet spot (I'm not willing to give them the benefit of the doubt here any longer) then they would not spout such obviously wrong BS to scare users into submission. Conversations and telegram both put the work…

> even power users cannot really do with their devices as they please, if they don't happen to be kernel hackers with a few months' worth of time to spare. You don't have to be a kernel hacker to build & flash AOSP. Google has a guide on it: https://source.android.com/setup/build/running But whether or not you consider this a "power user" or not is obviously less clear cut. How you define "power user" does of course…

Not sure why you are bringing this up. The point of this thread is the misleading warning or other OS level changes that are forced upon you if you don't use FCM. Changing that behaviour needs changing AOSP.

Re: Android now forces apps to include proprietary code for push notifications

#252
post #185

Earlier quoted context omitted.

That was exactly the state of the Android until 6.x or so and I've had multiple frustrating hours of mentoring Android developers on how to do notifications respectfully just to be ignored with "eh, I'll poll every 10 minutes, it's easy and it works!". And this has been my experience constantly: - "Eh, I'll just demand full storage access for my game, it's easier to unpack files in root of sd card" - "Eh, I'll just c…

Defending users by actively lying about battery usage is not acceptable. Battery meter in 8 was accurate and flagged battery eating apps accordingly. This new thing is actively lying when you don't use Firebase, as if nobody can ever correctly implement push notifications.

> This new thing is actively lying when you don't use Firebase

It is lying, alright.

That said, I don't think that this lying notification is the best example of Android designers being nefarious jerks. The notification lies to user about non-existing "battery drain", but it only does so when developer tries to get around the requirement to show notification with foreground Service. It is shown when you set notification to be hidden via low-priority. I have also seen it when notification icon was fully transparent. It is basically a retaliation against developer misconduct (when developer tries to run persistent background process without telling user). Ideally, this should encourage developers to show a proper foreground Service notification, which the user may consequently hide via notification settings.

Re: Android now forces apps to include proprietary code for push notifications

#253

Since the FSF does not consider GPLv2 to be Apache 2.0 compatible, telegram-FOSS is GPLv2, and Android libraries are usually Apache 2.0, you have always had a problem. They also use a ton of Apache2 libraries (at least 5 or 6) directly in their source repo. They don't appear to even bother to properly give attribution/etc for the used software, so yeah.

This is so damn true I am LMAO at the other comments. So basically the entire community can get around the problem by releasing an Apache2 lic'd library that wraps whatever it is they need from firebase.

We'd be at a place no different from any other "FOSS" App on android today.

And https://opensource.stackexchange.com/a/4642

Re: Android now forces apps to include proprietary code for push notifications

#254

Earlier quoted context omitted.

Signal switched to FCM about 4 months ago and I've had constant delayed-notifications issues too, usually in the 20 minute range. I can see the problem in Signal itself, the "sent" and "delivered" timestamps will be 20 minutes apart despite be actively doing stuff on my phone -- so the internet connection is there and the phone isn't sleeping. When I actually re-open the Signal app all the notifications flood in at o…

Hey! Signal dev here. We've actually seen delayed notification both before and after the switch to FCM. My guess is that newer Android versions are just becoming more and more aggressive with their battery optimizations. We send high-priority FCM messages, but the device will still bundle them together in order to deliver them in batches. Even worse, there are times we are delivered an FCM message but network access…

If you receive "actual contents" separately from GCM ping, you are probably being hit by Doze Mode. Doze is disabled for foreground Services, so your best bet is starting a foreground Service (via startForegroundService) _and_ taking wake lock (from within foreground Service, after your app is considered fully foreground).

Historically Android devices used to sleep by entering low-power CPU mode (sometimes complete with low-power radio and WiFi modes). In that mode all apps and kernel are heavily CPU throttled to the point when you can get network timeout because kernel TCP stack can't send packets fast enough. This is what gets disabled when you take a wake lock.

Doze Mode throttles individual apps by moving them into low-priority cgroup. In effect Linux kernel hardly ever schedules your process anymore. Doze Mode is not disabled by wake locks, only by starting a foreground Service.

Both Doze Mode and low-power CPU mode can coexist, leading to effectively 110% loss of CPU time by your process.

Re: Android now forces apps to include proprietary code for push notifications

#256
post #132

Earlier quoted context omitted.

> It doesn't matter how much money Google is going to have to pay in the future as a fine for this practice. The amount of money that they will get for kicking out the competition is going to be way higher. That is a learned lesson from Microsoft (and probably others before them). The competition in this case is Apples iOS, for which even HackerNews users love to harp over and over and over again how amazing it is an…

I don't think you're focusing on the entire picture. Some people here like iOS for the reasons you described. However I'm willing to bet, unless you can show me otherwise, that it's a vocal minority. I don't know of anyone personally who is happy that Apple disallows GPL code. Comparing Apple's digital Fort Knox with Google's unsupervised free-for-all is a false dichotomy. There exists a happy medium, where power use…

I don't know of anyone personally who is happy that Apple disallows GPL code.

And this is what you call a geek bubble. In the grand scheme of things most people don’t know what the GPL is and out of those, only a minority care about it running on their phone.

Re: Android now forces apps to include proprietary code for push notifications

#257

Earlier quoted context omitted.

Treble is required by the Vendor Test Suite for Android 8 and higher. https://source.android.com/devices/architecture

This is probably still in Google's best interest, since it greatly reduces the cost for OEMs to distribute updates (and updates are one area where Android severely lags behind iOS)

[deleted]

Re: Android now forces apps to include proprietary code for push notifications

#258
post #172

Earlier quoted context omitted.

GCM/FCM will delay low priority notifications, in order to batch as many together as possible. On top of that, the cell networks don't allow keeping a socket open for more than a few minutes without sending keepalive packets. Unlike on desktop, keeping a socket open isn't "free" on mobile. Waking up the cell radio has a significant penalty on battery life. (And yes, Android batches up process wakeups as well. See the…

> On top of that, the cell networks don't allow keeping a socket open for more than a few minutes without sending keepalive packets. Unlike on desktop, keeping a socket open isn't "free" on mobile. You are wrong. Cell networks don't prevent you from keeping a socket open for however long you want. For how to keep your sockets alive, see https://developer.android.com/reference/android/net/SocketKe...

There are collaborations between mobile network providers and push notification providers to get these sockets special-cased. I.e., they won't need keep-alive at any regular interval. So the radio can actually get layer-1 pings (like, when you're called, or get an SMS) for push notifications.

Re: Android now forces apps to include proprietary code for push notifications

#259
post #219

Earlier quoted context omitted.

> On top of that, the cell networks don't allow keeping a socket open for more than a few minutes without sending keepalive packets. Unlike on desktop, keeping a socket open isn't "free" on mobile. You are wrong. Cell networks don't prevent you from keeping a socket open for however long you want. For how to keep your sockets alive, see https://developer.android.com/reference/android/net/SocketKe...

That method just instructs the OS to send keepalive packets on a system thread. It saves some CPU power by letting your process sleep, but still requires waking the cell radio up periodically. The implementation can be found here: https://github.com/aosp-mirror/platform_frameworks_base/blob...

That's right. And it should work as advertised in the documentation. Anyway, I was responding to the "cell networks don't allow" part of your comment. Cell networks don't have a say in what I do at IP/TCP layer.

Re: Android now forces apps to include proprietary code for push notifications

#260
post #250
post #142

Earlier quoted context omitted.

Please forgive me for being unnecessarily obtuse this early on a Monday morning. Where does Apple say that GPL code isn’t allowed on the App Store? I ask entirely out of my selfish need to avoid unpleasant surprises later on.

They don’t- it’s the FSF restricting developers freedom. Not Apple.

How? I'll debate FSF ethics as much as the next guy, but they clearly state they want end user freedoms such as the freedom to modify the application you use. Apple clearly doesn't want that if you use specific GPL versions.

This is an Apple problem, not FSF.

Post reply on HN