Android M Dev Preview Adds Functional RRO Framework
It has been a couple of days since we were treated to the likes of Android M, or Macadamia Nut Cookie as the repos refer to it as. The Android M Dev Preview system images have been out for a while for the Nexus 5, 6, 9 and the Nexus Player; along with the source code for the M Dev Preview being partially pushed. People have had enough time to dig within the preview of the Next Android Release, so it isn’t surprising to find features and changes that Google had up its sleeves but did not feel polished enough for an I/O announcement.
Amongst unannounced changes like the experimental Multi-Window mode, app drawer redesign and Settings App dark theme, there is another change which isn’t obvious to the eye at first, but marks a significant change in the way Android looks and even functions. This comes in the form of the RRO Theme Engine, which was contributed to AOSP by Sony back in early 2014 and was subsequently merged. While Android 5.1 had a few commits included towards the RRO Theme Engine, it did not natively support the theming framework.
With Android M, this is all set to change, as the M Dev Preview natively supports theming on a system and application wide scale, thanks to a functional but limited RRO Theme Engine.
What is the RRO Theme Engine?
A little background for the uninitiated: RRO stands for Runtime Resource Overlay, which allows you to replace resources in a running application without making changes to the app’s source code. In simpler terms, you can essentially change the way an app looks without modifying the app itself.
This theming framework was created by Sony to customize their devices as per operator requirements, along with providing the ability to use Xperia Themes. A detailed post on how RRO works can be found over at Sony’s Developer Blog.
The key to RRO’s dynamics is that the base application which is getting an overlay change does not notice any changes in its configurations, and hence continues to work in its expected behaviour.
How is RRO different from Layers?
Layers is a collective effort by a team called BitSyko. As of Lollipop 5.1, Layers basically expands upon the stock RRO functionality to enable more complex resource switching and allowing themes to take control of more elements than was possible with the stock RRO.
This give rise to two issues. One is that ROM makers need to add code to enable Layers in their roms as the complete functionality of Layers (not to be confused with stock RRO) requires changes to the stock Lollipop RRO.
Second issue is that not all Layers themes will work with Stock RRO. Only simpler themes which do not make use of any complex features can work on stock RRO.
Here’s what XDA Recognized Developer and creator of Layers, sykopompos, has to say regarding enabling Layers support on stock Android M (Dev Preview):
I’ve seen people post pics of the rro part working but layers itself is an add on to rro so without someone decompiling the frameworks, systemui, etc to add in the resource string changes (all done in the resources so no code changes need to be done) then you could have full layers on a modified M preview
In simple words, Layers and RRO are not interchangeable all the time. Layers themes working completely “bug-free” on Stock RRO will be a happy coincidence, but for most XDA users, a little experimentation is never out of the question.
Of course, this assumes that the RRO implementation remains the same between the Dev Preview and the Android M Stable Release. A lot of things can change regarding both RRO and Layers, so this is how the situation currently stands.
How to enable RRO Theme Engine on M Dev Preview?
If you would like to give things a shot in their current iteration, you would firstly need to be on the Android M Dev Preview. You would also need root on the M Dev Preview rom, for which you can follow the instructions found on this forum thread which involves flashing a custom kernel with SELinux set to permissive.
Once you have root, head on over and install the Layers app for managing the overlay layers. You can find existing themes over at the Layers RRO Themes Mega Thread in our forums, which houses more than 400 free Layers Themes. Also be sure to read the Official Layers Thread for help with installation of layers and disabling/uninstalling layers which are buggy/no compatible on Android M Dev Preview.
What does the future hold for RRO?
There are security concerns arising with RRO and its implementation. In worst case scenarios, rogue developers could influence apps in negative and unintended manners. Sony’s workaround to this involved signature matching of the base apk and the overlay apk, thereby restricting overlays to those from the original app developer.
As per our forecasting, the stock version of RRO would not be as free as the custom rom variant of the RRO Theme Engine with Layers support. Stock RRO will focus on allowing OEM’s to theme system apps in an easy manner. However, theming of individual apps outside of system apps will be beyond the scope of the average Android user.
Even then, RRO opens up opportunities for vendors who like to ship close to stock variants of AOSP. This would allow them to add a bit of custom flavor (and choice for their users) to their builds without going through the hassle of building their own theming engine from the ground up.
What do you think of this feature addition from Google? Does it fit into your vision of a themeable stock Android? Should the look of all applications be decided by the devs, or by the users? Let us know your thoughts in the comments below!
Image Credits: Vivid RRO Theme Series
Want more posts like this delivered to your inbox? Enter your email to be subscribed to our newsletter.