Welcome to ZenUnwired; a blog dedicated to tracking developments in technology and strategy, and to deciphering the impact of these developments on wired and wireless ISP's, device manufacturers, OS and application developers, and most importantly - you.

Wednesday, December 28, 2011

Ice Cream Sandwich - From Source Code to the OS on Your Phone [Two Perspectives]

Curious about how Ice Cream Sandwich goes from being source code released by Google to being the OS on your device, be it an upgrade or a fresh release? Here are two perspectives from the Product Management teams at Motorola and Sony Ericsson that I thought were especially insightful.

First, here's Motorola's perspective:

Motorola Update on Ice Cream Sandwich

Like you, we are excited to see that Google released the source code to Android Ice Cream Sandwich (ICS)! We’d like to address the question many of you have now – when can I get my ICS? 

There are many steps and processes that go into Ice Cream Sandwich in a way that works for the carrier and for you.  Once source code is released from Google, it doesn’t automatically update to your device.

Each new version of Android launches with one device partner, in what is called the “Google Experience Device” or GED, the showcase device for a new Android release.  The GED partner for each launch works with Google during the development of the OS so that the device and new Android version are ready for a coordinated simultaneous launch.

Once that GED device ships, the rest of the Android community gains access to the Android source code as its made public shortly after – a critical milestone for device manufacturers and component suppliers, enabling us to start work on integrating the new release into our existing products.

Google has performed the initial public release of the Ice Cream Sandwich source code; additional releases will enable device manufacturers to ship commercial product with ICS.  We are currently assessing this source code, and over the next month we will be determining which devices will get the upgrade and when  — and we will communicate this as information becomes available. From there, the following steps take place:
  1. Merge and adapt the new release for different device hardware architecture(s) and carrier customizations: This means that we take the source code and incorporate it into upgrades for devices on which this can perform well, along with making sure the carrier requirements are met.  Silicon partners such as Qualcomm, TI, and nVidia adapt this to their chipsets in parallel and we incorporate these as they become available. This is also the time when we begin integrating all of the Motorola-specific software enhancements into the source code.  Features like MotoCast, Smart Actions, and our comprehensive enterprise solutions are integral parts of our device experiences, and we want to make sure we continue delivering differentiated experiences for our consumers with these software upgrades.
  2. Stabilize and ‘bake’ the result to drive out bugs: This means that we will prepare the upgrade to meet the quality and stability requirements to enter the wireless carrier’s certification lab.
  3. Submit the upgrade to the carriers for certification: This is the point in the process where the carrier’s lab qualifies and tests the upgrade. Each carrier has different requirements for phases 2 and 3. There may be a two-month preparation cycle to enter a carrier lab cycle of one to three months.
  4. Perform a Customer pre-release: We may perform some customer testing before a final release is delivered publicly to our user base.
  5. Release the upgrade: We are planning on upgrading as many of our phones as possible.  The ability to offer the upgrade depends on a number of factors including the hardware/device capabilities, the underlying chipset software support, the ICS support and then the ability to support the Motorola value add software.
Next, here is Sony Ericsson's perspective:


Ice Cream Sandwich – from source code release to software upgrade

A couple of weeks ago, the source code for Ice Cream Sandwich (Android™ 4.0) was released. This meant the start of an intensive period for the engineers at Sony Ericsson, in order to create a working, stable and certified software release of Ice Cream Sandwich for our 2011 Xperia™ phones.

In our pursuit for greater openness in the Android community, we would like to share some exclusive information of the different phases and activities of Sony Ericsson’s Android development, starting with the release of the Ice Cream Sandwich source code, and leading up to the release of a software upgrade for you to download on your phone. Find out more after the jump!

On the Sony Ericsson Product Blog, we have previously announced that all our 2011 Xperia™ phones will receive software upgrades  to Ice Cream Sandwich (please check the Sony Ericsson Product Blog for upcoming announcements regarding the timing for these software upgrades). However, before we can roll out those software upgrades, there are a lot of activities to first of all get Ice Cream Sandwich to work and become stable on all Sony Ericsson phones. We call this the Bring up phase.

Secondly, and perhaps most important, we must certify and approve the new software release with all the different technologies, networks, and hardware that a modern smartphone should work with. We call this the Certification and approval phase.

Ice Cream Sandwich upgrade process
Illustration showing activities from source code release, to software upgrade.

The Bring up phase: Getting Ice Cream Sandwich to work on our phones
On November 14, the Ice Cream Sandwich source code  was made available. This was also the day when our engineers started their work in order to get Ice Cream Sandwich to run on the 2011 Xperia™ phones, by starting the Bring up phase, as we didn’t have pre-access to the Ice Cream Sandwich source code.

The first thing we do is to integrate the latest available Android source code with the Sony Ericsson development branch, to make sure it compiles. This is done by our engineering teams, who in addition need to confirm that all test and debugging tools are in place. Since we will continue to build more on this basic set of code, the stability of the software is very important at this stage.

In the first Ice Cream Sandwich source code that was released, the Hardware Abstraction Layer (HAL) – the software layer giving applications direct access to the hardware components – was to some extent adapted for a Texas Instruments hardware platform. However, for all 2011 Xperia™ phones, we used a Qualcomm hardware platform. This means we have to replace the default HAL coming with first source code released for Ice Cream Sandwich, with our own HAL.

