1
6
Fork
You've already forked nup-android
0

Android Auto annoyingly insistent about resuming playback #80

Open
opened 2024年01月30日 21:00:05 +01:00 by derat · 0 comments
Owner
Copy link

I saw Android Auto resume playback even though I'd told it several times to pause.

I'd manually paused playback while driving and later shut down the head unit:

01-30 09:24:27.189 D Core$_playerImpl Media session request to pause
01-30 09:24:27.199 D Core Pausing player
...
01-30 09:34:27.351 D Core$_playerImpl Media session request to stop
...
01-30 09:34:30.990 D Core Transiently lost audio focus
01-30 09:34:33.436 D Core Lost audio focus
01-30 09:34:33.544 D Core$_playerImpl Media session request to pause
01-30 09:34:33.584 D Core Pausing player
01-30 09:39:24.398 D NupService Destroying service

When the head unit started again, it told the service to start playing:

01-30 11:19:21.103 D NupService Creating service
01-30 11:19:21.247 D NetworkHelper Network initially available
01-30 11:19:21.253 D Core Initializing core
01-30 11:19:21.333 D NupService Creating MediaLibrarySession
...
01-30 11:19:22.065 D Core$_playerImpl Media session request to prepare
01-30 11:19:22.069 D Core$_playerImpl Clearing stopped state
01-30 11:19:22.933 D FileCacheDatabase Finished loading 1482 cache entries
01-30 11:19:22.965 D Core$_playerImpl Media session request to play
01-30 11:19:23.037 D Core Requested audio focus; got 1
01-30 11:19:23.038 D Core Unpausing player

I pressed the pause button, but Android Auto annoyingly seemed to start playback again soon afterward:

01-30 11:19:28.311 D Core$_playerImpl Media session request to pause
01-30 11:19:28.313 D Core Pausing player
...
01-30 11:19:35.677 D Core Lost audio focus
...
01-30 11:19:48.030 D Core$_playerImpl Media session request to play
01-30 11:19:48.040 D Core Requested audio focus; got 1
01-30 11:19:48.043 D Core Unpausing player
...
01-30 11:19:50.887 D Core$_playerImpl Media session request to play
01-30 11:19:50.888 D Core Unpausing player

I had to pause it again to get it to stop:

01-30 11:19:55.408 D Core$_playerImpl Media session request to pause
01-30 11:19:55.413 D Core Pausing player

I assume that there's nothing I can do about this, since I think that I'd previously seen Android Auto kill and restart the service if it didn't respond quickly to its requests. Automatically playing when I restarted the head unit is probably reasonable since I think there's an autoplay setting that I have enabled, but unpausing again shortly after I'd paused was very annoying.

I saw Android Auto resume playback even though I'd told it several times to pause. I'd manually paused playback while driving and later shut down the head unit: ``` 01-30 09:24:27.189 D Core$_playerImpl Media session request to pause 01-30 09:24:27.199 D Core Pausing player ... 01-30 09:34:27.351 D Core$_playerImpl Media session request to stop ... 01-30 09:34:30.990 D Core Transiently lost audio focus 01-30 09:34:33.436 D Core Lost audio focus 01-30 09:34:33.544 D Core$_playerImpl Media session request to pause 01-30 09:34:33.584 D Core Pausing player 01-30 09:39:24.398 D NupService Destroying service ``` When the head unit started again, it told the service to start playing: ``` 01-30 11:19:21.103 D NupService Creating service 01-30 11:19:21.247 D NetworkHelper Network initially available 01-30 11:19:21.253 D Core Initializing core 01-30 11:19:21.333 D NupService Creating MediaLibrarySession ... 01-30 11:19:22.065 D Core$_playerImpl Media session request to prepare 01-30 11:19:22.069 D Core$_playerImpl Clearing stopped state 01-30 11:19:22.933 D FileCacheDatabase Finished loading 1482 cache entries 01-30 11:19:22.965 D Core$_playerImpl Media session request to play 01-30 11:19:23.037 D Core Requested audio focus; got 1 01-30 11:19:23.038 D Core Unpausing player ``` I pressed the pause button, but Android Auto annoyingly seemed to start playback again soon afterward: ``` 01-30 11:19:28.311 D Core$_playerImpl Media session request to pause 01-30 11:19:28.313 D Core Pausing player ... 01-30 11:19:35.677 D Core Lost audio focus ... 01-30 11:19:48.030 D Core$_playerImpl Media session request to play 01-30 11:19:48.040 D Core Requested audio focus; got 1 01-30 11:19:48.043 D Core Unpausing player ... 01-30 11:19:50.887 D Core$_playerImpl Media session request to play 01-30 11:19:50.888 D Core Unpausing player ``` I had to pause it again to get it to stop: ``` 01-30 11:19:55.408 D Core$_playerImpl Media session request to pause 01-30 11:19:55.413 D Core Pausing player ``` I assume that there's nothing I can do about this, since I think that I'd previously seen Android Auto kill and restart the service if it didn't respond quickly to its requests. Automatically playing when I restarted the head unit is probably reasonable since I think there's an autoplay setting that I have enabled, but unpausing again shortly after I'd paused was very annoying.
Sign in to join this conversation.
No Branch/Tag specified
main
fts
aspect
cast
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
derat/nup-android#80
Reference in a new issue
derat/nup-android
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?