diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-10-22 14:08:29 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2012-10-22 15:04:35 -0700 |
commit | 8c16579994a58c5763788b4f6be864e8a8219575 (patch) | |
tree | 8997ee63a2a8027373a4589d8baf46a64d5af9e0 /core/java/android/content | |
parent | 6e7aa77565553e487a1e14478d9c30f512156232 (diff) | |
download | frameworks_base-8c16579994a58c5763788b4f6be864e8a8219575.zip frameworks_base-8c16579994a58c5763788b4f6be864e8a8219575.tar.gz frameworks_base-8c16579994a58c5763788b4f6be864e8a8219575.tar.bz2 |
Update docs for multi-user storage behavior.
Define external storage as being isolated for each user, with the
caveat for shared OBB files. Also mention external storage
permissions.
Bug: 7384941
Change-Id: Ib156b5874c5587749d7bc066791e9e88d931b174
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/Context.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 201b43f..7aa2507 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -33,6 +33,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.UserHandle; +import android.os.UserManager; import android.util.AttributeSet; import android.view.CompatibilityInfoHolder; import android.view.Display; @@ -587,6 +588,10 @@ public abstract class Context { * can read and write files placed here. * </ul> * + * <p>On devices with multiple users (as described by {@link UserManager}), + * each user has their own isolated external storage. Applications only + * have access to the external storage for the user they're running as.</p> + * * <p>Here is an example of typical code to manipulate a file in * an application's private storage:</p> * @@ -616,6 +621,9 @@ public abstract class Context { * {@sample development/samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java * private_picture} * + * <p>Writing to this path requires the + * {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission.</p> + * * @param type The type of files directory to return. May be null for * the root of the files directory or one of * the following Environment constants for a subdirectory: @@ -641,6 +649,11 @@ public abstract class Context { * Return the directory where this application's OBB files (if there * are any) can be found. Note if the application does not have any OBB * files, this directory may not exist. + * + * <p>On devices with multiple users (as described by {@link UserManager}), + * multiple users may share the same OBB storage location. Applications + * should ensure that multiple instances running under different users + * don't interfere with each other.</p> */ public abstract File getObbDir(); @@ -689,6 +702,13 @@ public abstract class Context { * can read and write files placed here. * </ul> * + * <p>On devices with multiple users (as described by {@link UserManager}), + * each user has their own isolated external storage. Applications only + * have access to the external storage for the user they're running as.</p> + * + * <p>Writing to this path requires the + * {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission.</p> + * * @return Returns the path of the directory holding application cache files * on external storage. Returns null if external storage is not currently * mounted so it could not ensure the path exists; you will need to call |