The HAL changes have impact on several features on a phone, including the camera, different sensors (such as proximity, light, accelerometer and compass), audio, Bluetooth™, Wi-Fi™, GPS, as well as multimedia and graphics components. Thus, we do not only have to modify and configure the HAL according to the Qualcomm hardware platform, but also all the other hardware components used in a phone.

Another layer of complexity to the adaption work is the fact that even though all the 2011 Xperia™ products are based on the same hardware platform and use the Qualcomm 8255 chipset, there are several variations in screen size, memory, peripheral components (such as the camera) and modem constellations. At this stage, we make sure to get all the legacy and basic functionalities (such as phone calls, SMS, MMS, SIM card and access to the SD card) to work.

Integrating Android patches
In the Bring up phase, another task is to integrate a number of patches, to improve and adapt the Android legacy code according to our needs. These are customised patches important to the phone, such as improved error handling. To avoid fragmentation, many of these customised patches are actually contributed back to the Android Open Source Project, so that they are included in the default Android source code for the next software release. This work has made Sony Ericsson one of the main contributors to Android. At this stage, we also integrate our own feature upgrades, such as customised graphics.

As we incorporate these customisations, we also do a basic quality check to confirm that all the integrated changes fulfill the required quality level. Here we run many tests cases, such as confirming the functionality of the music player, video streaming, USB and DRM. When we eventually merge all the functionalities in to one code branch, we run more tests to ensure that all our legacy user scenarios run without problems. This also includes that we ensure that apps installed from Android Market are working properly in general.

Getting the software stable and adding localisation
When all functionalities have been merged into one code branch, we start on the stability tests to make sure the software runs stable in all sorts of use cases. Besides pure lab testing, we rely on a number of live users for testing and reporting defects. And along with pure stability testing, we are continuing with the quality tests. For example, we are performing power consumption tests to improve the power consumption in different user scenarios.

Another important task in this stage is to integrate the localisation support in our applications. In most cases, we are adding more languages to the Android software itself. For example, in the software upgrade we rolled out to our 2011 Xperia™ phones in October, we added support for bi-directional languages such as Arabic.

Once all of these tasks are done, and the software is stable and tested, the software is ready to be submitted for certifications. However, the Bring up phase is overlapped by the Certification and approval phase, as some parts of the software are ready for certification earlier than others. As soon as a specific software module is ready, it’s sent for certification. So while one module can be in the Certification and approval phase, others are still in the Bring up phase.

Android architecture showing position of the HAL.
Illustration showing simplified Android architecture.

The Certification and approval phase: Making sure the software and hardware is compliant
A phone comes with parts and software working with a number of different technologies, such as Bluetooth, Wi-Fi, modem and so on. To use these technologies, we have to certify that the new software is compliant with these technology standards. We therefore need to certify a new software release for all of these different technologies due to operator community requirements (GCF , PTCRB , CCF) and Intellectual Property Rights (IPRs), if we have modified the software module related to such technology.

To a great extent, we try to get global certifications, but in many cases specific countries demand specific tests. For a global, worldwide product, we need local certifications approvals in up to 80 countries. For all these external certifications we are either allowed to test ourselves, and submit evidence that we passed, or we can get external test houses, such as Cetecom, to perform the tests.

Besides the operator and IPR certifications, we must externally comply with certifications for regulatory requirements. For example, we must show evidence that we comply with spurious emissions, SAR, EMC, as well as other environmental and health compliances. But when it comes to software upgrades for existing phone models, not all of the regulatory certifications are needed as they have already been performed once.

On top of this, Sony Ericsson is doing internal self certifications in areas we have identified as extra important to deliver the highest possible quality.

All certifications are based on each phone model, and even if a phone model has been certified with a previous software release, the parts which have been changed must be recertified if we are doing a new software release. So if we, for example, have made changes to the Wi-Fi module in an existing phone model, we need to recertify it. When we are working with a new Android release, such as Ice Cream Sandwich, all the affected areas must be recertified.

Another example is if the Bluetooth stack is changed. Then we have to recertify the Bluetooth part of the new software release. There are many apps the needs to be recertified for each of our phones, if they are changed in a new Android software release, for example Bluetooth, MMS, Wi-Fi, HDMI, DLNA and Adobe FLASH. Besides this, we rerun the Android Compatibility Test Suite (CTS) to make sure that we are compliant.

Contrary to what people may think, it is not the Bring up phase, but the Certification and approval phase that is the most time consuming process when it comes to getting a new software release out on our phones. This is one of the major tasks that are legally required from us as phone manufacturer, but is a task that the custom ROM community doesn’t have to take into consideration. Furthermore, by putting all this efforts into testing and certification, we ensure that quality and conformance is at a top level, in benefit for all consumers worldwide.

Additional approvals might be needed
In some cases, the new and complete software release has to be approved to be used in all the different networks that our phones should work in. Many operators also want to customise the software according to their requirements, which in turn are based on their market, network, differentiation and business model. We implement all of these customisations and create a variety of software packages and releases for each operator.

When all of this is done, we are ready to roll out the software release variants as software upgrades to operators and consumers around the world. The software upgrade can then be downloaded and installed either in the operator’s own update tool (if they have one), from Sony Ericsson’s PC Companion tool, or by over the air updates (FOTA – Firmware Over the Air).