From 308a0487871ac52367a06c9e25d9c8ff390971e7 Mon Sep 17 00:00:00 2001 From: Zim Date: Thu, 25 Mar 2021 16:15:36 +0000 Subject: [PATCH] Address onAnrDelayStarted API comments Test: m Bug: 183446229 Change-Id: I433096c9fdc003b777f8a280f13f675a2d7ea8bf --- core/api/module-lib-current.txt | 3 ++- core/java/android/os/storage/StorageManager.java | 13 +++++++++++-- .../service/storage/ExternalStorageService.java | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index e3b7c8898039b..1956bad7ae71b 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -309,7 +309,8 @@ package android.os.storage { public class StorageManager { method public void notifyAppIoBlocked(@NonNull java.util.UUID, int, int, int); method public void notifyAppIoResumed(@NonNull java.util.UUID, int, int, int); - field public static final int APP_IO_BLOCKED_REASON_TRANSCODING = 0; // 0x0 + field public static final int APP_IO_BLOCKED_REASON_TRANSCODING = 1; // 0x1 + field public static final int APP_IO_BLOCKED_REASON_UNKNOWN = 0; // 0x0 } } diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java index c967deb5e810e..95011f4f7923f 100644 --- a/core/java/android/os/storage/StorageManager.java +++ b/core/java/android/os/storage/StorageManager.java @@ -2727,13 +2727,21 @@ public class StorageManager { } } + /** + * Reason to provide if app IO is blocked/resumed for unknown reasons + * + * @hide + */ + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) + public static final int APP_IO_BLOCKED_REASON_UNKNOWN = 0; + /** * Reason to provide if app IO is blocked/resumed because of transcoding * * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) - public static final int APP_IO_BLOCKED_REASON_TRANSCODING = 0; + public static final int APP_IO_BLOCKED_REASON_TRANSCODING = 1; /** * Constants for use with @@ -2744,7 +2752,8 @@ public class StorageManager { */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = { "APP_IO_BLOCKED_REASON_" }, value = { - APP_IO_BLOCKED_REASON_TRANSCODING + APP_IO_BLOCKED_REASON_TRANSCODING, + APP_IO_BLOCKED_REASON_UNKNOWN, }) public @interface AppIoBlockedReason {} diff --git a/core/java/android/service/storage/ExternalStorageService.java b/core/java/android/service/storage/ExternalStorageService.java index da1f457df5d92..05f37d73f3f9a 100644 --- a/core/java/android/service/storage/ExternalStorageService.java +++ b/core/java/android/service/storage/ExternalStorageService.java @@ -175,7 +175,7 @@ public abstract class ExternalStorageService extends Service { * * @param packageName the package name of the ANR'ing app * @param uid the uid of the ANR'ing app - * @param tid the tid of the ANR'ing app + * @param tid the thread id of the ANR'ing app * @param reason the reason the app is ANR'ing */ public void onAnrDelayStarted(@NonNull String packageName, int uid, int tid,