summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Hufnagle <khufnagle@google.com> 2016-09-27 00:03:58 +0000
committer android-build-merger <android-build-merger@google.com> 2016-09-27 00:03:58 +0000
commitcf7a2e1efd0c25c2d15c730d6a1f5e76565a3788 (patch)
treef382b13779b291b7651eadab4257599b132d7723
parent77941aaf28c2ab01f937e0114cc92474f8973e2e (diff)
parentba65a9285519c7d7fc589402f1b9bfbf7c313a44 (diff)
docs: Added note in getCacheDir() that developers can use directory obtained from getExternalCacheDir() to store app caches larger than 1 MB. am: e9681e192a
am: ba65a92855 Change-Id: Ia3fc2e6cfc85269a04a721d7c6fe14e04555a121
-rw-r--r--core/java/android/content/Context.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 978d04331c93..ad446c45a8ab 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -1130,7 +1130,9 @@ public abstract class Context {
* <strong>Note: you should not <em>rely</em> on the system deleting these
* files for you; you should always have a reasonable maximum, such as 1 MB,
* for the amount of space you consume with cache files, and prune those
- * files when exceeding that space.</strong>
+ * files when exceeding that space.</strong> If your app requires a larger
+ * cache (larger than 1 MB), you should use {@link #getExternalCacheDir()}
+ * instead.
* <p>
* The returned path may change over time if the calling app is moved to an
* adopted storage device, so only relative paths should be persisted.
@@ -1142,6 +1144,7 @@ public abstract class Context {
* @see #openFileOutput
* @see #getFileStreamPath
* @see #getDir
+ * @see #getExternalCacheDir
*/
public abstract File getCacheDir();
@@ -1190,7 +1193,7 @@ public abstract class Context {
* </ul>
* <p>
* If a shared storage device is emulated (as determined by
- * {@link Environment#isExternalStorageEmulated(File)}), it's contents are
+ * {@link Environment#isExternalStorageEmulated(File)}), its contents are
* backed by a private user data partition, which means there is little
* benefit to storing data here instead of the private directory returned by
* {@link #getCacheDir()}.