summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-09-23 17:46:53 -0700
committerDianne Hackborn <hackbod@google.com>2012-09-24 11:02:45 -0700
commit556b09e184b891d9542092962ed248616810e054 (patch)
tree8b924f113c33e48370dfd3d157edfd4a0b809533 /core
parent6b3292ce5b3908c7433503f64c852cf2b27718ed (diff)
downloadframeworks_base-556b09e184b891d9542092962ed248616810e054.zip
frameworks_base-556b09e184b891d9542092962ed248616810e054.tar.gz
frameworks_base-556b09e184b891d9542092962ed248616810e054.tar.bz2
Fix issue #6926562: Ensure all multi-user cache files are managed correctly
Now we correctly iterate through the different user cache dirs. Also update documentation to describe the new cache pruning behavior, and deprecate the file modes for making files world readable/writable which we really don't want people using any more. Change-Id: I3708df3ddc697b1f5c511143cce7cc40a5a3d0bd
Diffstat (limited to 'core')
-rw-r--r--core/java/android/content/Context.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 524962cb..9162d29 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -63,18 +63,34 @@ public abstract class Context {
*/
public static final int MODE_PRIVATE = 0x0000;
/**
+ * @deprecated Creating world-readable files is very dangerous, and likely
+ * to cause security holes in applications. It is strongly discouraged;
+ * instead, applications should use more formal mechanism for interactions
+ * such as {@link ContentProvider}, {@link BroadcastReceiver}, and
+ * {@link android.app.Service}. There are no guarantees that this
+ * access mode will remain on a file, such as when it goes through a
+ * backup and restore.
* File creation mode: allow all other applications to have read access
* to the created file.
* @see #MODE_PRIVATE
* @see #MODE_WORLD_WRITEABLE
*/
+ @Deprecated
public static final int MODE_WORLD_READABLE = 0x0001;
/**
+ * @deprecated Creating world-writable files is very dangerous, and likely
+ * to cause security holes in applications. It is strongly discouraged;
+ * instead, applications should use more formal mechanism for interactions
+ * such as {@link ContentProvider}, {@link BroadcastReceiver}, and
+ * {@link android.app.Service}. There are no guarantees that this
+ * access mode will remain on a file, such as when it goes through a
+ * backup and restore.
* File creation mode: allow all other applications to have write access
* to the created file.
* @see #MODE_PRIVATE
* @see #MODE_WORLD_READABLE
*/
+ @Deprecated
public static final int MODE_WORLD_WRITEABLE = 0x0002;
/**
* File creation mode: for use with {@link #openFileOutput}, if the file
@@ -645,8 +661,12 @@ public abstract class Context {
* are some important differences:
*
* <ul>
- * <li>The platform does not monitor the space available in external storage,
- * and thus will not automatically delete these files. Note that you should
+ * <li>The platform does not always monitor the space available in external
+ * storage, and thus may not automatically delete these files. Currently
+ * the only time files here will be deleted by the platform is when running
+ * on {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} or later and
+ * {@link android.os.Environment#isExternalStorageEmulated()
+ * Environment.isExternalStorageEmulated()} returns true. Note that you should
* be managing the maximum space you will use for these anyway, just like
* with {@link #getCacheDir()}.
* <li>External files are not always available: they will disappear if the