Connect with us


How Google patched Android in response to Sonos patent dispute (twice)




Last week, the ITC (European Parliament Committee on International Trade) ruled in favor of Sonos as part of an ongoing patent dispute with Google related to multi-speaker control of the Google Cast protocol. We investigated how Google is changing the behavior of Android to work around this issue, and what that means for developers and users.

If you have two or more smart speakers that are compatible with your Android device and the Google Cast protocol, you can use the Google Home app to group those speakers. Once grouped, users can play music in that speaker group by selecting a speaker group from the list of targets that appears when they tap the cast icon in a music streaming app that implements the Cast SDK. The Cast SDK is bundled with the Google Play service. Therefore, it is not included in AOSP. However, like many other Google SDKs, the Cast SDK makes extensive use of the Android platform API.

After the release of the fifth Android 12 beta on September 8, 2021, app developers discovered a slowdown in music cast caused by unannounced changes to Android’s media session stack. With this change, physical volume button events are no longer passed to remote media sessions. This means that users can no longer easily change the volume of the connected smart speaker from their smartphone after quitting the app that casts audio. Observers wondered what caused this change when many people disabled frequently used features without notice. Google usually warns developers before publishing changes that affect existing APIs, but in this case they found a regression. In this post, we’ll take a closer look at the changes Google made to Android 12, which blocked (and later re-enabled) volume control for remote media sessions.

How did the remote volume adjustment break (and have been fixed)?How it broke

In late July, a code change titled Not Passing Volume Key Events to Remote Sessions was committed to AOSP, and this change was finally reflected in Android in the fifth beta release of Android 12. This has adjusted the getDefaultVolumeSession method of the MediaSessionStack class. Check if the active media session is using local playback. (Android defines local playback as playback that occurs on the device, while remote playback is playback that occurs on an external device.)

Previously, the getDefaultVolumeSession method only checked the playback status of a media session, whether local or remote. This platform change dispatched volume key events only if the active media session used local playback. As a result, affected apps will utilize the Google Support Library for media. This is how most apps handle requests to adjust the volume of remote media sessions.

This regression is easy to reproduce and affects all devices running Android 12 versions prior to Release 26 that were uploaded to AOSP last week. As described in Google Issue Tracker, open a music streaming app that supports the Cast SDK, select an external device to stream your audio, quit the app while playing music, then turn up the volume key or volume Press the down key. Terminal. The volume slider is visible, but the current volume of the remote media session is not displayed and does not change. The logcat output shared by the developer who first reported the issue confirms that MediaSessionService is not dispatching volume key events to the app.

Android 11:

D / MediaSessionService: Adjust / spotify-media-session (userId = 0) to 0. flags = 4116, suggestedStream = -2147483648, preferSuggestedStream = false

Android 12 Beta 5:

D / MediaSessionService: Adjust suggestedStream = -2147483648 to 0. flags = 4116, preferSuggestedStream = false, session = null

The log shows that the session is considered null in Android 12 and instead the volume of the suggestedStream changes (in this case, this is just the default stream type).

(Partial) corrections

With Android 12.0.0 Release 26, Google has retuned Android’s volume control rules. The patch in question introduces new logic to determine whether to allow remote session volume adjustments. (Supplement: This patch has already been released to Pixel devices as part of the January 2022 monthly firmware update.)

The above getDefaultVolumeSession method of the MediaSessionStack class no longer checks if the active media session is using local playback. Instead, it now checks the output of the canHandleVolumeKey method added in this patch. The new canHandleVolumeKey method of the MediaSessionStack class returns true if the media session can handle volume key events, false otherwise. The method returns true if any of the following conditions are met:

The active media session uses local playback. The flag config_volumeAdjustmentForRemoteGroupSessions is set to true. Your app’s list of routing sessions contains only a single route (excluding system routing sessions).

If condition # 1 or # 2 is met, # 3 is not checked. However, if both # 1 and # 2 fail, # 3 is checked.

(The new showForSession method of the VolumeDialogControllerImpl class follows a similar logic to determine whether to display the cast session volume level slider in the system volume panel.)

AOSP defines config_volumeAdjustmentForRemoteGroupSessions as true by default, so Android’s default behavior is to adjust the volume of a remote media session regardless of how many roots the session has. That is, it doesn’t matter if the user is trying to adjust the volume of a single speaker or group of speakers. You can control either with the volume key.

However, this does not really happen on Pixel smartphones with the latest Android updates. Instead, Pixel smartphones can only adjust the volume of remote media sessions if there is only one speaker at the root. This is because condition # 2 fails on the Pixel because Google set the config_volumeAdjustmentForRemoteGroupSessions flag to false on its device. I confirmed this on my Pixel 4 running Android 12 build SQ1A.220105.002 by running the following shell command.

Checking the value of the config_volumeAdjustmentForRemoteGroupSessions flag.

This value deviates from the AOSP default value, so I knew that Google would need to use the Runtime Resource Overlay (RRO) to override the value. Then I ran the following command to see which overlay was the cause:

cmd overlay dump

This command lists all installed RROs and their identity maps. From this output, we see that the config_volumeAdjustmentForRemoteGroupSessions flag is overridden by PixelConfigOverlayCommonRRO. This RRO is named because it’s common to all Pixel devices.

The Boolean flag defined by PixelConfigOverlayCommon RRO overrides the corresponding flag in the framework. Why did Google disable speaker group volume control?

Speculation broke out last year after the first patch to disable the passing of volume key events for all remote media sessions was pushed to public builds. Google engineers vaguely hinted at a legal issue, but the engineer didn’t elaborate on what the legal issue was.

