When saveAs method is called the file picker on android doesn't allow changing location from initial Downloads directory to anywhere else.
Screenshot emulator API 34
![Screenshot_1705147961](https://github.com/incrediblezayed/file_saver/assets/9675199/c937ee1d-a1ab-4f17-b0ab-8300b138f9cf)
This seems to be causes by intent.putExtra(Intent.EXTRA_MIME_TYPES, type) for some reason and removing it resolves the issue. It's not the only intent parameter that seems unnecessary:
EXTRA_MIME_TYPES and EXTRA_LOCAL_ONLY - are for filtering available files when opening/reading them
FLAG_GRANT_PERSISTABLE_URI_PERMISSION - I don't think we need a persistent permission and the flag
doesn't do anything by itself. According to the documentation takePersistableUriPermission must be called after to actually make the permission persistent
FLAG_GRANT_READ_URI_PERMISSION - I think we only need permission for the specific file.
FLAG_GRANT_WRITE_URI_PERMISSION sounds necessary but everything seems to work fine without it so I'm not sure about it
When
saveAs
method is called the file picker on android doesn't allow changing location from initial Downloads directory to anywhere else.Screenshot emulator API 34
![Screenshot_1705147961](https://github.com/incrediblezayed/file_saver/assets/9675199/c937ee1d-a1ab-4f17-b0ab-8300b138f9cf)This seems to be causes by
intent.putExtra(Intent.EXTRA_MIME_TYPES, type)
for some reason and removing it resolves the issue. It's not the only intent parameter that seems unnecessary:EXTRA_MIME_TYPES
andEXTRA_LOCAL_ONLY
- are for filtering available files when opening/reading themFLAG_GRANT_PERSISTABLE_URI_PERMISSION
- I don't think we need a persistent permission and the flag doesn't do anything by itself. According to the documentationtakePersistableUriPermission
must be called after to actually make the permission persistentFLAG_GRANT_READ_URI_PERMISSION
- I think we only need permission for the specific file.FLAG_GRANT_WRITE_URI_PERMISSION
sounds necessary but everything seems to work fine without it so I'm not sure about it