diff options
| author | 2022-10-07 19:54:52 +0000 | |
|---|---|---|
| committer | 2022-10-20 19:13:16 +0000 | |
| commit | 963e45f0f596b5ae00bbf9954750bde9a7e23c2f (patch) | |
| tree | f728ee5a6f1e7a340487390ca98dca539ebaa895 | |
| parent | 06e4affcbcf963011fe7bdffc47b0f4e71a101d2 (diff) | |
docs: Update WRITE_EXTERNAL_STORAGE explanation
Clarify that this permission has no effect when an app's target SDK version is 29 or higher.
Bug: 251860134
Change-Id: I8adbc86976273d07b0698e4810bae59ddcbbbb6d
Test: built docs using go/abtd
| -rw-r--r-- | core/res/AndroidManifest.xml | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index bc29e1995714..4ca481b64e45 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -1134,7 +1134,28 @@ android:protectionLevel="dangerous" /> <!-- Allows an application to write to external storage. - <p class="note"><strong>Note:</strong> If <em>both</em> your <a + <p><strong>Note: </strong>If your app targets {@link android.os.Build.VERSION_CODES#R} or + higher, this permission has no effect. + + <p>If your app is on a device that runs API level 19 or higher, you don't need to declare + this permission to read and write files in your application-specific directories returned + by {@link android.content.Context#getExternalFilesDir} and + {@link android.content.Context#getExternalCacheDir}. + + <p>Learn more about how to + <a href="{@docRoot}training/data-storage/shared/media#update-other-apps-files">modify media + files</a> that your app doesn't own, and how to + <a href="{@docRoot}training/data-storage/shared/documents-files">modify non-media files</a> + that your app doesn't own. + + <p>If your app is a file manager and needs broad access to external storage files, then + the system must place your app on an allowlist so that you can successfully request the + <a href="#MANAGE_EXTERNAL_STORAGE><code>MANAGE_EXTERNAL_STORAGE</code></a> permission. + Learn more about the appropriate use cases for + <a href="{@docRoot}training/data-storage/manage-all-files>managing all files on a storage + device</a>. + + <p>If <em>both</em> your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> and <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code @@ -1142,12 +1163,6 @@ grants your app this permission. If you don't need this permission, be sure your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> is 4 or higher. - <p>Starting in API level 19, this permission is <em>not</em> required to - read/write files in your application-specific directories returned by - {@link android.content.Context#getExternalFilesDir} and - {@link android.content.Context#getExternalCacheDir}. - <p>If this permission is not allowlisted for an app that targets an API level before - {@link android.os.Build.VERSION_CODES#Q} this permission cannot be granted to apps.</p> <p>Protection level: dangerous</p> --> <permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" |