Following a recent decision inherited from the ITC, it became clear what legal issues Google engineers were referring to. The ITC has determined that Google infringes five US patents held by Sonos. One of these is US Pat. No. 8588949 on how and equipment to adjust volume levels in a multi-zone system. We can’t explain how Android or Nest products are alleged to violate this patent, but in response to this decision, Google has announced that users will not be able to change it. [their] Use speaker group volume [their] The physical volume button on the phone.In addition, Google says users need to adjust each speaker [volume] Instead of using the group volume controller to adjust the volume of the speaker group individually. Both of these restrictions imposed on users are consistent with Google’s platform-level changes to Android 12, suggesting that Google has tweaked Android behavior in response to Sonos’ controversy. I am.

Screenshots of Google’s announcement in the Google Nest community.

The first patch looks like Band-Aid, while the second patch seems to be tuned to allow Google to ship Pixel smartphones without the ability to control the volume of remote speaker group sessions. However, there is also an easy way for OEMs to enable this feature and ship their own devices. All the OEM needs to do is build the AOSP using GMS and leave the default value (true) for the config_volumeAdjustmentForRemoteGroupSessions flag.

Google may address this issue differently in future versions of Android, but the second Android 12L beta shows the same behavior as seen in the latest Android 12 release.

How the user restores the remote volume control for the speaker group

Just as Google disabled this behavior through RRO, knowledgeable users can re-enable this behavior using their own RRO. Simply create the RRO with a higher priority than the PixelConfigOverlayCommon RRO and set the config_volumeAdjustmentForRemoteGroupSessions flag to true. However, Android does not allow you to install an RRO that is not signed with a platform certificate, so you need superuser access to install this RRO.

Remote volume control for speaker groups working on Pixel 4 running Android 12 build SQ1A.220105.002 using custom RRO.

If the caller has superuser access, you can also use the Android 12s Fabricated Overlay CLI to generate an overlay that overrides the flag. However, the patch for CVE-2021-39630 clears all overlays created by the shell at boot time, and this flag is read by the framework, which requires the framework to be restarted, so the overlay created. The approach doesn’t work.

In summary, Google has patched the Androids media framework twice, which is likely to respond to the dispute with Sonos. The first patch prevented volume key events from being passed to a remote media session and removed the ability to use the volume key to adjust the volume of a cast session when the user exited the app to cast. The second patch sets the volume adjustment rule so that volume key events are passed to remote media sessions if the flag config_volumeAdjustmentForRemoteGroupSessions is set to true, or if there is only one route in the app’s list of routing sessions. I adjusted it. The config_volumeAdjustmentForRemoteGroupSessions flag is set to true in AOSP, but is overridden by the RRO on the Pixel device to false. The OEM will use GMS to build the AOSP and leave the above flag true to allow the user to adjust the volume of the remote speaker group. On the other hand, tech-savvy users can create their own RROs to restore their previous behavior on Pixel devices.




The mention sources can contact us to remove/changing this article

What Are The Main Benefits Of Comparing Car Insurance Quotes Online

LOS ANGELES, CA / ACCESSWIRE / June 24, 2020, / Compare-autoinsurance.Org has launched a new blog post that presents the main benefits of comparing multiple car insurance quotes. For more info and free online quotes, please visit https://compare-autoinsurance.Org/the-advantages-of-comparing-prices-with-car-insurance-quotes-online/ The modern society has numerous technological advantages. One important advantage is the speed at which information is sent and received. With the help of the internet, the shopping habits of many persons have drastically changed. The car insurance industry hasn't remained untouched by these changes. On the internet, drivers can compare insurance prices and find out which sellers have the best offers. View photos The advantages of comparing online car insurance quotes are the following: Online quotes can be obtained from anywhere and at any time. Unlike physical insurance agencies, websites don't have a specific schedule and they are available at any time. Drivers that have busy working schedules, can compare quotes from anywhere and at any time, even at midnight. Multiple choices. Almost all insurance providers, no matter if they are well-known brands or just local insurers, have an online presence. Online quotes will allow policyholders the chance to discover multiple insurance companies and check their prices. Drivers are no longer required to get quotes from just a few known insurance companies. Also, local and regional insurers can provide lower insurance rates for the same services. Accurate insurance estimates. Online quotes can only be accurate if the customers provide accurate and real info about their car models and driving history. Lying about past driving incidents can make the price estimates to be lower, but when dealing with an insurance company lying to them is useless. Usually, insurance companies will do research about a potential customer before granting him coverage. Online quotes can be sorted easily. Although drivers are recommended to not choose a policy just based on its price, drivers can easily sort quotes by insurance price. Using brokerage websites will allow drivers to get quotes from multiple insurers, thus making the comparison faster and easier. For additional info, money-saving tips, and free car insurance quotes, visit https://compare-autoinsurance.Org/ Compare-autoinsurance.Org is an online provider of life, home, health, and auto insurance quotes. This website is unique because it does not simply stick to one kind of insurance provider, but brings the clients the best deals from many different online insurance carriers. In this way, clients have access to offers from multiple carriers all in one place: this website. On this site, customers have access to quotes for insurance plans from various agencies, such as local or nationwide agencies, brand names insurance companies, etc. "Online quotes can easily help drivers obtain better car insurance deals. All they have to do is to complete an online form with accurate and real info, then compare prices", said Russell Rabichev, Marketing Director of Internet Marketing Company. CONTACT: Company Name: Internet Marketing CompanyPerson for contact Name: Gurgu CPhone Number: (818) 359-3898Email: [email protected]: https://compare-autoinsurance.Org/ SOURCE: Compare-autoinsurance.Org View source version on accesswire.Com:https://www.Accesswire.Com/595055/What-Are-The-Main-Benefits-Of-Comparing-Car-Insurance-Quotes-Online View photos


to request, modification Contact us at Here or [email protected]