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
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user