We have moved to a new Sailfish OS Forum. Please start new discussions there.
13

XperiaX + AOSP

asked 2019-04-09 11:38:57 +0200

u-dash gravatar image

Hi there,

I'm using a Jolla 1 device for almost 4 years now, and I'm mostly satisfied with it. However, the device is getting older and older, and my display and battery ( it is already the second battery, it is 3rd party ) has some issues. Since I see the progress with the SailfishX, I've started to think, if I should buy an Xperia XA2, and buy a Sailfish X license for it, but I'm a bit confused. 1. What is AOSP? It is some kind of Android stuff, which Sailfish X built on? A framework? What else? 2. Do I need a google account, to set the device ready for the OS change?

I've tried to check the forum, saw different things, but still not 100% clear, how the whole thing works. If anyone of you can describe, it would be great.

regards

Laszlo

edit retag flag offensive close delete

Comments

1

AOSP = Android Open Source Project

Spam Hunter ( 2019-04-09 11:52:11 +0200 )edit

Ok, I knew this, but in a deeper aspect? Let me try to describe, what is my confusion. I'm using a Jolla 1 device, which has Sailfish OS by default, without any magic. It has never had any contact with Google. Since I don't want this in the future as well, I would like to know, what this AOSP stands for. Is Sailfish X completly different from the Sailfish I'm using with Jolla 1? It is some kind of "Android fork"? Has it any connection with Google?

u-dash ( 2019-04-09 11:59:45 +0200 )edit

@u-dash To your questions in the last comment: From the user perspective: no, no, and no. And you don't need a google account. And this might help.

Spark ( 2019-04-09 12:03:11 +0200 )edit

@Spark Thanks, I know the site, I've already read it, but the 5. section is not clear to me. However, thanks for the no, no, no ;)

u-dash ( 2019-04-09 12:07:58 +0200 )edit

Android 10 is now official as Google’s 10th version of Android OS with plenty of new features and system UI changes. The Android 10 (aka Android Q) started rolling out Google Pixel devices, Essential PH, Redmi K20 Pro, OnePlus 7 Pro devices My Prepaid Center

Kaitlyn ( 2020-04-06 13:10:03 +0200 )edit

1 Answer

Sort by » oldest newest most voted
66

answered 2019-04-09 15:18:54 +0200

DrYak gravatar image

updated 2019-07-23 03:24:59 +0200

