this post was submitted on 21 Aug 2023
108 points (92.9% liked)

No Stupid Questions

35696 readers
1334 users here now

No such thing. Ask away!

!nostupidquestions is a community dedicated to being helpful and answering each others' questions on various topics.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must be legitimate questions. All post titles must include a question.

All posts must be legitimate questions, and all post titles must include a question. Questions that are joke or trolling questions, memes, song lyrics as title, etc. are not allowed here. See Rule 6 for all exceptions.



Rule 2- Your question subject cannot be illegal or NSFW material.

Your question subject cannot be illegal or NSFW material. You will be warned first, banned second.



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Questions which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding META posts and joke questions.

Provided it is about the community itself, you may post non-question posts using the [META] tag on your post title.

On fridays, you are allowed to post meme and troll questions, on the condition that it's in text format only, and conforms with our other rules. These posts MUST include the [NSQ Friday] tag in their title.

If you post a serious question on friday and are looking only for legitimate answers, then please include the [Serious] tag on your post. Irrelevant replies will then be removed by moderators.



Rule 7- You can't intentionally annoy, mock, or harass other members.

If you intentionally annoy, mock, harass, or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- Majority of bots aren't allowed to participate here.



Credits

Our breathtaking icon was bestowed upon us by @Cevilia!

The greatest banner of all time: by @TheOneWithTheHair!

founded 1 year ago
MODERATORS
 

As a point of comparison, Microsoft ships its OS across a variety of manufacturers and largely keeps it maintained across them (give or take some exceptions like enterprise environments & the like).

Even unlocked Android phones purchased independently of carriers have inconsistent lengths of support, so it doesn't seem to be entirely a result of carriers, so...What happened here?

you are viewing a single comment's thread
view the rest of the comments
[–] svellere@lemmy.world 56 points 1 year ago* (last edited 1 year ago) (3 children)

Every single answer here is wrong in some way, and I'm very surprised nobody has given the correct answer. And to correct you, OP, Android has never had consistent update support.

It's true that it stems fundamentally from the hardware drivers. But it's not necessarily a problem with Android itself.

First, Android utilizes the Linux kernel. Linux maintains all drivers within the kernel, and they mostly tell closed-source drivers to fuck off. That being said, you can still run closed source drivers on Linux, but it'll be up to the driver-maker to maintain compatibility between kernel versions, not the kernel maintainers. This is CRITICAL to know in order to answer the question correctly.

Hardware vendors like Qualcomm don't want to open-source their drivers, and thus don't want to upstream them to the Linux kernel. They also often only offer limited support unless you pay for it. For Qualcomm this has traditionally been 2 years. I think now it might be 3, but let's go with 2 for the sake of this discussion.

Thus, if I'm a phone-maker using Qualcomm chips, as are most phone-makers, then unless I pay Qualcomm extra money, they're only going to guarantee support for 2 years. After that, updating Android further (which usually requires updating the kernel, too) could break the hardware drivers and I'd have no way to fix it. Thus, I only offer my customers support for 2 years at maximum.

What has Google been doing to fix this?

Well, several things. First, Google has been asking all hardware-makers to pretty please upstream everything they can into the Linux kernel. This has had decent success, but not everyone will do this. Google has also been upstreaming as much of the Android kernel as possible into the Linux kernel to minimize differences, with the ideal being that the Linux kernel and Android kernel are exactly identical.

Additionally, Google has developed the Generic Kernel Image, or GKI, which presents a Kernel Module Interface, or KMI. This KMI is a stable interface through which hardware drivers communicate with the rest of the kernel. This is the solution to closed-source drivers. If your KMI doesn't change and a given hardware module was written against it, you can keep updating indefinitely even when the hardware module is out of support, until you need to change the KMI again, likely for new hardware features.

Google tried getting the KMI upstreamed into the Linux kernel, but the Linux maintainers seem fairly skeptical of it since it goes against their driver philosophy.

In any case, Linux has LTS releases that are supported for 6 years. They release a new LTS every year. Each year, Google selects the latest LTS and builds the latest Android version against that release. They can add to the KMI when this happens, but it is frozen for that kernel version from then on. From there, they keep building Android against that kernel version until it is no longer supported.

Let's take Linux 5.10 for example. There is android12-5.10. Linux 5.10 is supported for 6 years, so you will also see android13-5.10, android14-5.10, etc. Additionally, Linux 5.15 is an LTS release and was released the year after. So there will be an android13-5.15 that may support newer hardware features than android13-5.10, but they will otherwise both be Android 13. There will also be android14-5.15 and so on until the 5.15 kernel goes out of support.

I hope that example made sense! This means for a given device releasing with GKI support, it can get up to 6 years of Android updates without breaking hardware drivers. You won't get new hardware features introduced by newer kernels or KMI versions, but that doesn't matter on a phone that doesn't get new hardware anyway, so you're not really missing out on anything. This is how Google is making updates more consistent on Android.

EDIT: You might ask, how the heck do custom ROM developers do it, then? How can they pump out new Android versions 5, 6, even 7 or more years after the device is out of support? The answer is, it's complicated. The key here is the "shim", which is basically just them reverse-engineering the hardware drivers (called blobs) until the hardware works. They do it on hard mode, essentially. Much respect to the custom ROM devs.

[–] Mrduckrocks@lemmy.world 10 points 1 year ago (1 children)

Good explanation and lines in with why iPhone get years of support as they have full control of hardware and drivers.

[–] Very_Bad_Janet@kbin.social 2 points 1 year ago

Kind poster, I understood about 4% of what you wrote and absorbed 2% (entirely not your fault). Would you say that this explains why Google only supports their Chromebooks for 5 years?

[–] Atemu@lemmy.ml 1 points 1 year ago

This only concerns the kernel which is rather unimportant when it comes to Android updates. You can keep using an ancient kernel for an insanely long time but upgrade the Android userspace. The vast majority of LineageOS devices use the original kernel they released with (+bug fixes, usually).

Only when Android has a hard requirement on a new kernel feature do you need to actually upgrade it. This is usually end of the line for a device in custom ROMs because it is infeasible to do in most cases.

Take the Oneplus One (bacon) for example. It was released oven 9 years ago with kernel 3.4 and only lost LineageOS support with Android 12 because that requires eBPF for firewalling apps which is a relatively recent addition to the kernel.

The shims for the HAL you mentioned are in userspace. The original BLOBs they shim use the original OEM kernel interfaces in order to do their magic. It's just that Android might require newer/different interfaces from the HAL BLOBs; that's what the shims are for.