Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a81bc64 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Avoid binding to providers if no apps are scanning" into main

parents 81a4375f e793c641
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -121,3 +121,13 @@ flag {
    description: "Enables apps owning a MediaBrowserService to disconnect all connected browsers."
    bug: "185136506"
}

flag {
    name: "enable_prevention_of_manager_scans_when_no_apps_scan"
    namespace: "media_solutions"
    description: "Prevents waking up route providers when no apps are scanning, even if SysUI or Settings are scanning."
    bug: "319604673"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+3 −1
Original line number Diff line number Diff line
@@ -232,7 +232,9 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
        if (!mRunning) {
            return false;
        }
        if (!getSessionInfos().isEmpty() || mIsManagerScanning) {
        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