News for hackers. Stuff that matters.
Re:Treble: A modular base for Android by sorenjan on Friday May 12, 2017 @03:46PM (#14327253)
Finally, can't believe it took them this long. The sorry state of the update situation is one of the worst things about Android. Next step would probably be to provide an API to the OEMs so they can add their "value add" functionality as apps, so Google can push updates to all phones regardless of hardware drivers and OEM modifications. And maybe make it possible to update emoji via the Play store, instead of needing a new system update. I don't like the blank boxes in messages from my iOS friends.

I wonder if this means that Google will lead by example and prolong the time they deliver updates to their own phones. They don't guarantee new updates to their current Pixel phones after October 2018 [0], which is not good enough.

[0] https://support.google.com/pixelphone/answer/4457705?hl=en

Re:Treble: A modular base for Android by pjmlp on Friday May 12, 2017 @05:41PM (#14328164)
It is an illusion to think this will ever change, if Google doesn't make it legally binding to having updates in place to access Google Play Services for example.

There are no incentives in place for doing otherwise.

Already in the old days, Nokia was one of the very few manufacturers that bothered to provide firmware updates, and even then usually only once.

Re:Treble: A modular base for Android by sorenjan on Friday May 12, 2017 @07:30PM (#14328732)
If Google makes it easier for manufacturers to make phones that can be updated OTA by Google than phones that can not (custom Android builds) most of them would probably do so. Have a hardware layer, an Android system layer, an OEM layer, and have a clear interface between them so they can be updated independently. Then Google should push updates themselves, they can't leave that to phone manufacturers or carriers, like you said, there's no incentives for them to do so. Of course, this has been an issue for Android since day one, so I wont hold my breath.

Are there any work done on a system similar to the one on PC, where software can enumerate available hardware? We have advanced computers in our pockets, but they can't be updated to a new OS version as easy as a 15 year old PC. It's ridiculous.

Re:Treble: A modular base for Android by izacus on Saturday May 13, 2017 @03:58AM (#14329966)
But "ease" isn't the problem - the issues OEMs have are because they literally go hack and fork the AOSP source itself (making upstream merges hard or impossible) for sometimes really dumb reasons. This is also the source of constant headaches for us app developers (like the recent case where Realm found out that Samsung broke memmove() on their devices!).

The other issue is that there's zero (0, no) incentive to update the devices. No matter how easy it is - the OEMs see that as a pure cost that won't be recuperated. For each of the (literaly!) 100 devices they churn out per year they need to get new drivers from the SoC manufaturer (and Qualcomm pretty much does not give a crap about SoCs of the previous year, especially lower end ones - which makes this process stop there), update the kernel and move all their specific hacks to it.

I don't see how these changes Google did will change incentives. The only way we might see a change in this field is by a few class action suites from users being left without updates or regulators putting down the punitive damages hammer. Everything else is just Google kindly hoping OEMs will stop being dicks from the goodness of their heart.

In car industry we have strong regulation which demands that your car is serviceable at least 5 years since last unit was sold (and that their security issues are fixed by recalls). We need that for arguably the most important electronic devices in our lives as well.

Re:Treble: A modular base for Android by dragonwriter on Saturday May 13, 2017 @09:58PM (#14333848)
> No matter how easy it is - the OEMs see that as a pure cost that won't be recuperated

Treble removes much of the cause for forking, and removes the cost for OEMs that follow it's design.

Re:Treble: A modular base for Android by ViViDboarder on Sunday May 14, 2017 @09:52PM (#14338602)
Google can leverage a lot of control using Play Services. If, as gp suggests, they also create an OEM layer so the OEM doesn't have to fork Android and instead just builds on top of safe APIs, allowing Google to take over updates entirely, then Google can force OEMs to use it.
Re:Treble: A modular base for Android by throwaway47861 on Saturday May 13, 2017 @10:53AM (#14331261)
You pretty much made the entire thread superfluous. Very well articulated and I fully agree, the suits don't care if you reduce their expense if they can skip the expense whatsoever.
Re:Treble: A modular base for Android by chiefalchemist on Saturday May 13, 2017 @07:19AM (#14330390)
This is a bit above my pay grade so forgive me if I'm way off target but...

To some extent doesn't this make a case for (say) HTML# and browser based apps? That is the browser is a known sandbox of sorts. It's interface with the device (e.g., Phone app) is a known, and fixed. It has no care about what's on the other side of that wall. And the device OS more or less exists to run and support the browser.

But when the applications interface directly with the device, and there are countless device and OS, etc. combos there will always be a mess. Too many variables. Too many chefs in the kitchen if you will.

I realize I probably oversimplified. (Sorry.) I'm also outside my knowledge sweet spot, but am curious enough to want to learn. Please don't hurt me. Thank you.

Re:Treble: A modular base for Android by CyberDildonics on Saturday May 13, 2017 @09:29AM (#14330852)
It absolutely does. If webasm works out this is how I see things going. Android is already running things through a JIT.

I don't think users want dozens of apps installed on their phone, each with the possibility to be using up bandwidth, hogging resources, stalling programs and draining battery life, not to mention abusing permissions. If most apps can be done with webasm (and I don't see why the majority of apps can't be) then the only things that need to run in a more native context would be apps that use special features.

Re:Treble: A modular base for Android by pjmlp on Saturday May 13, 2017 @03:07PM (#14332463)
It also does AOT compilation with PGO gathered from the JIT.

Unless the browsers offer APIs at the same feature level as native OS APIs, web applications will always be a second class experience.

Re:Treble: A modular base for Android by CyberDildonics on Monday May 15, 2017 @08:51AM (#14341135)
Only for apps that need those native features.
Re:Treble: A modular base for Android by chiefalchemist on Tuesday May 16, 2017 @07:16AM (#14348726)
For example? As in, what doesn't Phone Gap offer access to?

But in any case, to your point, native apps should be limited to special cases (that can't be done via the browser). That's not the case ATM.

Re:Treble: A modular base for Android by pjmlp on Monday May 15, 2017 @09:34AM (#14341402)
Which means any app that respects its users by providing a suitable UI/UX using the best features of the OS running on the device they paid for.
Re:Treble: A modular base for Android by CyberDildonics on Tuesday May 16, 2017 @09:09AM (#14349231)
What does that even mean? Lots of apps don't need anything that isn't already exposed in newer web apis.
Re:Treble: A modular base for Android by kalleboo on Sunday May 14, 2017 @07:40AM (#14335206)
It absolutely does. I'm helping out on a bespoke app that needs to run on some discount Chinese tablets that are stuck on Android 4.something, and it's easier to target Chrome (which is still being updated) than the OS itself.
Re:Treble: A modular base for Android by 0xFFC on Friday May 12, 2017 @08:01PM (#14328865)
I am more optimistic than you two, i think for mide range and high range devices, there is incentive: competition.

But i have to agree, for low end devices, even from famous companies i dont think they will update their phone even with this.

Re:Treble: A modular base for Android by LeoPanthera on Friday May 12, 2017 @09:36PM (#14329173)
I remember having to physically take my Nokia Communicator into a service center to get the firmware updated.
Re:Treble: A modular base for Android by microcolonel on Friday May 12, 2017 @07:29PM (#14328723)
> Already in the old days, Nokia was one of the very few manufacturers that bothered to provide firmware updates, and even then usually only once.

When you put it that way, it seems like it's gotten a lot better.

Re:Treble: A modular base for Android by mavendependency on Friday May 12, 2017 @07:37PM (#14328763)
Wasn't it Google's fault anyway. Without a stable ABI, updates will require SoC vendor involvement, which is a limited time affair.
Re:Treble: A modular base for Android by pjmlp on Friday May 12, 2017 @11:56PM (#14329471)
That is what contracts are for.
Re:Treble: A modular base for Android by vetinari on Saturday May 13, 2017 @11:02AM (#14331305)
So a Qualcomm refuses to sign such a contract. What are going to do, use Mediatek for your flagship?

On the Porters five forces scheme of things, the SoC vendors have much better bargaing power than device makers.

Re:Treble: A modular base for Android by pjmlp on Saturday May 13, 2017 @12:52PM (#14331823)
There is a free market out there.

Long time ago, people also though ARM was going to close doors.

If Qualcomm refuses, other would gladly do and eventually become good enough for Qualcomm to either change their mind or become irrelevant.

Re:Treble: A modular base for Android by mavendependency on Saturday May 13, 2017 @10:21PM (#14333928)
Talent and IP are in extremely limited supply. Your alternatives are mediatek and spreadtrum.
Re:Treble: A modular base for Android by pjmlp on Sunday May 14, 2017 @01:48AM (#14334429)
So be it.

The majority of my devices don't have Qualcomm.

Re:Treble: A modular base for Android by digi_owl on Saturday May 13, 2017 @10:42AM (#14331211)
Towards the end of the featurephone era it became more common.

And i think Nokia got into it because they had a very popular model that was found to have a nasty flaw. I still recall news reports about people queuing to get theirs flashed (this was back when GSM was the hot new system, and carriers were giving away phones if you signed up with them).

Re:Treble: A modular base for Android by incompatible on Friday May 12, 2017 @10:04PM (#14329235)
A stable binary device-driver API has always been resisted in Linux. I suppose that's what Treble is?
Re:Treble: A modular base for Android by kuschku on Saturday May 13, 2017 @03:22AM (#14329901)
Not exactly. Treble is a stable API between userland and kernel. Userland can be quickly updated even if the drivers are not, and if the drivers are updated, userland can stay the same.

The long term plan smells of Magenta.

Sadly, we have nothing like this, or a stable driver API on desktop linux at the moment, which is <insert expletives here>.

Re:Treble: A modular base for Android by cyphar on Saturday May 13, 2017 @04:40AM (#14330036)
> Treble is a stable API between userland and kernel.

Stock Linux definitely has a stable userland API, though I imagine that third party driver vendors don't know how to do stable userland APIs.

> Sadly, we have nothing like this, or a stable driver API on desktop linux at the moment, which is <insert expletives here>.

As for driver ABI compatibility, I know that almost all enterprise distributions maintain kABI compatibility for a particular release of their distribution (this is one of the selling points of such distributions). I believe there are also some community distributions with similar stability guarantees (for instance openSUSE Leap uses the same kernel as SUSE Linux Enterprise, so I would assume the same guarantee is provided).

Re:Treble: A modular base for Android by barrkel on Saturday May 13, 2017 @05:04AM (#14330082)
"stable userland API"

Try copying some Linux binaries between a few distros, a few release years apart and tell me again about stability. Try the same with some Windows apps and compare and contrast.

API == ABI for stability purposes, and the kernel isn't the problem, otherwise things like docker wouldn't meaningfully work at all. It's all the auxiliary libraries, much larger surface area.

Re:Treble: A modular base for Android by cyphar on Saturday May 13, 2017 @06:42AM (#14330288)
> Try copying some Linux binaries between a few distros, a few release years apart and tell me again about stability.

The issue is the dynamic libraries (which are handled by distributions in different ways). Try statically compiling a binary like that and you'll find that it will work between distributions and kernel versions.

> Try the same with some Windows apps and compare and contrast.

Because they include their dynamic libraries with their programs, which has its own tradeoffs (updating security issues in shared libraries is much harder, even if you had a package manager on windows -- which you don't).

> It's all the auxiliary libraries, much larger surface area.

Right, but GP's point was that Linux doesn't have userland-to-kernel stability and I was saying that's simply not true. It's true that there is no stable upstream driver API but there are also solutions to that problem as well.

Re:Treble: A modular base for Android by IshKebab on Saturday May 13, 2017 @07:07PM (#14333441)
Have you ever tried to statically link a program on Linux? I'm guessing not. Until recently it was more or less impossible because glibc cannot be statically linked. Nowadays you can do it with musl but it still takes significant extra effort.

It's not as simple as "windows programs include their dependencies". Windows has far better forward and backward compatibility than Linux (by which I mean Linux plus the required userland stuff - libc, ld, etc.)

That's kind of to be expected. Comparability is tons of extra effort that open source can't really prioritise, but don't just pretend that it is as good as Windows.

Re:Treble: A modular base for Android by cyphar on Monday May 15, 2017 @12:36AM (#14339186)
> Have you ever tried to statically link a program on Linux? I'm guessing not.

This is where autotools helps: ./configure --static. There are also equivalents for CMake.

Aside from that I also statically compile Golang programs all the time (specifically runc which is a container runtime that uses cgo and a bunch of other magic). If static compilation didn't work, neither would our releases.

Just because Rust only lets you statically link binaries if you use musl doesn't mean that nobody else knows how to link things statically.

> because glibc cannot be statically linked

This is patently false. It is true that glibc will make static linking _hard_ but it's definitely not impossible. You need to set some magic settings (that autotools does for you) which disables all of the dynamic loading stuff glibc does.

> It's not as simple as "windows programs include their dependencies".

But it is. If you ignore the core system libraries, and included all of the other library dependencies with programs, most of these problems would be fixed.

> Windows has far better forward and backward compatibility than Linux

glibc has symbol versioning so in principle (I have had to use this once or twice) you can use an older program (linked against an old glibc) on a newer glibc.

Re:Treble: A modular base for Android by majewsky on Sunday May 14, 2017 @04:58PM (#14337538)
glibc-static works fine for my Golang programs that are being compiled on RHEL hosts in the CI and then shipped as Alpine-derived containers (which is why I need to link libc statically; ain't no glibc on Alpine).
Re:Treble: A modular base for Android by ethelward on Saturday May 13, 2017 @05:32AM (#14330131)
The problem you'll have will be with the dynamic libraries, not the kernel. If you stay with statically linked binaries or you package your binary with its .so, everything should work fine.
Re:Treble: A modular base for Android by barrkel on Saturday May 13, 2017 @09:04AM (#14330738)
If you link everything statically, you must (a) have the right to do so, and (b) you now subsume responsibility for security patches for all your dependencies. These are two very big asks.
Re:Treble: A modular base for Android by digi_owl on Saturday May 13, 2017 @10:37AM (#14331191)
Watch container based "solutions" to both sprout like wildflower...
Re:Treble: A modular base for Android by kuschku on Saturday May 13, 2017 @06:25AM (#14330251)
Correct, the issue isn't in Linux itself.

It's in drivers, third party kernel modules, libraries, etc.

But that doesn't make it any easier.

On desktoo GNU/Linux or GNU/NT we don't have easy stable environments, and the fight between dynamic and static linking is always won by static linking. In the GNU world, that ended with snap/flatpack/docker/rkt/containerd

Re:Treble: A modular base for Android by digi_owl on Saturday May 13, 2017 @09:48AM (#14330950)
Only for those to introduce their own problems, like having some insecure lib sitting in a container somewhere...

I really wish userland devs would spend more time actually maintaining API/ABI stability, and less time reinventing wheels because they are not "perfect" (after whatever arbitrary marker for perfection they work with).

Re:Treble: A modular base for Android by kuschku on Saturday May 13, 2017 @10:10AM (#14331052)
To be honest, Alpine Linux based containers on Kubernetes are so amazingly stable, and "just works", it’s amazing.

But yes. One issue anywhere, and I can upgrade everything again.

Re:Treble: A modular base for Android by 0xFFC on Friday May 12, 2017 @07:58PM (#14328856)
I just switched to iphone se 4 months ago, and I couldn't be any happier.

Tbh i did like android, but the only problem for me was 2 year only update. That is not enough. Not even close when similar products from apple get 5 year suppurt. Specially now, after passing a threshold, our phones SoC are capable of handling ordinarily jobs (like if you are not into playing AAA games) for more than 4 years, performance wise.

P.s. After using iphone for 4,5 months i have to say , their i products are awesome. Far superior than android in term of consistent performance and fps.