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

fix(droid): FileOpenPicker public path #16863

Closed

Conversation

ajpinedam
Copy link
Contributor

GitHub Issue (If applicable): closes #16587

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@ajpinedam ajpinedam self-assigned this May 24, 2024
@github-actions github-actions bot added the platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform label May 24, 2024
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-16863/index.html

@github-actions github-actions bot added the area/automation Categorizes an issue or PR as relevant to project automation label May 24, 2024
@ajpinedam
Copy link
Contributor Author

Sample app running with a new Manual Test"

Picking Videos Picking Photos
uno_android_fileopenpicker_videos_fileinfo uno_android_fileopenpicker_photos_fileinfo

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-16863/index.html


static class FileSystemUtils
{
const string FolderHash = "2203693cc04e0be7f4f024d5f9499e13";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this hash coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a directory name. We can name it differently and have a different value, like "UnoPlatform"

@MartinZikmund
Copy link
Member

I'm not sure if this is reliable, as the user can pick from any arbitrary location and the path will in many cases be not accessible via an actual path, only via that Android SAF framework. There is however a way to cache access to previously opened files (maybe it is just about storing the content URI, I don't remember exactly), so we could use that to implement FutureAccessList API

@MartinZikmund
Copy link
Member

MartinZikmund commented May 30, 2024

Ah, I understand now, so this does copies the picked files into the temporary storage of the app? I'm not sure if that is the ideal, as this means that if a potentially large file is picked, it will take time to copy it as well as it will require additional space on the device. Plus, I think that this change means one cannot do actual read/write changes to picked files, as modifications will actually be done to this private copy instead, so this could even be a breaking change. I guess if that is the only way, it should be responsibility (workaround) of the user to copy the file to temporary storage instead, as the path that is shown there is not the "actual" path to the source file anyway. What do you think @jeromelaban?

@MartinZikmund
Copy link
Member

@ajpinedam we discussed with Jerome and actually making a temporary copy would really be potentially breaking. Could you see if there is a way to get the file size from the Android Storage Access Framework URI (https://developer.android.com/guide/topics/providers/document-provider)? Then we could implement the StorageFile.GetBasicPropertiesAsync() API that would include this information, without making a local copy

@MartinZikmund
Copy link
Member

Sorry about that close, accidental :-D

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-16863/index.html

@ajpinedam
Copy link
Contributor Author

@jeromelaban @MartinZikmund here's the PR with the documentation changes related to this issue: #17143

@ajpinedam ajpinedam closed this Jun 14, 2024
@ajpinedam
Copy link
Contributor Author

Closing as we are not going to go this route as these changes break some other functionality. Refer to the documentation for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/automation Categorizes an issue or PR as relevant to project automation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] FileOpenPicker returns invalid file path for videos selected
4 participants