Giter Site home page Giter Site logo

Comments (1)

marcbaechinger avatar marcbaechinger commented on July 20, 2024

Difficult to say. This is a low-level change that you are doing and AFAIU there can be many things that can go wrong. You are kind of doing an open heart surgery on the media session service implementation :).

onConnect function will not called with MediaNotificationController

I guess you are overriding onBind and then provide your own local binder instead of what the actual implementation does. Not sure how you implemented this, but the original implementation provides an implementation of the IMediaSession.aidl that provides connect. The standard implementation implements this here. When connect is called the session is eventually passed to service.addSession(session) which is where connecting the media notification controller is triggered.

That's in a nutshell what you'd need to do. I, as an aside, would discourage doing so though because this changes implementation details that are not part of an API that we can ensure to be stable. What I mean is that your implementation may break when we change something in the AIDL interface or the internal implementation. When you update to a new MEdia3 version, you may be in troubles as in you would have to investigate again. That's not something we can support you with closely also I'm afraid.


Out of interest: What are you trying to achieve with a LocalBinder?

I'm asking because my understanding is that a local binder would be used by clients that bind from the same process. This would mean that this local binder is only given to such a client. A MediaSessionService/MediaLibraryService is typically also accessed by for instance System UI that isn't running in the same process. Today, System UI uses the platform controller to connect, but this may change and in such a case using a local binder could become problematic in the future when such clients move to Media3.

We also made some changes that make connections from the same process more efficient for local binding:

d7044c7
77bccf0

from media.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.