From 75bb8caa552cc049da8f60f806180618ef256014 Mon Sep 17 00:00:00 2001 From: shafik Date: Fri, 15 May 2020 14:54:07 +0100 Subject: [PATCH] Update documentation for ACTION_CLEAR_APP_CACHE The actual cache clearing is not async anymore, so we can report the status to the calling app. Here, we just change the documentation to make the caller aware of the 3rd possible activity result: EIO. This value is returned if an error happens while MediaProvider is clearing the cache. In this case, we don't know how much of the cache was deleted, if at all. Test: build Bug: 155290762 Change-Id: I3a04a9b5b6b07c6ec61e97a4cb0d3bc8b10b0370 --- core/java/android/os/storage/StorageManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java index a1a11ed54609d..16e5156c10de9 100644 --- a/core/java/android/os/storage/StorageManager.java +++ b/core/java/android/os/storage/StorageManager.java @@ -226,9 +226,10 @@ public class StorageManager { *

* This intent should be launched using * {@link Activity#startActivityForResult(Intent, int)} so that the user - * knows which app is requesting to clear cache. The returned result will - * be {@link Activity#RESULT_OK} if the activity was launched and the user accepted to clear - * cache, or {@link Activity#RESULT_CANCELED} otherwise. + * knows which app is requesting to clear cache. The returned result will be: + * {@link Activity#RESULT_OK} if the activity was launched and all cache was cleared, + * {@link OsConstants#EIO} if an error occurred while clearing the cache or + * {@link Activity#RESULT_CANCELED} otherwise. */ @RequiresPermission(android.Manifest.permission.MANAGE_EXTERNAL_STORAGE) @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)