Access to previous rides' .fit files from an extension
Is it possible for a Karoo extension to read the previous rides' Fit files?
I can see that they are in the public, shared internal storage / FitFiles folder.
On Android 8, using the Storage Access Framework , an app should be able to call the ACTION_OPEN_DOCUMENT or ACTION_OPEN_DOCUMENT_TREE intents to trigger the in-built file viewer for the user to select the file(s) the app should be allowed have access to. On my Karoo 2, these intents don't resolve to anything.
I determined that these intents are normally implemented by the DocumentsUI (com.android.documentsui) or 'Files' app, which isn't installed.
I found the Files APK for Android 8 and installed it, However it crashes both when launched from the ACTION_OPEN_DOCUMENT intent or opening it directly as an 'Exentsion', with a "java.lang.SecurityException: Permission Denial: opening provider com.android.externalstorage.ExternalStorageProvider"
Has anyone had any success accessing files outside the app-private files folder?
(As expected, trying to directly read the files directly from /sdcard/FitFiles/ gives a permission error.)
Full exception trace from DocumentsUI below:
FATAL EXCEPTION: AsyncTask #1
Process: com.android.documentsui, PID: 1636
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.externalstorage.ExternalStorageProvider from ProcessRecord{cdaeb26 1636:com.android.documentsui/u0a63} (pid=1636, uid=10063) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
at android.os.Parcel.readException(Parcel.java:2013)
at android.os.Parcel.readException(Parcel.java:1959)
at android.content.IContentService$Stub$Proxy.registerContentObserver(IContentService.java:768)
at android.content.ContentResolver.registerContentObserver(ContentResolver.java:1927)
at android.content.ContentResolver.registerContentObserver(ContentResolver.java:1916)
at com.android.documentsui.roots.ProvidersCache.loadRootsForAuthority(ProvidersCache.java:256)
at com.android.documentsui.roots.ProvidersCache$UpdateTask.handleDocumentsProvider(ProvidersCache.java:477)
at com.android.documentsui.roots.ProvidersCache$UpdateTask.doInBackground(ProvidersCache.java:446)
at com.android.documentsui.roots.ProvidersCache$UpdateTask.doInBackground(ProvidersCache.java:434)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more
Force finishing activity com.android.documentsui/.picker.PickActivity
Force finishing activity com.example.myosmdroidapp/.MainActivity
Please sign in to leave a comment.
Comments
0 comments