How to access personal file in SD card in work profile App?

9.7k Views Asked by At

According to Google's introduction https://developer.android.com/work/managed-profiles.html, personal files in SD cards are not accessible by work profile application. However, we can see all files in DocumentsUI(application provided by system) by click "personality" after sending Intent(ACTION_GET_CONTENT), moreover file name, size and date are shown, which seems that files are readable. But when we use the uri from onActivityResult I got FileNotException (EACCES: permission denied) if I do reading operation (READ_EXTERNAL_STORAGE permission is already granted). Can we access these personal files from a work profile applications? If yes, how can I read and write them?

Thanks in advance!

Reference question @ Access SD card data from android for work app, is the answer true?

1

There are 1 best solutions below

0
On

With more test, I'm able to access some video/audio/picture files from DocumentsUI(by system). But for more files provided by 3rd-party application(such as file explorer), failure still exist. I suppose that the result depends on file providers. If content uri returned with read permission granted, application in work profile is able to read.