erisu commented on code in PR #556: URL: https://github.com/apache/cordova-plugin-file/pull/556#discussion_r1083596796
########## README.md: ########## @@ -269,6 +269,17 @@ Marshmallow requires the apps to ask for permissions when reading/writing to ext for these two directories unless external storage is not mounted. However due to a limitation, when external storage is not mounted, it would ask for permission to write to `cordova.file.externalApplicationStorageDirectory`. +### SDK Target less than 29 + +As the official document [Storage updates in Android 11](https://developer.android.com/about/versions/11/privacy/storage), `WRITE_EXTERNAL_STORAGE` permission no longer provide any additional access. +If you need to add this permission, please add followings in your `config.xml`. + +```xml + <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/uses-permission" xmlns:android="http://schemas.android.com/apk/res/android"> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> + </edit-config> +``` Review Comment: ```suggestion From the official [Storage updates in Android 11](https://developer.android.com/about/versions/11/privacy/storage) documentation, the [`WRITE_EXTERNAL_STORAGE`](https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE) permission no longer provide any additional access. > If this permission is not allowlisted for an app that targets an API level before [`Build.VERSION_CODES.Q`](https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q) (SDK 29) this permission cannot be granted to apps. If you need to add this permission, please add the following to your `config.xml`. ```xml <config-file target="AndroidManifest.xml" parent="/*" xmlns:android="http://schemas.android.com/apk/res/android"> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" /> </config-file> ``` ``` I think it should be `config-file` and not `edit-config`. `edit-config` is for updating exisiting elements. I am not sure what happend when merging `android:name` on an element that already has this attribute. I believe there should be multiple `uses-permission` nodes, one per permission. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
