media icon indicating copy to clipboard operation
media copied to clipboard

Android Automotive: "Ghost" playbar appears on sign-in screen after sign-out.

Open mylesbennett-global opened this issue 1 month ago • 2 comments

Version

Media3 main branch

More version details

bfe5930f7f (origin/release, origin/HEAD, release) Fix gradle config for doc-samples module

Devices that reproduce the issue

Appning arm64 AAOS system - API 34 (Emulator)

Devices that do not reproduce the issue

n/a

Reproducible in the demo app?

Yes

Reproduction steps

I will attempt to follow the rules for creating a full zip. However, in case that fails, I will also attach a patch here. The patch adds sign-in and sign-out functionality to the automotive demo app.

  • apply the patch
  • launch the app in an automotive environment, preferably the one specified above, but it should not matter.
  • tap "sign in"
  • play any track
  • back out to the home screen
  • tap on the settings cog wheel
  • tap on "sign out"

Expected result

Playback should stop and the user should be presented with a clean sign-in screen, as seen when the app was first launched.

Image

Actual result

The sign-in screen has a playbar with default metadata superimposed over the top of it.

Image

Media

The patch uses the media in the demo app:

0001-Signed-out-ghost-playbar.patch

Bug Report

  • [x] You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

mylesbennett-global avatar Dec 09 '25 14:12 mylesbennett-global

Thanks for your report.

I understand this should work as follows from the library side:

  1. onGetChildren returns an error "ERROR_SESSION_AUTHENTICATION_EXPIRED`.
  2. Media3 replicates this to a a non-fatal error in the platform session
  3. AAOAs sees this error and reads the Intent for the sign-in activity from what you sent with EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT_COMPAT
  4. AAOS shows the activtity by using the Intent

From your report I understand this roughly works with the exception that there is this playbar with default metadata.

When looking into the bug report that you sent by emaikl, I see that the session is in fatal error state with an empty queue. The error message seems to be from what you sent to AAOS with your intent.

I think as a first step, we should figure out why there is a fatal error (state=ERROR(7)) as opposed to the non-fatal error in the session.

This may be a bug in Media3.

Can you confirm you haven't set the error replication mode to LIBRARY_ERROR_REPLICATION_MODE_FATAL by intention?

androidx.media3.session.id. androidx.media3.demo.session.automotive/androidx.media3.session.id. (userId=10)
      ownerPid=4462, ownerUid=1010194, userId=10
      package=androidx.media3.demo.session.automotive
      launchIntent=null
      mediaButtonReceiver=MBR {pi=null, componentName=ComponentInfo{androidx.media3.demo.session.automotive/androidx.media3.session.MediaButtonReceiver}, type=1, pkg=androidx.media3.demo.session.automotive}
      active=true
      flags=7
      rating type=0
      controllers: 6
      state=PlaybackState {state=ERROR(7), position=-1, buffered position=0, speed=0.0, updated=14020311, actions=0, custom actions=[], active item id=-1, error=Tap the button below}
      audioAttrs=AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_MUSIC flags=0x800 tags= bundle=null
      volumeType=LOCAL, controlType=ABSOLUTE, max=0, current=0, volumeControlId=null
      metadata: size=2, description=null, null, null
      queueTitle=null, size=0

marcbaechinger avatar Dec 09 '25 16:12 marcbaechinger

I can confirm that I have not set the error replication mode to LIBRARY_ERROR_REPLICATION_MODE_FATAL by intention. In fact, this is the first time I have seen that constant.

The empty queue might be because I am doing this on sign-out:

  private fun signOut() {
    userManager.signOut()
    mediaLibrarySession.player.stop()
    mediaLibrarySession.player.seekToDefaultPosition()
    mediaLibrarySession.player.clearMediaItems()
  }

mylesbennett-global avatar Dec 09 '25 17:12 mylesbennett-global