NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

"Ask where to download" breaks playback from within Downloads in app

Open FOM333 opened this issue 2 years ago • 12 comments

Checklist

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

Affected version

0.23.1

Steps to reproduce the bug

  1. Toggle on "Ask where to download" in Download settings.
  2. Go to Downloads menu in Newpipe.
  3. Try to play a downloaded video.

Expected behavior

The video plays.

Actual behavior

App/UI crash.

Screenshots/Screen recordings

No response

Logs

Exception

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

java.lang.SecurityException: UID 10176 does not have permission to content://com.android.providers.downloads.documents/document/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2FCloudflare%20Had%20Another%20Outage.mp4 [user 0] [prefix]; you could obtain access using ACTION_OPEN_DOCUMENT or related APIs
	at android.os.Parcel.createExceptionOrNull(Parcel.java:2426)
	at android.os.Parcel.createException(Parcel.java:2410)
	at android.os.Parcel.readException(Parcel.java:2393)
	at android.os.Parcel.readException(Parcel.java:2335)
	at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2347)
	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1762)
	at android.app.Activity.startActivityForResult(Activity.java:5410)
	at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:597)
	at android.app.Activity.startActivityForResult(Activity.java:5368)
	at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:583)
	at android.app.Activity.startActivity(Activity.java:5754)
	at android.app.Activity.startActivity(Activity.java:5707)
	at org.schabi.newpipe.util.external_communication.ShareUtils.openIntentInApp(ShareUtils.java:157)
	at us.shandian.giga.ui.adapter.MissionAdapter.viewWithFileProvider(MissionAdapter.java:362)
	at us.shandian.giga.ui.adapter.MissionAdapter.-$$Nest$mviewWithFileProvider(Unknown Source:0)
	at us.shandian.giga.ui.adapter.MissionAdapter$ViewHolderItem.lambda$new$1(MissionAdapter.java:902)
	at us.shandian.giga.ui.adapter.MissionAdapter$ViewHolderItem.$r8$lambda$PAQE6UWV_7gFHr9RCCIksMCusOo(Unknown Source:0)
	at us.shandian.giga.ui.adapter.MissionAdapter$ViewHolderItem$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
	at android.view.View.performClick(View.java:7455)
	at android.view.View.performClickInternal(View.java:7432)
	at android.view.View.access$3700(View.java:835)
	at android.view.View$PerformClick.run(View.java:28810)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7870)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: android.os.RemoteException: Remote stack trace:
	at com.android.server.uri.UriGrantsManagerService.checkGrantUriPermissionUnlocked(UriGrantsManagerService.java:1249)
	at com.android.server.uri.UriGrantsManagerService.checkGrantUriPermissionFromIntentUnlocked(UriGrantsManagerService.java:621)
	at com.android.server.uri.UriGrantsManagerService.access$1000(UriGrantsManagerService.java:107)
	at com.android.server.uri.UriGrantsManagerService$LocalService.checkGrantUriPermissionFromIntent(UriGrantsManagerService.java:1410)
	at com.android.server.wm.ActivityStarter$Request.resolveActivity(ActivityStarter.java:541)



Affected Android/Custom ROM version

Android 12 / CalyxOS 3.7.0

Affected device model

Pixel 4a

Additional information

No response

FOM333 avatar Jul 19 '22 05:07 FOM333

Instead of Downloads folder, create another folder for Newpipe downloads, or use the Movies/Music folder instead. Report if that works.

opusforlife2 avatar Jul 25 '22 05:07 opusforlife2

I tried saving videos to several different folders but I still get the error when I try to play them in Newpipe.

FOM333 avatar Jul 25 '22 05:07 FOM333

Yeah but did you try the specific folders I mentioned? It works fine here. The stock Gallery app plays the video from within Downloads.

opusforlife2 avatar Jul 25 '22 05:07 opusforlife2

I did try the specific folders you mentioned, sorry for being vague. I tried both the Music and Movies folders, and I also tried creating another test folder. No matter where the video is saved, when I try to play it from Newpipe it crashes.

FOM333 avatar Jul 25 '22 05:07 FOM333

I see. Thanks for confirming. Are you downloading the video again after changing the downloads folder, or are you moving the file to that folder?

opusforlife2 avatar Jul 25 '22 05:07 opusforlife2

I am downloading the video again after changing the download location.

FOM333 avatar Jul 25 '22 06:07 FOM333

In Storage settings in App Info, does it show External Storage having 1 or 2 items? Is the "Clear Access" button tappable?

opusforlife2 avatar Jul 25 '22 06:07 opusforlife2

It had 2 items and the "clear access" button was tappable. After tapping and then allowing Newpipe access to my preferred download folder it now only shows one, with the "clear access" button being visible again. Important note. I had the setting toggled to prompt for a download location every time I downloaded a video. I turned that off and set Movies to my download location. It now works to play downloaded videos from within the app. Sorry for not realizing this sooner.

FOM333 avatar Jul 25 '22 06:07 FOM333

Ah. Good. That was going to be my next question. xD

Still. This is a problem that the Always ask setting breaks playback from within Downloads.

BTW: When I typed "change the download folder" I meant changing it from within Download settings in the app. Now I see that was a bit too vague.

opusforlife2 avatar Jul 25 '22 06:07 opusforlife2

Well, thanks for your help. Is there anything else I should do? Do I just leave this issue open until there is a fix?

FOM333 avatar Jul 25 '22 06:07 FOM333

Yes, we're done. This issue is triaged for someone to take it up. Hopefully, it will be fixed.

opusforlife2 avatar Jul 25 '22 06:07 opusforlife2

Perfect, thank you!

FOM333 avatar Jul 25 '22 06:07 FOM333

Error

ghost avatar Aug 14 '22 13:08 ghost