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

Commit 67f1e993 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add flag to exclude capability propagation when connecting...

Merge "Add flag to exclude capability propagation when connecting MediaBrowser" into tm-dev am: 2b0d0669 am: c669802f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/34390915



Change-Id: I1c161f037479958899cb889b945d98bc432f7a02
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 96eb0572 c669802f
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.os.ResultReceiver;
import android.service.media.IMediaBrowserService;
import android.service.media.IMediaBrowserServiceCallbacks;
import android.service.media.MediaBrowserService;
import android.service.media.MediaBrowserService.BrowserRoot;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Log;
@@ -183,8 +184,13 @@ public final class MediaBrowser {

                boolean bound = false;
                try {
                    bound = mContext.bindService(intent, mServiceConnection,
                            Context.BIND_AUTO_CREATE | Context.BIND_INCLUDE_CAPABILITIES);
                    int bindServiceFlags = Context.BIND_AUTO_CREATE;
                    if (mRootHints == null
                        || (!mRootHints.containsKey(BrowserRoot.EXTRA_EXCLUDE_CAPABILITIES)
                                && !mRootHints.containsKey(BrowserRoot.EXTRA_RECENT))) {
                        bindServiceFlags |= Context.BIND_INCLUDE_CAPABILITIES;
                    }
                    bound = mContext.bindService(intent, mServiceConnection, bindServiceFlags);
                } catch (Exception ex) {
                    Log.e(TAG, "Failed binding to service " + mServiceComponent);
                }
+12 −0
Original line number Diff line number Diff line
@@ -872,6 +872,18 @@ public abstract class MediaBrowserService extends Service {
         */
        public static final String EXTRA_SUGGESTED = "android.service.media.extra.SUGGESTED";

        /**
         * A key for the root hint when connecting a browser to indicate that the bind connection
         * should not include capabilities.
         *
         * <p>When using {@link #EXTRA_RECENT}, this flag is assumed to be set as well.
         *
         * @see android.content.Context#BIND_INCLUDE_CAPABILITIES
         * @hide
         */
        public static final String EXTRA_EXCLUDE_CAPABILITIES =
                "android.service.media.extra.EXCLUDE_CAPABILITIES";

        private final String mRootId;
        private final Bundle mExtras;