I've been beating my head against this problem for about a week with no visible path forward. For context I'm porting a C++ app to android NDK that has the requirement that it must save data in public folders that other apps must also have access to, such as an app that downloads certain files or assets to be used by the NDK app.
This folder basically equates to storage/emulated/0/COMPANY_NAME/* where * is several custom folders such as Assets, Logs, etc. It is my understanding that Android 11+ tightened its permission model so now if I want full access to the folders I need to use
MANAGE_EXTERNAL_STORAGE in the manifest (this app does not come from the play store so I do not need to worry about them accepting it)
And then in the code, call into JNI to get permission and check if the activity has Environment.isExternalStorageManager, and if not create an intent like so:
val intent = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION)
intent.data = "package:$packageName".toUri()
startActivityForResult(intent, REQUEST_MANAGE_EXTERNAL_STORAGE)
However, after doing this and checking Environment.isExternalStorageManager to verify I have permission (and accepting the popup) any attempt to create folders or access files still results in permission denied. Does anyone know what the issue might be or can link me to some examples of working code for Android 11+ that has working full public file access?
It ended up being an issue with the Giada device, after contacting them and moving to their newest image the issue resolved itself. Tried to set Morrison Changs comment as the answer but it seems the tick icon no longer exists where it used to be?