The remote control stack in AudioService is responsible for handling
which application receives media button events. When an application
"registers" its media button receiver, it gets placed at the top
of the remote control stack. If the app also has audio focus (is
at top of focus stack), this will also cause the information of
the attached remote control client (RCC) to be displayed on the
lockscreen.
If an app doesn't re-register its button receiver when it wants
to receive the button events, it might have lost its place at the
top of the remote control stack, and would not show up in the
lockscreen anymore.
This change consists in using the playstate reported by the RCC
to change the remote control stack. If an RCC reports a "playing"
state (e.g. playing, fast forwarding), it is safe to assume the
application is actively being used, and should be the one that
receives the transport control buttons. This CL uses the reported
playstate to conditionally move the corresponding stack entry
to the top of the stack.
Bug 7311023
Change-Id: I1505f01664c16e108b22d33e3f47f0056343676e
Iterate of remote control stack entries from the top of the stack
for cases where the condition being checked is more likely at
the top of the stack, as opposed to the bottom, which is first
accessed when using an iterator.
Change-Id: I625bee59021c2d652e9d6355b48dc0c11e36093f
Iterate over the remote control stack from top to bottom
when (un)registering a remote control client (RCC).
When unregistering an RCC, stop traversing the stack when
match found. If match was at top of the stack, update
the remote control display (RCD).
Change-Id: If64acf102bdf328085d707f9e0f7e86cf4d4001a
Iterate over the media button receiver stack from top to bottom
when removing or adding a receiver.
Update comments and name to reflect that the corresponding methods
must be synchronized on audio focus and remote control.
Change-Id: I1fb7f682a999aa66d92d56ca6ecd8b37eeff8ac9
Add comments to reflect where and why the audio focus and media
button stacks are traversed with an iterator, which traverses
the stack from bottom to top.
Change-Id: I462a522195e742295d13eff5fc727e59a5d7e830
The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.
Bug 7736700
Change-Id: I08e677faf2ebb418ef131d0a8008e01037db0e50
The mediascanner member mIsDrm was never set
according to the drmframework canHandle call.
This subsequently caused that the isdrm column
in mediastore was never set, and was defaulted
to false for all files.
mIsDrm is now set according to drmframework
canHandle result for each files that is scanned.
Change-Id: Id557d921c4e3e3dfc35da56b69471f4bd6b3c8bf