
Treble: A modular base for Android - chickenbane
https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html
======
sorenjan
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](https://support.google.com/pixelphone/answer/4457705?hl=en)

~~~
pjmlp
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.

~~~
sorenjan
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.

~~~
izacus
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.

~~~
dragonwriter
> 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.

------
demarq
"device makers can choose to deliver a new Android Update" ... "can choose".

Preferably they shouldn't be able to choose. Google should be in charge of
updates and manufacturers should have to make a special effort to prevent an
update. i.e if they are certain that an update will brick their device they
would then make a formal request to google not to send the update to their
devices.

~~~
sigmar
Agreed. Updating the phone being easier won't solve the problem. The problem
is a mismatch in incentives.

Manufacturers don't have an incentive to update older devices because (1) they
don't want to put any resources into last year's phone and (2) they want their
customers to upgrade to their newly released phone.

~~~
usrusr
Still waiting for a phone brand to bite the bullet and offer _paid_ updates.
Because it's either that or no updates. I know what I would prefer.

~~~
voltagex_
It still won't solve the "Qualcomm won't update the BSP" issue, though.

~~~
swiley
This right here!

Closed SOC BSPs that are tied to android are the real problem! If google had
stuck with the standard Linux APIs or added appropriate new one when they
needed them and where more strict about open software we wouldn't be in this
mess.

~~~
vetinari
Not true. Witness the routers or another embedded devices, that are using
standard Linux and yet are never updated.

Or worse, coming with obsolete kernel right at the release day.

------
slackstation
This should usher in a new era of cheap phones that upgrade immediately to the
newest version of the Android OS.

It lowers the price floor for a shiny new phone. All of these additional
features are expensive to create but, they are differentiators. With this,
Google has the ability to push more new features on the base OS. By conforming
to this standard, Google make it easier for them to compete with all of these
manufacturers' features.

Now it's up to them to make compelling reasons to upgrade their phones beyond
apps. I see things like Google Assistant, Mapping, etc. being more integrated
into the OS so that you are always in the Google system no matter what app you
are currently in.

This is a big and brilliant win if they can first pull it off technically and
then pull it off with compelling services. They certainly look like they are
investing heavily in both.

I look forward to a $99 or $199 (or $49 if you can stomach sketchy Chinese
phones) phone that just keeps getting better and better and better for free as
long as the phone works. This also makes a very compelling thing to make the
phone into a computer once the battery can't hold a charge, etc. Take the guts
or use some kind of USB->HDMI out and make it into a TV app or a digital
mirror or another internet station somewhere.

Brilliant move Google.

~~~
smichel17
> I see things like Google Assistant, Mapping, etc. being more integrated into
> the OS so that you are always in the Google system no matter what app you
> are currently in.

No thank you. I use Android because it's a free and open system.

~~~
pjmlp
Given the lack of updates and the missing parts on AOSP source tree, that is a
fallacy.

------
cwyers
I am amused that their graphical representation of the Android version
customized for a particular model of phone is "Android mascot dressed up in a
really cool spacesuit looking thing" and not "Android mascot with bags of
trash stapled haphazardly to him," which would probably be more accurate.

~~~
duncanawoods
> really cool spacesuit looking thing

Look closer - its a fetching combo of fanny pack, boxer shorts, ice skates,
ski goggles etc. pretty much the crap you wanted.

~~~
kbutler
That's really awesome - thanks for making me go back and actually look at it.

Upvoted the grandparent, just to keep it high in the list so that your comment
would stay near the top of the page...

------
GordonS
Do vendors actually _want_ to let users update the software on their devices
though?

I would have thought new shiny software was a nice incentive to get customers
to upgrade to a new phone?

~~~
jm_l
Companies are incentivized in the long term to make good products. This
incentive usually eclipses incentives that our (often justified) anti-
corporate suspicions invent.

~~~
GordonS
I'd like to believe that. But profits rule.

Smartphone usage must be pretty close to saturation point, in the developed
world at least. Samsung, Apple etc release a new, _expensive_ device every
year, and it's natural that they are going to want existing customers to
upgrade.

I think the only way Android users (of non-Google devices, that is) are going
to get software upgrades is if Google somehow forces vendors to do it.

~~~
petra
It might be enough for a single vendor to "break ranks" and go with treble to
have a decent effect. Xiaomi did so with their large batteries, for example.

~~~
GordonS
I'm more an Android guy, so I don't have an iPhone (except for testing on
mobile apps I'm working on), and so I don't know what the update situation is
like. But my (limited!) understanding is that when they release new iOS
versions they are available at least a couple of generations back - is that
correct? Or if you buy a network locked phone is it up to the network?

~~~
halostatue
Depending on the nature of the update, iPhone updates are generally 3–5
generations back. Just on the iPhone side, iOS 10 has some level of support on
the iPhone 7 (current generation); iPhone 6s (-1 year); iPhone 6 (-2 years);
iPhone SE (slightly updated iPhone 5s); iPhone 5s and iPhone 5c (-3 years);
and iPhone 5 (-4 years). That’s five generations of support for iPhone.

They are a little more aggressive with iPad and iPod touch deprecation, but I
think that’s because some of those devices were built underpowered anyway.

------
therealmarv
Maybe we can benefit from this in 2 or 3 years? I'm very pessimistic... it
takes LOOOOOOONG before vendors will look into Android O and the interfaces
and the first generation benefiting from this will be earliest Android P
updates. And do not forget: This whole process does not reduce testing time
and the carriers might also look for long testing on updates ;)

~~~
Jabbles
It sounds like the vendor abstraction layer will make things a lot simpler for
manufacturers and vendors, so the cost savings alone should tempt them.

I'm not sure, but couldn't this benefit vendors/manufacturers/users upgrading
to O?

Also, remember that manufacturers have probably known about this for a while.

~~~
cpeterso
An improved vendor abstraction layer might make porting easier but it still
doesn't provide any incentive for vendors to actually update old devices. :(

------
julioneander
If Google actually implements a way of pushing those underlying Android
updates directly to the phones then I think they might actually be successful.
If Google end up still relying on the manufactures and carriers to push those
updates out, then what incentive will they have to keep the phones updated?

~~~
dmitrygr
If we're lucky - consumer pressure.

~~~
ocdtrekkie
An almost nonexistent percentage of users know what version of Android they
have or if it's the latest, in the grand scheme of things. In the tech bubble,
it's hard to imagine, but I'd go so far as to suggest most Android users don't
know they run Android.

If people realized how many security risks they open themselves up to by
running old Android versions and that the "your phone is up to date" line in
their Settings app is basically a lie, Android would not be the dominant
platform on earth.

~~~
UnoriginalGuy
By contrast many iOS users do know which version and the media reports on
releases.

One could argue that this is the power of releasing to millions of devices
concurrently, as opposed to spread out over sometimes years like Android.

Windows Phone had issues but updates was not one of them and you knew which
release you were on them too.

~~~
bitmapbrother
Of course Windows Phone had update problems. Carriers would hold back or not
even release updates. And then there was Microsoft who was osborning their
OS's and phones.

~~~
ocdtrekkie
The point here is that Windows Mobile has already solved this problem: All
Windows 10 devices receive OS updates directly from Microsoft servers, as a
requirement of using the platform. (Even in 8.1, if you were on Developer
Preview, you got updates straight from Microsoft, apart from carrier/OEM
channels.) Drivers/firmware are pushed separately.

This appears to be where Google is perhaps finally heading. Once Treble is out
there, Google will change their contract terms to mandate control over OS
updates for all devices which license the Play Store.

~~~
bitmapbrother
No Windows mobile has not solved that problem. Any updates involving firmware
are still controlled by the carriers. It's a rather moot point as windows
phone is dead anyway.

>The new process still does not provide firmware updates, as far as we know,
so carriers and their bottlenecks will still be involved in upgrading phones.

------
dmitrygr
This removes one of the main excuses various vendors use for not providing
Android updates. I truly hope this works in helping users always be up to
date.

------
cjhanks
It is my opinion that Google does not view Android as simply "an operating
system for phones". Android has tremendous application in IoT devices and
appliances. The lifecycle of many applications is quite a bit longer than the
cell phone.

As we see an increase in the diversity of applications using Android, this
upgrade path will be very important. Just wait until you see your first ATM or
POS system "Powered By Android ©".

~~~
swiley
The only two reasons people put up with android on phones are

1) it's the only choice if you want something small with a cell modem

