My answer is based on my tests on the M Preview SDK version 2 using an emulator.
If you target the MNC preview API level, WRITE_EXTERNAL_STORAGE not provided by default and will be part of the new dynamic permissions API.
You will see the storage permission as a toggle button in the new application permissions menu in the device settings, and you can use Activity.requestPermissions to display a pop-up window for this permission.
However, if you target the api <MNC level, it will not be classified as a dangerous permission and thus will be provided without the ability to disable it (not displayed in the permission settings), and you will not be able to compile the code using Activity.requestPermissions anyway since the preliminary SDK provides minSdkVersion="MNC" using the new APIs.
This is a different behavior than placement permissions: regardless of the level of API you are aiming for, the user will be able to disable the location in the permissions menu.
For the permissions menu itself, the enable permission status is enabled by default if:
- Target API Level <MNC.
- Target API level = MNC, but you are updating the application on the device from a previous installation, where the target API level is less than the MNC.
Otherwise, the switch will be disabled by default.
Hope this helps.
Guillaume perrot
source share