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

Check if we can get rid of manage all file permission #702

Closed
freedomtan opened this issue May 3, 2023 · 6 comments · Fixed by #745
Closed

Check if we can get rid of manage all file permission #702

freedomtan opened this issue May 3, 2023 · 6 comments · Fixed by #745

Comments

@freedomtan
Copy link
Contributor

Currently, we have to manually enable the "Manage All Files Access Permission". That's not intuitive and could not be submit to Google Play Store.

#621

@anhappdev
Copy link
Collaborator

anhappdev commented May 12, 2023

I spent more time to resolve the issue but could not success.

Without the permission MANAGE_EXTERNAL_STORAGE the app can only read media files (*.jpg) but not other file types like *.pbtxt or *.tfrecord. Still don't know why.

The error would be:

E MediaProvider: Permission to access file: /storage/emulated/0/Documents/data/mlperf_datasets/coco/coco_val_full.pbtxt is denied

For user convenience, we can use this package https://pub.dev/packages/permission_handler to request MANAGE_EXTERNAL_STORAGE permission and it will show the UI for that. But it still doesn't resolve the issue that we still need the MANAGE_EXTERNAL_STORAGE permission.

@freedomtan
Copy link
Contributor Author

@freedomtan to test if this package https://pub.dev/packages/permission_handle work for devices having all file access permission in different places

@anhappdev
Copy link
Collaborator

I am moving the discussion from #727 (comment) to this issue for better tracking.

With the all file permission we used currently, it cannot be published to the Play Store.

Can we ignore this all file permission for Play Store publishing.

what if we make all the filenames with file extension like .png or .jpg (.txt -> .png). If this gonna work? @anhappdev to check it.

Renaming the file extension to a media file extension like .jpg or .png as @freedomtan suggested does work.
I renamed coco_val_full.pbtxt to coco_val_full.jpg and the app can now read the file without the read all file permission.

The question now is if and how we use this work-around. Using a not correct file extension is ... well... "not correct".

@freedomtan
Copy link
Contributor Author

Let's do something like coco_val_full.pbtxt.pseudo.png for coco_val_full.pbtxt so that we can remove the scary "all file permission".

@anhappdev
Copy link
Collaborator

Noted that if the local path in tasks.pbtxt is a directory. All files in that directory must be renamed to have a media file type extension.
For example, in the SNUSR dataset, if a vendor still uses .rgb8 files instead of .png, all .rgb8 files should add the pseudo.png extension.

@freedomtan
Copy link
Contributor Author

freedomtan commented May 21, 2024

We have to remove this permission and either

  1. have all the datasets in /sdcard/Android/data/org.mlcommons.android.mlperfbench/files (not /data/app/), or
  2. we have to rename all of those .png or .jpg files (and change corresponding dataset cpp files)

Let's do 1. first (for submitting 4.0 to the Play Store). Let's discuss if we want to implement 2. later.

copying data from /sdcard/mlperf_data/mlperf_datasets to /sdcard/Android/data/org.mlcommons.android.mlperfbench/files

cp -r /sdcard/mlperf_data/mlperf_datasets to /sdcard/Android/data/org.mlcommons.android.mlperfbench/files

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 a pull request may close this issue.

2 participants