We’re still reeling from the fallout from the explosive decision in the lawsuit between Sonos and Google over patent infringement. Google immediately updated several of its devices to remove infringing content, disabling volume control for speaker groups and pushing some users to update their devices with a new app on the Play Store. A few days earlier, however, the company returned a utility that was initially removed in the run-up to Android 12. If you’re wondering what’s going on with the Cast volume control, a new expose gives us some in-depth insight.
Esper’s Senior Technical Writer, Mishaal Rahman, has posted an excellent explainer on one of the weirder repercussions of the ongoing legal battles between Google and Sonos. It’s worth reading in its entirety, as Rahman goes into great detail about what’s going on with Cast on a system level. The article also confirms some suspicions about whether or not the company was acting in part because of its legal issues.
Last summer, the fifth Android 12 beta removed Cast volume controls, something that initially looked like a bug before reality set in. If you’ve never streamed music or videos to a nearby receiver, this feature allows your device to automatically change the volume of anything actively streaming just by using the volume rocker. With it, there is no need to switch between toggles or manually interact with Android itself – everything happens automatically. However, when the final stable (well, sort of stable) release was released in the fall, these commands were nowhere in sight, leaving many to speculate what was going on with a once easily accessible utility. In December, a comment left in Google’s issue tracker flagged an unspecified “legal issue” that left many speculating Sonos was the culprit.
Last week’s ITC ruling seemed to confirm that theory, even though it came days after the January Pixels patch added those volume controls. Rahman’s post offers insight into why Google removed the feature. and how he managed to add it. In early September, when Beta 5 arrived for testers, a change in Android’s code caused it to stop checking whether playback was happening on device or remotely, which, in turn, has affected almost all applications. on your phone, Rahman explains:
Previously, the getDefaultVolumeSession method only checked the playback status of the media session, whether local or remote. This platform change caused volume key events to be dispatched only when the active media session was using local playback. This, in turn, affected apps using Google’s media support library, which is how most apps handle volume adjustment requests for remote media sessions.
With the latest version of Android 12, Google changed this rule for the second time. Instead of checking if the playback was happening remotely, he added a new method: “canHandleVolumeKey”. This rule returns true or false, depending on whether one of the three conditions is true. The first check just looks for the local playback – pretty straightforward. The second looks to see if the config_volumeAdjustmentForRemoteGroupSessions is set to true. AOSP builds have this by default, but the patch that was sent to Pixels earlier this year does not.
So if you’re streaming audio to a speaker, the first rule fails. The second rule automatically fails on Pixel devices, bypassing it completely. This leaves rule three, which aims to ensure that there is only one route for the application – in other words, only one speaker serves as the destination for the audio.
That goes back to the speaker cluster volume control, which Google turned off following the ruling in Sonos’ results. It’s certainly suspicious timing, implying that the company may have known in advance that the deal wasn’t going to turn out in its favor. The war between Sonos and Google is far from over, but with some quick changes made hours after the ITC’s decision, it seems likely that an outright ban on imports won’t go into effect.
These code changes are quite complex, but Mishaal does a great job of diving deep into how Android’s code has changed due to these legal issues – and how some tech-savvy users can pick up band commands. of loudspeakers. It’s definitely worth checking out his entire walkthrough if you’re interested in how patent infringement can affect software running on billions of devices around the world.
When Google tried to expand the Home app, it didn’t go so well
About the Author