commit | 7efef61204ed5426a3c95e4cf5b28b57a1590758 | [log] [tgz] |
---|---|---|
author | Santiago Seifert <aquilescanta@google.com> | Mon Feb 12 11:24:59 2024 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Mon Feb 12 11:24:59 2024 +0000 |
tree | d9c804e50030333ad897ebcbb7ffc2edbad84bc5 | |
parent | 531c9d5a20c52790d3be33b5aa26ecf230dc3be1 [diff] | |
parent | f8441fc6d414a513c8fee8edad7243a2ebbfb075 [diff] |
Merge "Prevent autobinding ProviderWatcher abuses" into main
diff --git a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java index cec7a79..5d415c2 100644 --- a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java +++ b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
@@ -200,7 +200,9 @@ Slog.d(TAG, this + ": Starting"); } mRunning = true; - updateBinding(); + if (!Flags.enablePreventionOfKeepAliveRouteProviders()) { + updateBinding(); + } } if (rebindIfDisconnected && mActiveConnection == null && shouldBind()) { unbind();
diff --git a/services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java b/services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java index 233a3ab..fcca94b 100644 --- a/services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java +++ b/services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java
@@ -150,7 +150,9 @@ mCallback.onAddProviderService(proxy); } else if (sourceIndex >= targetIndex) { MediaRoute2ProviderServiceProxy proxy = mProxies.get(sourceIndex); - proxy.start(/* rebindIfDisconnected= */ true); // restart the proxy if needed + proxy.start( + /* rebindIfDisconnected= */ + !Flags.enablePreventionOfKeepAliveRouteProviders()); Collections.swap(mProxies, sourceIndex, targetIndex++); } }