2) it's the only choice if you want to run Snapchat

Android is incredibly aweful. It's actually impossible to write apps for it
that won't crash. If you're writing firmware it's even worse! Have you ever
tried to build it? It's a nightmare! The source for a basic system is over
60GB and has a crazy number of dependencies.

For embedded systems/IOT you're thousands of times better off just using
buildroot or an RTOS.

~~~
cjhanks
Well, is it really much worse than Windows CE?

~~~
swiley
That's like comparing shooting yourself in the foot to shooting yourself in
the head. There's no reason for either!

------
sandGorgon
is this a hypervisor ? I'm kinding of wondering about the abstractions here...
is this replacing the bootloader with a kind of bootloader+hypervisor and the
actual OS loads on top of the hypervisor ?

Their abstraction with the camera2 and hal3 was a small step in this
direction. any camera with these abstractions would be able to use RAW
imaging.

~~~
EddieRingle
Nope, they've introduced a HIDL for defining hardware interfaces. See
[https://news.ycombinator.com/item?id=13928385](https://news.ycombinator.com/item?id=13928385)
which I posted back in March.

------
blinkingled
So this will get users on to the next Android Framework version but if there
are security bugs in vendor implementation or underlying firmware it'll still
continue to be problematic for users. But it will solve the PR problem for
Google if OEMs and Carriers update the framework version quick enough - the
question raised mostly by tech pundits - when am I going to get the next
update to Android - will have a satisfactory answer.

Not to say this isn't a huge step forward from status quo - if vendors
contribute features and fixes to MediaServer and everybody uses the same
implementation it will be much easier to update it for all vendors.

What still sucks is this is not going to be Google that will update the
Android framework - it's still OEMs and the carriers.

------
neuromancer2701
This would seem to allow security updates at a faster rate, but the linux
kernel will forever be abandoned to hardware vendor whims aka still on 3.10.X

~~~
pritambaral
It seems they're making the vendors push their kernel patches into AOSP.

From TFA:

" In addition to the architectural changes, we're working with our silicon and
device partners to take their code changes, such as features for a carrier
network in a specific country, and move them into the common Android Open
Source Project (AOSP) codebase. For example, Sony and Qualcomm contributed
dozens of features and hundreds of bugfixes to Android O so they no longer
need to rework these patches with each new release of Android. "

~~~
neuromancer2701
So is this a way around mainlining all of the silicon vendor's various
kernels? I have heard that each vendor just hacks their hardware into the
3.10.X and then just keeps a repo of it to meet open source requirements.
Because they are unable to make the quality requirements to get their code
upstream.

~~~
makomk
By the time anyone can get all the code required to support a modern SoC
upstream in Linux, it's already obsolete.

------
afeezaziz
For someone that is considering Android, coming from iOS, this is a brilliant
idea that should have been implemented long ago.

For example, a lot of Android phones are running 4.4 and 5.0 in this part of
the world. Those versions are pretty bad and the people that bought Android
4.4 and 5.0 actually do not know what they are missing and how to actually
update their OS since there is no way for them to do that for now.

I hope that with this Treble, there will be a lot more Android phones(from
Chinese makers) that can update base Android OS to the latest one much more
frequently.

------
pasbesoin
"...they'll be no [Treble] at all!"

\-- Scotty, in _The Trouble With Tribbles_

What was the previous "vendor integration" initiative? How long did it last?
Two years? Or was it one.

Lack of vendor buy-in. Combined with Google's ADHD project support.

Nice idea, but color me skeptical.

I don't see anything that hints at a change in the fundamental cost/benefit
that's driving the current mess.

Maybe I'm just projecting cynicism, because I'd actually like to be proven
wrong. And bad press seems to be the only external influence on Google, that
actually gets through.

------
chrisballinger
Would this help projects like LineageOS (formerly Cyanogenmod) maintain
ongoing support for older devices?

~~~
ethbro
If all the vendor crap and secret drivers are abstracted out sufficiently,
yes.

~~~
petecox
The bottom diagram suggests that the 'Android OS framework' could be made
device independent, with Lineage OS only responsible for maintaining the
'Original vendor implementation'.

A 'ROM' could then be split into 2 - the core system and the userspace running
on top, with potentially the latter maintained by Google's AOSP across all
devices.

------
EddieRingle
I discovered this back in March. This is pretty exciting!

Now all we need is to have Google distribute the framework over the Play Store
instead of relying on OTAs, and all will be right with the world.

[https://news.ycombinator.com/item?id=13928385](https://news.ycombinator.com/item?id=13928385)

------
exabrial
speaking of Android: How about switching to the JVM/OpenJDK to keep pace with
modern Java? Maybe deliver CDI as a standard feature?

Also, how about using cgroups instead of the custom security model? Maybe we
could get reuse out of Google's security patches for Linux, and they could
benefit more from the community.

~~~
kllrnohj
> speaking of Android: How about switching to the JVM/OpenJDK to keep pace
> with modern Java?

They did that already. [https://arstechnica.com/tech-policy/2016/01/android-n-
switch...](https://arstechnica.com/tech-policy/2016/01/android-n-switches-to-
openjdk-google-tells-oracle-it-is-protected-by-the-gpl/)

Well, they switched the library to OpenJDK. The runtime is still ART, but
that's probably for the best as the runtime balance decisions made by hotspot
are definitely not suitable for phones, and ART is pretty good these days
anyway.

And you can use Java 8 stuff:
[https://developer.android.com/studio/preview/features/java8-...](https://developer.android.com/studio/preview/features/java8-support.html)
some of which is even fully backwards compatible (like lambdas)

> Also, how about using cgroups instead of the custom security model? Maybe we
> could get reuse out of Google's security patches for Linux, and they could
> benefit more from the community.

Android has always used cgroups. cgroups are not a security mechanism, though,
it's for resource allocation.

Regardless Android makes use of cgroups, cpusets, selinux, etc... That's all
unrelated to the permission model, though, which more or less doesn't exist on
desktop platforms.

~~~
pjmlp
Actually the reality is a bit different than those marketing articles.

They started to cherry pick library implementations from OpenJDK, but
achieving feature parity is certainly not something they care about.

Anyone can easily check the AOSP commits to see exactly that.

[https://android.googlesource.com/platform/libcore/](https://android.googlesource.com/platform/libcore/)

[https://android-
review.googlesource.com/#/q/status:open+open...](https://android-
review.googlesource.com/#/q/status:open+openjdk)

~~~
kllrnohj
> but achieving feature parity is certainly not something they care about.

[citation needed]

what is missing?

~~~
pjmlp
So many things.

\- Swing

\- JavaFX

\- NIO and NIO2

\- invoke dynamic

\- method handles

Are a few that come to my mind, but basically besides from what was left out
of Java 6 libraries, almost everything that was introduced in Java 7 and 8.

~~~
kllrnohj
Swing & JavaFX are not part of the JCL. Those are addon libraries.

NIO: [https://developer.android.com/reference/java/nio/package-
sum...](https://developer.android.com/reference/java/nio/package-summary.html)
"added in API 1"

As in, it's been there since forever. What are you referring to specifically?

NIO2:
[https://developer.android.com/reference/java/nio/file/packag...](https://developer.android.com/reference/java/nio/file/package-
summary.html)

Invoke dynamic: is a runtime/bytecode thing, not part of the library. The
actual feature, lambdas, works just fine on Andorid

Method handles:
[https://developer.android.com/reference/java/lang/invoke/Met...](https://developer.android.com/reference/java/lang/invoke/MethodHandle.html)

------
joshmarinacci
I think this will be pretty successful. Ultimately the manufacturers want to
do as little software work as possible. If Project Treble gives them
easier/less work to do, then they will adopt it quickly.

------
amluto
One potential side benefit of this type of work: vendor kernel drivers tend to
be insecure buggy pieces of crap. Vendor Treble drivers will surely still be
insecure buggy pieces of crap, but they might be sandboxable. If Google really
has its eyes on the Magenta kernel, I imagine that Treble will be runnable in
user mode, so I bet it really will be sandboxed. This would be a huge win.

------
ibic
Android finally adapted the approach of Windows on PC - OS maker dictates the
software pieces on all devices, the device makers only create the hardware and
write drivers (optionally, some bloatware). I believe this is the right/better
approach, and it solves no only the Android update hassle, but more
importantly the fragmentation issue.

------
bsharitt
Neat, Google has release this years fix for Android updates. I can't wait to
see what next years fix looks like.

------
asciimo
I wonder if this will make it easier to circumvent the vendor layer entirely--
jailbreak without replacing the OS?

------
drewg123
How much of the update problem is due to vendor customized UIs and apps, and
how much is due to not upstreaming driver support for their hardware?

Which of these problems will Project Treble solve? Eg, have they actually
added a stable driver KBI? Or pushed drivers to userspace? Or is this just
about GUIs?

------
ReverseCold
Took them long enough.

------
TwoNineA
You can't fix a business/greed problem with technology.

~~~
wmf
This is true, but Google may have more leverage than they think. If the phone
vendors don't like the direction of Android what are they going to do, switch
to Windows/Tizen/webOS/FirefoxOS?

------
scotu
that's cute. It's like Google doesn't get that hardware manufacturers need to
sell you hardware... Am I missing something?

~~~
dukoid
I assume you are implying that if the software can be updated, there would be
no need for new hardware. Yet, for Apple, the opposite seems to be true :)

~~~
laumars
Apple is an edge case in so many ways that Android OEMs differ:

* Apple has a greater following of "must have the latest" consumers than most Android OEMs put together

* Apple makes money from the app store. Both selling apps and developers submitting apps that expose cool new features in iOS.

* Apple can release iOS updates that coincide with newer handsets but with software features only exposed in the newer hardware. Which also helps with the adoption of newer hardware.

------
ocdtrekkie
It's incredible to me how long it took Google to realize this was their fault.
A lot of people here have bought the "blame the OEM" nonsense for a really
long time, and you can see the comments here reflect that.

But in reality, there's a huge expense to all the work of updating devices to
support Google's rapid change cycle for dozens or hundreds of different
models, and the problem stems first and foremost from that lack of abstraction
layer.

This is likely a first step to finally catching up to Windows Mobile: Making
the core OS upgrade come straight from the actual OS developer, so that the
company that writes the code is actually the one that updates the code.

~~~
therealmarv
Well I can blame OEM because I never asked for special features and skins on
top of Android. I want stock Android and stock should be easier to update.
Speaking about testing of updates: I'm sure this abstraction layer will not
reduce the testing time and it will only slightly reduce the release time of
new version.

~~~
ocdtrekkie
There's no such thing as "stock Android" from an update distribution view.
Each Android release, currently, has to be custom-fitted to each given
hardware model. That is the problem being solved here, and it's not the OEM's
fault, it's the architectural design of Android itself, which is changing.

~~~
nileshtrivedi
It's not just Android design's fault though. ARM does not have the equivalent
of Bios for hardware discovery and initialization. So you can't have a generic
OS image to be installed on any device.

------
tarikozket
Seems like Google is trying not to lose Samsung:
[https://9to5google.com/2016/06/13/report-claims-that-
samsung...](https://9to5google.com/2016/06/13/report-claims-that-samsung-is-
considering-moving-all-of-its-devices-to-tizen/)

~~~
Jabbles
Maybe, but [https://arstechnica.com/gadgets/2017/04/samsungs-tizen-is-
ri...](https://arstechnica.com/gadgets/2017/04/samsungs-tizen-is-riddled-with-
security-flaws-amateurishly-written/)