To give more details of how Sailfish works and relates to Android :

  • Sailfish is a full blown GNU/Linux distribution and looks much more closely under the hood to what you'll find in your Ubuntu/openSUSE/whatever... running on your laptop than to other smartphones (though, only for the "under the hood" part. As you've seen with your Jolla1, on the outside it looks pretty sleek and is very well geared toward use on small touch devices like smartphones and phablets, unlike say your garden variety of Fedora Linux).

  • Android is a slightly different operating system. It also uses the Linux kernel (though even there are extra mods), but everything running above is more or less different. A few bits are a similar (you've also got a shell. But an entirely different C-library called Bionic). Some are completely different: A lot of these are frameworks written in Java (because J2ME used to be a big thing on feature phones when the smartphones started to emerge).

  • AOSP is the "Core" Android system and is the opensource part. You could get it and recompile it yourself (LineageOS is a popular example of such opensource after-market AOSP distribution). This is to make distinction with the "Google Play Service", which is a large proprietary blob that comes pre-installed on officially licensed Google Android phones (most of the phone sold in the west, and some of the Chinese exported) and is the controversial part of Android that usually makes the news (about Google collecting too much private information, about Google having a quasi-monopoly and abusing it, etc.) and upon which LOTS of application relies

And now the interplay above those:

  • It's the hardware.
  • on a desktop workstation/laptop, it's pretty easy to install some GNU/Linux distribution, because most of the thing are designed to work together. PCs are standard. Linux is targeting these standards. And nowadays some manufacturers are even targeting Linux (e.g.: Nvidia releasing Linux blobs) or even having opensource Linux developers on their team (AMD is contributing devs to the official opensource driver in the kernel).
  • On smartphone, it's not much the case. It's not very standard. And because Android is the most popular OS on smartphone, most hardware manufacturer who make chipsets and ready-to-integrate boards are targeting Android. (Which again, despite running on a Linux kernel, everything which runs above is slightly different).
  • That's why the people at Jolla decided to develop libhybris (which is nowadays also used by other GNU/Linux distributions such as Ubuntu Touch), a hardware adaptation layer ("Baseport" in their parlance according to their blog) which helps to adapt a full GNU/Linux distribution running atop of a set of drivers/libraries/blob which were designed for Android by the hardware maker.

Then completely separate of that you have the apps:

  • Again, Android isn't like a normal GNU/Linux environment. You can't run android apps on a normal desktop.
  • So for non-native apps Sailfish uses an application compatibility layer
  • On older smartphones, like your Jolla 1, that used to be an alternate JIT by Myriad + adaptations to convert the Android API that application needs to API that are available on a full GNU/Linux (it's a type of VM (Virtual Machine) because Java-like environment are designed to work in a VM)
  • On a modern smartphone like the XA2, because android doesn't use a JIT anymore, it's a local installation of AOSP running in a container acting as an environment for the android apps + adaptations to convert APIs.

    The same approach is used by most others compatibility layers for running Android APKs on GNU/Linux (Collabora's SPURV, Anbox, etc.) - though those aren't currently deployed in production and Collabora is the only other company beside Jolla giving some corporate backing to these efforts.

So in short :

  • Sailfish is an Android sandwich with a penguin in the middle :
  • (bread) At the bottom you have the manufacturer's custom Android kernel with driver and library blobs made normally for Android
  • (letuce) You have libhybris make an adaptation in between.
  • (meat) in the middle you have a full blown GNU/Linux system just like on your laptop that relies on modern technologies (Wayland, Systemd, sometimes BTRFS, etc.)
  • (bread) at the top for non-native apps you also have bits of Android inside a cage (the run-time environment. Used to be a "not-quite-Java"-like JIT for Android 2.x up to 4.4 kitkat. And nowadays is the ART you find since Android 5.0 Lollipop, including the 8.1 Oreo currently offered on XA2)

So relating to the question :

  • During flashing process, you need to download bits of AOSP, not because Sailfish is built upon AOSP (it's not. It's a full GNU/Linux system), but because you need the drivers there in, because manufacturer such as Sony (motherboard) and Qualcom (chipset) makes their drivers for Android / AOSP. libhybris takes care of making those drivers runnable.
  • (On the Jolla 1, Jolla was responsible for the boards, and actually did license android blobs from Qualcom. bits of AOSP are still used but Jolla are licensed to deliver it themselves as port of the Sailfish OS update process. You don't need to download them from somewhere else as a separate step)
  • The system, you'll install from the flash file you got from Jolla
  • On top of that, if you opted for the paying version, Jolla let you install from their Store a "system.img" file that contain a runtime environment from AOSP. So you can install and run Android APK next to the native QML application you'd be getting from Jolla store or openrepos.

And now for the Google Service part :

  • Some apps like WhatsApp are happy to run on bare naked AOSP and will run with Jolla's application compatibility layer (if you paid for that).
  • Most of the app are addict... sorry! dependent on the proprietary Google Play Services. And will complain upon attempting to install.
  • You have two paths.

    • You can install the official GApps using tool like opengapps. Even if Jolla isn't officially licensing the service from Google (there's no way they could comply with Google's requirement as Sailfish isn't even Android), Google will happily authorise you, the end-user to acquire and installed them (hey, they really want all that juicy privacy tracking stuff).

      There should be some tutorial floating around how to accomplish this on your XA2. That's also what I used to do on my Jolla 1 and my Xperia X.

    • You can install an opensoruce alternative such as MicroG - an opensource re-implementation of the same API that apps depend upon. It gives you much better control on what data gets transmitted. Your privacy will appreciate (your phone's battery too). For some apps (most of the android apps that my bank insist on using), it works nicely. For other things it work less well (their Google Maps APIs aren't as mature, but current Mapbox-based itterrations have vastly improved compatibility. A few vehicle-sharing still have troubles starting, though. (apparently, microG got some funding improvement could come in the future)

      Since Sailfish OS 3.1.0 Seitseminen Jolla has put efforts to make the experience simpler . (For older versions, there are explanations about this on the forum.) That's what I did on my XA2

edit flag offensive delete publish link more

Comments

1

I think it was a very useful help for me. Many thanks, now I think I'm understand. So, if my Jolla 1 going to die, it is no question to me, to buy an Xperia XA ( or any SailfishX ready phone in that time ) and a SailfishX license.

Thanks again!

u-dash ( 2019-04-09 15:31:24 +0200 )edit
8

Many thumbs up for this detailed explanation :)

cquence ( 2019-04-09 15:44:53 +0200 )edit

Thank you for these detailed explanations. I'm looking for an explanation why porting Android support a la XA2 is costly on Xperia X. Xperia X supports the latest Android kernel but Jolla don't want to make this effort and don't give the means to the community to make it. I still don't understand why.

ron282 ( 2019-04-14 10:21:07 +0200 )edit

@ron282 The explanation is here.

Giacomo Di Giacomo ( 2019-04-16 13:56:36 +0200 )edit
9

Currently Sailfish X on Xperia X is using a libhybris abstraction layer that is written against the kernel and blobs that Sony provides for AOSP 6.0.1 Marshmallow. That's a "Baseport 6" according to their official blog.

That gives two main obstacles :

  • it's a very old kernel (3.10.85 or something along these lines). A modern up-do-date LXC platform requires features that were provided in more recent kernels - e.g.: from my experience the username namespace isn't available yet (somewhere along the 4.x series - you can probably find the nitty gritty details somewhere on lwn.net - other Sailfish community members have mentioned that 4.4 kernel provide all that's needed).
  • the versions targetted by the blobs ("API Level" in Google's terminology) is quite old. You can't run Android 8.1 Oreo on such old stuff (8.1 requires kernel 3.18 strict minimum under some circumstances, and kernel 4.4 is very strongly recommended, almost required)

This means that Jolla has to rewrite a brand new abstraction layer from scratch (a "Baseport 8", according to their blog).

At this point they have basically two choices:

  • write a brand new "Baseport 8" for Xperia X
  • write a "Baseport 8" for a modern ANdroid 8 device, like Xperia XA2
  • they don't have the current ressource to manage to tackle both the above at the same time, see official blog posts from Jolla.

Whatever they chose people are going to complain:

  • if they write a "Baseport 8" for Xperia X, you'll get people complaining that Jolla is losing time writing code for an obsolete device that isn't selling anymore, and that they would like to be able to buy an actual device that is still currently on the market onto which to flash Sailfish, to begin with.
  • if they write a "Baseport 8" for Xpera XA2, what we see now, is people complaining that X is being "abandoned" just because there's no upgrade of the Android layer there.
DrYak ( 2019-04-16 15:18:42 +0200 )edit
Login/Signup to Answer

Question tools

Follow
20 followers

Stats

Asked: 2019-04-09 11:38:57 +0200

Seen: 2,459 times

Last updated: Jul 23 '19