Search code examples
javaandroidkotlinandroid-11

Is it possible for READ_EXTERNAL_STORAGE to give varying degrees of access, in Android 11 depending on the circumstance?


I have two apps, both do different things but both target sdk version 30, and request READ_EXTERNAL_STORAGE permission both in the manifest and during runtime. Both are brand new and had not been installed on the device previously.

Using a samsung phone running Android 11, I then checked the permission settings on both apps and discovered this discrepancy:

  • App #1 has its permission set to "allow access to media only," which was what I expected due to the recent changes to storage access. App #2 however, had its permission set to "Allow access to manage all files."
  • When App #1 prompts the user for read permission, the message that the system displays is "Allow ____ to access photos and media on your device?" But App #2 prompts "Allow ____ to access photos, files, and media on your device?"

Is this possible? App #2 definitely does not ever request MANAGE_EXTERNAL_STORAGE, both of them only request the read permission which does work. But App #2 has the same permissions to the system file manager, that clearly can't be right.


Solution

  • Found the issue. App #2 was built using androiddeployqt which for some reason was overriding the target sdk version I specified, so it was really an sdk level 28 app. I forced it to target the correct version and it now functions as expected.