diff options
| author | 2024-12-11 08:07:31 +0000 | |
|---|---|---|
| committer | 2024-12-11 08:07:31 +0000 | |
| commit | fc4be921e828fb5fb041d87a82e451341ed66efc (patch) | |
| tree | 8da781fdec6f91586671a056cf998c0d4eb63ef0 | |
| parent | b2b28efd0ff142d0b324f568158d6f55934bf6ba (diff) | |
| parent | 8ed415bc8f638a07a49da9e6c11d4ce98fff4c31 (diff) | |
Merge "Bind to system media MR2RouteProviders for any manager scans" into main
| -rw-r--r-- | services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java index 5ee9452c6a53..d8c35358102d 100644 --- a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java +++ b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java @@ -279,13 +279,20 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider { if (!mRunning) { return false; } + // We bind if any manager is scanning (regardless of whether an app is scanning) to give + // the opportunity for providers to publish routing sessions that were established + // directly between the app and the provider (typically via AndroidX MediaRouter). See + // b/176774510#comment20 for more information. boolean bindDueToManagerScan = mIsManagerScanning && !Flags.enablePreventionOfManagerScansWhenNoAppsScan(); - if (!getSessionInfos().isEmpty() || bindDueToManagerScan) { - // We bind if any manager is scanning (regardless of whether an app is scanning) to give - // the opportunity for providers to publish routing sessions that were established - // directly between the app and the provider (typically via AndroidX MediaRouter). See - // b/176774510#comment20 for more information. + // We also bind if this provider supports system media routing, because even if an app + // doesn't have any registered discovery preference, we should still be able to route their + // system media. + boolean bindDueToSystemMediaRoutingSupport = + mIsManagerScanning && mSupportsSystemMediaRouting; + if (!getSessionInfos().isEmpty() + || bindDueToManagerScan + || bindDueToSystemMediaRoutingSupport) { return true; } boolean anAppIsScanning = |