Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method Deprecated #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

kdhalbert13
Copy link

@kdhalbert13 kdhalbert13 commented Oct 1, 2019

Fix for #4

See https://developer.android.com/reference/android/os/Environment for reference.

getExternalStoragePublicDirectory (String type) was deprecated in API level 29.

To improve user privacy, direct access to shared/external storage devices is deprecated. When an app targets Build.VERSION_CODES.Q, the path returned from this method is no longer directly accessible to apps. Apps can continue to access content stored on shared/external storage by migrating to alternatives such as Context#getExternalFilesDir(String), MediaStore, or Intent#ACTION_OPEN_DOCUMENT.

…r reference.

getExternalStoragePublicDirectory (String type) was deprecated in API level 29.

To improve user privacy, direct access to shared/external storage devices is deprecated. When an app targets Build.VERSION_CODES.Q, the path returned from this method is no longer directly accessible to apps. Apps can continue to access content stored on shared/external storage by migrating to alternatives such as Context#getExternalFilesDir(String), MediaStore, or Intent#ACTION_OPEN_DOCUMENT.
@programmin1
Copy link
Owner

It would appear Tunesviewer needs to compile for older api right now then with that downloads directory string option? Thanks for the info.

@programmin1
Copy link
Owner

Even with that line this doesn't seem to ever open files anymore./

    Process: com.tunes.viewer, PID: 9797
    java.lang.RuntimeException: Unable to start service com.tunes.viewer.FileDownload.DownloadService@e8cc63f with Intent { cmp=com.tunes.viewer/.FileDownload.DownloadService (has extras) }: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.tunes.viewer/files/Download/Mathematics%20Algebra%201/MATH%20ALGEBRA%201%20FINAL%20copy.pdf exposed beyond app through Intent.getData()
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4105)
        at android.app.ActivityThread.access$1800(ActivityThread.java:219)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.tunes.viewer/files/Download/Mathematics%20Algebra%201/MATH%20ALGEBRA%201%20FINAL%20copy.pdf exposed beyond app through Intent.getData()
        at android.os.StrictMode.onFileUriExposed(StrictMode.java:2083)
        at android.net.Uri.checkFileUriExposed(Uri.java:2388)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:10791)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:10744)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1703)
        at android.app.ContextImpl.startActivity(ContextImpl.java:957)
        at android.app.ContextImpl.startActivity(ContextImpl.java:928)
        at android.content.ContextWrapper.startActivity(ContextWrapper.java:383)
        at com.tunes.viewer.FileDownload.DownloaderTask.openFile(DownloaderTask.java:112)
        at com.tunes.viewer.FileDownload.DownloaderTask.doTapAction(DownloaderTask.java:147)
        at com.tunes.viewer.FileDownload.DownloadService.onStart(DownloadService.java:108)
        at android.app.Service.onStartCommand(Service.java:503)
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4087)
        at android.app.ActivityThread.access$1800(ActivityThread.java:219) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants