Skip to content

Pressing 'pause' button on headphones while no video is currently playing will crash NewPipe #9095

@spitemim

Description

@spitemim

Checklist

  • I am able to reproduce the bug with the latest version.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected version

0.24.0

Steps to reproduce the bug

  1. Connect any kind of headphones, that have a physical 'pause' button, to the device
  2. Ensure that no video is currently playing
  3. Press the 'pause' button on the connected headphones
  4. Wait for a few seconds

Expected behavior

The pause button on your headphones should not have any effect on the app when there is no video playing.

Actual behavior

After a few seconds, the app crashes. This happens regardless of whether the user interacts with the application before or after the button is pressed. The application functions normally in the period of time between pressing the button and the app crashing. I've tested this with bluetooth and wired headphones. I've also tested this when opening the app after a force stop, or after watching a video and then closing it. The bug persists in all cases.

Screenshots/Screen recordings

newpipe-bug-report-3000.mp4

Logs

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: none
  • Version: 0.24.0
  • OS: Linux Android 12 - 32
Crash log

android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{69897de u0 org.schabi.newpipe/.player.PlayerService}
	at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:1966)
	at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:1937)
	at android.app.ActivityThread.access$2700(ActivityThread.java:257)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2191)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7876)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ExecInit.main(ExecInit.java:48)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1898)
	at android.app.ContextImpl.startForegroundService(ContextImpl.java:1853)
	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:781)
	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:781)
	at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(ContextCompat.java:931)
	at androidx.core.content.ContextCompat.startForegroundService(ContextCompat.java:703)
	at androidx.media.session.MediaButtonReceiver.onReceive(MediaButtonReceiver.java:115)
	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4376)
	at android.app.ActivityThread.access$1600(ActivityThread.java:257)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2103)
	... 9 more


Affected Android/Custom ROM version

Android 12 / GrapheneOS (build number SP2A.220505.008.2022090700)

Affected device model

Pixel 3a XL

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue is related to a bugplayer notificationAnything to do with the MediaStyle notificationwaiting for authorIf the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions